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_NonCopyable.h>
17 #include <UT/UT_String.h>
18 
19 enum {
24 };
25 
27 {
28 public:
29  TIL_FileIteratorUI() = default;
30  virtual ~TIL_FileIteratorUI();
32 
33  virtual bool errorAbort(const char *file,bool &continue_always,
34  bool multiple) = 0;
35 
36  virtual int overwriteConfirm(const char *file,bool &continue_always,
37  bool multiple) = 0;
38  virtual void showMessage(const char *message) = 0;
39 };
40 
42 {
43 public:
44  TIL_FileIterator(const char *filepat);
47 
48  void init(int fstart, int fend, int step = 1);
49 
50  const char *iterate();
51  int getFrame() const { return myCurrentFrame -myStep; }
52  bool isLastFrame() const { return myCurrentFrame > myEnd; }
53  float getFractionDone() const;
54 
55  static bool errorAbort(const char *file,
56  bool &continue_always,
57  bool multiple);
58 
59  static int overwriteConfirm(const char *file,
60  bool &continue_always,
61  bool multiple);
62  static int overwrite(const char *file,
63  bool &continue_always,
64  bool multiple);
65 
66  static void showMessage(const char *message);
67 
68  static void setUI(TIL_FileIteratorUI *ui);
69 
70 private:
71  UT_String myFilePat;
72  UT_String myPrefix;
73  UT_String mySuffix;
74  UT_String myCurrentFile;
75  int myPad;
76  int myStart, myEnd, myStep;
77  int myCurrentFrame;
78  int myCurrentIter;
79  bool myMultipleFiles;
80  bool myMultipleFilesUseIter;
81 };
82 
83 #endif
GLuint GLsizei const GLchar * message
Definition: glcorearb.h:2543
int myStep
Definition: GT_CurveEval.h:264
int getFrame() const
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
bool isLastFrame() const
#define TIL_API
Definition: TIL_API.h:10