HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TIL_FileIterator.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: TIL_FileIterator.h (TIL library, C++)
7  *
8  * COMMENTS:
9  * A quick iterator class for writing numbered files. Will prompt the
10  * user if an existing file with a matching name is present.
11  */
12 #ifndef TIL_FILE_ITERATOR_H
13 #define TIL_FILE_ITERATOR_H
14 
15 #include "TIL_API.h"
16 #include <UT/UT_String.h>
17 
18 enum {
23 };
24 
26 {
27 public:
28  virtual ~TIL_FileIteratorUI();
29  virtual bool errorAbort(const char *file,bool &continue_always,
30  bool multiple) = 0;
31 
32  virtual int overwriteConfirm(const char *file,bool &continue_always,
33  bool multiple) = 0;
34  virtual void showMessage(const char *message) = 0;
35 };
36 
38 {
39 public:
40  TIL_FileIterator(const char *filepat);
42 
43  void init(int fstart, int fend, int step = 1);
44 
45  const char *iterate();
46  int getFrame() const { return myCurrentFrame -myStep; }
47  bool isLastFrame() const { return myCurrentFrame > myEnd; }
48  float getFractionDone() const;
49 
50  static bool errorAbort(const char *file,
51  bool &continue_always,
52  bool multiple);
53 
54  static int overwriteConfirm(const char *file,
55  bool &continue_always,
56  bool multiple);
57  static int overwrite(const char *file,
58  bool &continue_always,
59  bool multiple);
60 
61  static void showMessage(const char *message);
62 
63  static void setUI(TIL_FileIteratorUI *ui);
64 
65 private:
66  UT_String myFilePat;
67  UT_String myPrefix;
68  UT_String mySuffix;
69  UT_String myCurrentFile;
70  int myPad;
71  int myStart, myEnd, myStep;
72  int myCurrentFrame;
73  int myCurrentIter;
74  bool myMultipleFiles;
75  bool myMultipleFilesUseIter;
76 };
77 
78 #endif
int myStep
Definition: GT_CurveEval.h:264
int getFrame() const
GLuint GLsizei const GLchar * message
Definition: glcorearb.h:2542
bool isLastFrame() const
#define TIL_API
Definition: TIL_API.h:10