Rudiments
|
00001 // Copyright (c) 2004 David Muse 00002 // See the COPYING file for more information. 00003 00004 #ifndef RUDIMENTS_DIRECTORY_H 00005 #define RUDIMENTS_DIRECTORY_H 00006 00007 #include <rudiments/private/directoryincludes.h> 00008 00009 #ifdef RUDIMENTS_NAMESPACE 00010 namespace rudiments { 00011 #endif 00012 00013 class directoryprivate; 00014 00017 class RUDIMENTS_DLLSPEC directory { 00018 public: 00020 directory(); 00021 00023 ~directory(); 00024 00026 bool open(const char *path); 00027 00029 bool close(); 00030 00034 bool skip(); 00035 00040 char *read(); 00041 00044 void rewind(); 00045 00048 uint64_t getChildCount(); 00049 00055 char *getChildName(uint64_t index); 00056 00059 int64_t maxFileNameLength(); 00060 00064 int64_t maxPathLength(); 00065 00070 bool canAccessLongFileNames(); 00071 00073 static bool create(const char *path, mode_t perms); 00074 00076 static bool remove(const char *path); 00077 00083 static char *getCurrentWorkingDirectory(); 00084 00086 static bool changeDirectory(const char *path); 00087 00089 static bool changeRoot(const char *path); 00090 00093 static int64_t maxFileNameLength(const char *pathname); 00094 00098 static int64_t maxPathLength(const char *pathname); 00099 00104 static bool canAccessLongFileNames(const char *pathname); 00105 00109 static bool needsMutex(); 00110 00114 static void setMutex(mutex *mtx); 00115 00116 #include <rudiments/private/directory.h> 00117 }; 00118 00119 #ifdef RUDIMENTS_NAMESPACE 00120 } 00121 #endif 00122 00123 #endif