Rudiments
permissions.h
1 // Copyright (c) 1999-2002 David Muse
2 // See the COPYING file for more information.
3 
4 #ifndef RUDIMENTS_PERMISSIONS_H
5 #define RUDIMENTS_PERMISSIONS_H
6 
7 #include <rudiments/private/permissionsincludes.h>
8 
9 #ifdef RUDIMENTS_NAMESPACE
10 namespace rudiments {
11 #endif
12 
32 class RUDIMENTS_DLLSPEC permissions {
33  public:
37  static bool setFilePermissions(const char *filename,
38  mode_t perms);
39 
44  static bool setFilePermissions(int32_t fd, mode_t perms);
45 
73  static mode_t evalPermString(const char *permstring);
74 
76  static char *evalPermOctal(mode_t mode);
77 
82  static mode_t everyoneReadWrite();
83 
88  static mode_t everyoneReadWriteExecute();
89 
94  static mode_t ownerRead();
95 
100  static mode_t ownerWrite();
101 
106  static mode_t ownerExecute();
107 
112  static mode_t ownerReadWrite();
113 
118  static mode_t ownerReadExecute();
119 
124  static mode_t ownerReadWriteExecute();
125 
130  static mode_t groupRead();
131 
136  static mode_t groupWrite();
137 
142  static mode_t groupExecute();
143 
148  static mode_t groupReadWrite();
149 
154  static mode_t groupReadExecute();
155 
160  static mode_t groupReadWriteExecute();
161 
166  static mode_t othersRead();
167 
172  static mode_t othersWrite();
173 
178  static mode_t othersExecute();
179 
184  static mode_t othersReadWrite();
185 
190  static mode_t othersReadExecute();
191 
196  static mode_t othersReadWriteExecute();
197 
202  static mode_t saveInSwapSpace();
203 
208  static mode_t setUserId();
209 
214  static mode_t setGroupId();
215 };
216 
217 #ifdef RUDIMENTS_NAMESPACE
218 }
219 #endif
220 
221 #endif