sipxportlib  Version 3.3
OsFileLinux.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2005, 2007 SIPez LLC.
3 // Licensed to SIPfoundry under a Contributor Agreement.
4 //
5 // Copyright (C) 2004-2007 SIPfoundry Inc.
6 // Licensed by SIPfoundry under the LGPL license.
7 //
8 // Copyright (C) 2004, 2005 Pingtel Corp.
9 // Licensed to SIPfoundry under a Contributor Agreement.
10 //
11 // $$
13 
14 #ifndef _OsFileLinux_h_
15 #define _OsFileLinux_h_
16 
17 // SYSTEM INCLUDES
18 
19 // APPLICATION INCLUDES
20 
21 
22 // DEFINES
23 // MACROS
24 // EXTERNAL FUNCTIONS
25 // EXTERNAL VARIABLES
26 // CONSTANTS
27 // STRUCTS
28 // TYPEDEFS
29 // FORWARD DECLARATIONS
30 class OsFileInfoBase;
31 class OsFileInfoLinux;
32 class OsPathLinux;
33 
34 //:OS class for creating,reading, writing, manipulating files.
35 class OsFileLinux : public OsFileBase
36 {
37 /* //////////////////////////// PUBLIC //////////////////////////////////// */
38 public:
39 
40 
41 /* ============================ CREATORS ================================== */
42 
43  OsFileLinux(const OsPathBase& filename);
44  //:Default constructor
45 
46  virtual ~OsFileLinux();
47  //:Destructor
48 
49 /* ============================ MANIPULATORS ============================== */
50 
51  OsStatus filelock(const bool wait);
52  //: Cross-process locks this file, optionally waiting for the lock.
53  //: Returns:
54  //: OS_SUCCESS if successful
55  //: OS_FAILED if unsuccessful
56  //: Notes: This method should only be called by OsFileBase::open()!
57 
59  //: Cross-process unlocks this file.
60  //: Notes: This method should only be called by OsFileBase::close()!
61 
62  OsStatus setLength(unsigned long newLength);
63  //: Sets the length of the file specified by the object to the new size
64  //: Sets the length of the file specified by the object to the new size
65  //: Shrinking or Growing the file as needed.
66 
67 
68  OsStatus setReadOnly(UtlBoolean isReadOnly);
69  //: Sets the file to the new state
70  //: Returns:
71  //: OS_SUCCESS if successful
72  //: OS_INVALID if failed
73 
74 
75  OsStatus touch();
76  //: Updates the date and time on the file. Creates if needed.
77 
78 /* ============================ ACCESSORS ================================= */
79 
80 
81 
82 /* ============================ INQUIRY =================================== */
83 
84  UtlBoolean isReadonly() const;
85  //: Returns TRUE if file is readonly
86 
87 
88  virtual OsStatus getFileInfo(OsFileInfoBase& rFileinfo) const;
89  //: Returns all the relevant info on this file
90 
91 /* //////////////////////////// PROTECTED ///////////////////////////////// */
92 protected:
93  OsFileLinux(const OsFileLinux& rOsFileLinux);
94  //:Copy constructor
95 
96  OsFileLinux& operator=(const OsFileLinux& rhs);
97  //:Assignment operator
98 
99 /* //////////////////////////// PRIVATE /////////////////////////////////// */
100 private:
101 
102 };
103 
104 /* ============================ INLINE METHODS ============================ */
105 
106 #endif // _OsFileLinux_h_
107 
108 
OsStatus filelock(const bool wait)
Definition: OsFileLinux.cpp:70
OsFileLinux(const OsPathBase &filename)
Definition: OsFileLinux.cpp:46
virtual ~OsFileLinux()
Definition: OsFileLinux.cpp:62
OsStatus
Definition: OsStatus.h:27
virtual OsStatus getFileInfo(OsFileInfoBase &rFileinfo) const
Definition: OsFileLinux.cpp:177
OsStatus setLength(unsigned long newLength)
Definition: OsFileLinux.cpp:115
Definition: OsFileInfoBase.h:34
Definition: OsFileInfoLinux.h:35
OsStatus fileunlock()
Definition: OsFileLinux.cpp:91
OsStatus setReadOnly(UtlBoolean isReadOnly)
Definition: OsFileLinux.cpp:125
Definition: OsFileLinux.h:35
int UtlBoolean
Definition: UtlDefs.h:41
Definition: OsPathLinux.h:33
Definition: OsFileBase.h:42
UtlBoolean isReadonly() const
Definition: OsFileLinux.cpp:166
OsStatus touch()
Definition: OsFileLinux.cpp:140
OsFileLinux & operator=(const OsFileLinux &rhs)
Definition: OsFileLinux.cpp:207
Definition: OsPathBase.h:34