sipxportlib  Version 3.3
OsFileWnt.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2004-2006 SIPfoundry Inc.
3 // Licensed by SIPfoundry under the LGPL license.
4 //
5 // Copyright (C) 2004-2006 Pingtel Corp. All rights reserved.
6 // Licensed to SIPfoundry under a Contributor Agreement.
7 //
8 // $$
10 
11 
12 #ifndef _OsFileWnt_h_
13 #define _OsFileWnt_h_
14 
15 // SYSTEM INCLUDES
16 #include "os/OsStatus.h"
17 
18 // APPLICATION INCLUDES
19 
20 
21 // DEFINES
22 // MACROS
23 // EXTERNAL FUNCTIONS
24 // EXTERNAL VARIABLES
25 // CONSTANTS
26 // STRUCTS
27 // TYPEDEFS
28 // FORWARD DECLARATIONS
29 class OsFileInfoBase;
30 class OsFileInfoWnt;
31 class OsPathWnt;
32 
33 //:OS class for creating,reading, writing, manipulating files.
34 class OsFileWnt : public OsFileBase
35 {
36 /* //////////////////////////// PUBLIC //////////////////////////////////// */
37 public:
38 
39 
40 /* ============================ CREATORS ================================== */
41 
42  OsFileWnt(const OsPathBase& filename);
43  //:Default constructor
44 
45  virtual
46  ~OsFileWnt();
47  //:Destructor
48 
49 /* ============================ MANIPULATORS ============================== */
50 
52  //: Cross-process unlocks this file.
53  //: Notes: This method should only be called by OsFileBase::close()!
54 
55 
56  OsStatus filelock(const bool wait);
57  //: Cross-process locks this file, optionally waiting for the lock.
58  //: Returns:
59  //: OS_SUCCESS if successful
60  //: OS_FAILED if unsuccessful
61  //: Notes: This method should only be called by OsFileBase::open()!
62 
63 
64  OsStatus setLength(unsigned long newLength);
65  //: Sets the length of the file specified by the object to the new size
66  //: Sets the length of the file specified by the object to the new size
67  //: Shrinking or Growing the file as needed.
68 
69 
70  OsStatus touch();
71  //: Updates the date and time on the file. Creates if needed.
72 
73 
74 /* ============================ ACCESSORS ================================= */
75 
77  static OsTime OsFileWnt::fileTimeToOsTime(FILETIME ft);
84  virtual OsStatus getFileInfo(OsFileInfoBase& rFileinfo) const;
92 /* ============================ INQUIRY =================================== */
93 
94  UtlBoolean isReadonly() const;
95  //: Returns TRUE if file is readonly
96 
97 /* //////////////////////////// PROTECTED ///////////////////////////////// */
98 protected:
99  OsFileWnt(const OsFileWnt& rOsFileWnt);
100  //:Copy constructor
101 
102  OsFileWnt& operator=(const OsFileWnt& rhs);
103  //:Assignment operator
104 
105 /* //////////////////////////// PRIVATE /////////////////////////////////// */
106 private:
107 
108 };
109 
110 /* ============================ INLINE METHODS ============================ */
111 
112 #endif // _OsFileWnt_h_
113 
114 
static OsTime fileTimeToOsTime(FILETIME ft)
Convert Windows FILETIME to an OsTime.
Definition: OsFileWnt.cpp:85
OsStatus setLength(unsigned long newLength)
Definition: OsFileWnt.cpp:61
virtual ~OsFileWnt()
Definition: OsFileWnt.cpp:50
OsFileWnt & operator=(const OsFileWnt &rhs)
Definition: OsFileWnt.cpp:175
OsStatus touch()
Definition: OsFileWnt.cpp:116
OsStatus
Definition: OsStatus.h:27
OsStatus filelock(const bool wait)
Definition: OsFileWnt.cpp:78
Definition: OsFileInfoBase.h:34
Definition: OsFileWnt.h:34
Definition: OsPathWnt.h:35
UtlBoolean isReadonly() const
Definition: OsFileWnt.cpp:158
OsFileWnt(const OsPathBase &filename)
Definition: OsFileWnt.cpp:34
Definition: OsTime.h:37
OsStatus fileunlock()
Definition: OsFileWnt.cpp:70
int UtlBoolean
Definition: UtlDefs.h:41
virtual OsStatus getFileInfo(OsFileInfoBase &rFileinfo) const
Get information about a file.
Definition: OsFileWnt.cpp:94
Definition: OsFileBase.h:42
Definition: OsFileInfoWnt.h:37
Definition: OsPathBase.h:34