sipxportlib  Version 3.3
OsFileSystemWnt.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2006 SIPez LLC.
3 // Licensed to SIPfoundry under a Contributor Agreement.
4 //
5 // Copyright (C) 2004-2006 SIPfoundry Inc.
6 // Licensed by SIPfoundry under the LGPL license.
7 //
8 // Copyright (C) 2004-2006 Pingtel Corp. All rights reserved.
9 // Licensed to SIPfoundry under a Contributor Agreement.
10 //
11 // $$
13 
14 
15 #ifndef _OsFileSystemWnt_h_
16 #define _OsFileSystemWnt_h_
17 
18 // SYSTEM INCLUDES
19 #include <stdio.h>
20 #if defined(_WIN32)
21 
22 #ifndef WINCE
23 # include <io.h>
24 # include <direct.h>
25 # include <share.h>
26 #endif
27 
28 #elif defined(_VXWORKS)
29 # include <unistd.h>
30 # include <dirent.h>
31 #elif defined(__pingtel_on_posix__)
32 # include <unistd.h>
33 # include <stdlib.h>
34 # define O_BINARY 0 // There is no notion of a "not binary" file under POSIX,
35  // so we just set O_BINARY used below to no bits in the mask.
36 #else
37 # error Unsupported target platform.
38 #endif
39 
40 #ifndef WINCE
41 # include <sys/types.h>
42 # include <sys/stat.h>
43 # include <fcntl.h>
44 #endif
45 
46 #ifndef WINCE
47 #include <errno.h>
48 #endif
49 
50 // APPLICATION INCLUDES
51 #include "os/OsFS.h"
52 
53 // DEFINES
54 // MACROS
55 // EXTERNAL FUNCTIONS
56 // EXTERNAL VARIABLES
57 // CONSTANTS
58 // STRUCTS
59 // TYPEDEFS
60 // FORWARD DECLARATIONS
61 class OsPathWnt;
62 class OsFileInfoWnt;
63 
64 //:Helper class that constructs OsDir and OsFile objects
65 //:for you. This may be expanded to include enumerating versions
66 //:of these functions.
67 
69 {
70 /* //////////////////////////// PUBLIC //////////////////////////////////// */
71 public:
72 
73 /* ============================ CREATORS ================================== */
74 
75 
76 /* ============================ MANIPULATORS ============================== */
77 
79  //:Assignment operator
80 
81  static OsStatus copy(const OsPathWnt& rSource, const OsPathWnt& rOsPath);
82  //: Returns TRUE if file moved ok
83 
84  static OsStatus rename(const OsPathWnt& rSourceFile, const OsPathWnt& rDestFile);
85  //: Renames the directory or file specified by path
86 
87  static OsStatus change(const OsPathWnt& rOsPath);
88  //: Change the current working directory to the specified location
89 
90  static OsStatus createDir(const OsPathWnt& rOsPath);
91  //: Creates the specified directory
92  //: Fails if a file by the same name already exists in the directory
93 
94  static OsStatus setReadOnly(const OsPathWnt& rOsPath, UtlBoolean bState);
95  //: Sets the specifed file or path to readonly
96 
97 /* ============================ ACCESSORS ================================= */
98 
99  static OsStatus getFileInfo(OsPathBase& filespec, OsFileInfoBase& rfileInfo);
100  //: Retrieve system info for specified directory of file
101 
103  //: returns the current working directory for the process
104 
105 /* ============================ ACCESSORS ================================= */
106  static OsStatus OsFileSystemWnt::getFileInfo(OsPathWnt& rFilespec, OsFileInfoWnt& rFileInfo);
107  //: Retrieve system info for specified directory of file
108 /* ============================ INQUIRY =================================== */
109 
110 /* //////////////////////////// PROTECTED ///////////////////////////////// */
111 protected:
112 
113  OsFileSystemWnt(const OsFileSystemWnt& rOsFileSystemWnt);
114  //:Copy constructor
115 
116  OsFileSystemWnt();
117  //:Default constructor
118 
119  virtual ~OsFileSystemWnt();
120  //:Destructor
121 
122 /* //////////////////////////// PRIVATE /////////////////////////////////// */
123 private:
124 
125 
126 };
127 
128 /* ============================ INLINE METHODS ============================ */
129 
130 
131 
132 #endif // _OsFileSystemWnt_h_
133 
134 
static OsStatus getWorkingDirectory(OsPathWnt &rPath)
Definition: OsFileSystemWnt.cpp:94
static OsStatus createDir(const OsPathWnt &rOsPath)
Definition: OsFileSystemWnt.cpp:86
static OsStatus setReadOnly(const OsPathWnt &rOsPath, UtlBoolean bState)
OsFileSystemWnt()
Definition: OsFileSystemWnt.cpp:27
OsStatus
Definition: OsStatus.h:27
Definition: OsFileSystemWnt.h:68
virtual ~OsFileSystemWnt()
Definition: OsFileSystemWnt.cpp:37
Definition: OsFileInfoBase.h:34
Definition: OsPathWnt.h:35
static OsStatus copy(const OsPathWnt &rSource, const OsPathWnt &rOsPath)
Definition: OsFileSystemWnt.cpp:55
int UtlBoolean
Definition: UtlDefs.h:41
OsFileSystemWnt & operator=(const OsFileSystemWnt &rhs)
Definition: OsFileSystemWnt.cpp:45
static OsStatus rename(const OsPathWnt &rSourceFile, const OsPathWnt &rDestFile)
Definition: OsFileSystemWnt.cpp:64
Definition: OsFileInfoWnt.h:37
Definition: OsPathBase.h:34
static OsStatus getFileInfo(OsPathBase &filespec, OsFileInfoBase &rfileInfo)
static OsStatus change(const OsPathWnt &rOsPath)
Definition: OsFileSystemWnt.cpp:74