HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
UT_PathFileInfo.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: UT_PathFileInfo.h ( Utility Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __UT_PathFileInfo__
12 #define __UT_PathFileInfo__
13 
14 #include "FS_API.h"
15 class UT_PathFile;
16 
17 #include <UT/UT_String.h>
18 
20 {
24 };
25 
27 {
28 public:
30  virtual ~UT_PathFileInfo();
31 
32  UT_PathFile *getOwner() { return myOwner; }
33 
34  // if str is 0, then the myFileFullPath and myFileName are set.
35  void computeFullPath(UT_String *str);
36 
37  // If you know which directory the file is located in then call the
38  // first of the next two. Otherwise call the second one.
39  void deconstructFullPath(int level);
40  int deconstructFullPath();
41 
42  virtual void copy(UT_PathFileInfo *src,
43  UT_PF_CopyReason reason);
44 
45 
46  void setDiskPath(const char *p) { myDiskPath.harden(p); }
47  void setFullPath(const char *);
48  void setFileName(const char *);
49  void setBaseName(const char *);
50  void setExtension(const char *);
51  void setDirIndex(int);
52 
53  // prepareForSave modifies the Dir Index if necessary
54  // until it refers to an appropriate location.
55  // it returns 0 if no such location was found; 1 ow.
56  // The avoid_* flags determine how the location is
57  // found:
58  //
59  // avoid_overwrite means it won't overwrite any
60  // existing files
61  // avoid_hide means it won't be hidden by hide files
62  // avoid_override means it must the topmost file in
63  // the path.
64 
65  int prepareForSave(int avoid_overwrite=0,
66  int avoid_hide=1,
67  int avoid_override=1);
68 
69  void setHideFlag(int o);
70  void setAppendFlag(int o);
71  void setNoSaveFlag(int o);
72  void setFilteredFlag(int o) { myFilteredFlag = o; }
73 
74 
75  const char *getDiskPath() { return myDiskPath; }
76  const char *getFullPath();
77  const char *getDirectory();
78  const char *getFileName();
79  const char *getBaseName();
80  const char *getExtension();
81  int getDirIndex();
82 
83  int getHideFlag();
84  int getAppendFlag();
85  int getNoSaveFlag();
86  int getFilteredFlag() { return myFilteredFlag; }
87 
88 private:
89  // not implemented:
90  UT_PathFileInfo &operator =(const UT_PathFileInfo&);
91 
92 private:
93 
94  void updateHintFlag();
95 
96  UT_String myDiskPath;
97  UT_String myFullPath;
98  UT_String myDirectory;
99  UT_String myFileName;
100  UT_String myBaseName;
101  UT_String myExtension;
102 
103  int myDirIndex;
104 
105  unsigned int myHideFlag:1,
106  myAppendFlag:1,
107  myNoSaveFlag:1,
108  myFilteredFlag:1,
109  myFullPathOKflag:1,
110  myDirIndexOKflag:1,
111  myFileNameOKflag:1,
112  myBaseNameOKflag:1,
113  myExtensionOKflag:1,
114  myHintOKflag:1;
115 
116  UT_PathFile *myOwner;
117 };
118 
119 #endif
120 
GLint level
Definition: glcorearb.h:107
void setDiskPath(const char *p)
void setFilteredFlag(int o)
const char * getDiskPath()
UT_PathFile * getOwner()
UT_PF_CopyReason
#define FS_API
Definition: FS_API.h:10
GLenum src
Definition: glcorearb.h:1792