Rudiments
directory.h
1 // Copyright (c) 2004 David Muse
2 // See the COPYING file for more information.
3 
4 #ifndef RUDIMENTS_DIRECTORY_H
5 #define RUDIMENTS_DIRECTORY_H
6 
7 #include <rudiments/private/directoryincludes.h>
8 
9 #ifdef RUDIMENTS_NAMESPACE
10 namespace rudiments {
11 #endif
12 
13 class directoryprivate;
14 
17 class RUDIMENTS_DLLSPEC directory {
18  public:
20  directory();
21 
23  ~directory();
24 
26  bool open(const char *path);
27 
29  bool close();
30 
33  void rewind();
34 
37  uint64_t getChildCount();
38 
44  char *getChildName(uint64_t index);
45 
48  int64_t maxFileNameLength();
49 
53  int64_t maxPathLength();
54 
59  bool canAccessLongFileNames();
60 
62  static bool create(const char *path, mode_t perms);
63 
65  static bool remove(const char *path);
66 
72  static char *getCurrentWorkingDirectory();
73 
75  static bool changeDirectory(const char *path);
76 
78  static bool changeRoot(const char *path);
79 
82  static int64_t maxFileNameLength(const char *pathname);
83 
87  static int64_t maxPathLength(const char *pathname);
88 
93  static bool canAccessLongFileNames(const char *pathname);
94 
98  static bool needsMutex();
99 
103  static void setMutex(mutex *mtx);
104 
105  #include <rudiments/private/directory.h>
106 };
107 
108 #ifdef RUDIMENTS_NAMESPACE
109 }
110 #endif
111 
112 #endif