00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef _QORE_QOREDIR_H
00026
00027 #define _QORE_QOREDIR_H
00028
00029 #include <dirent.h>
00030
00031 #include <string>
00032 #include <vector>
00033
00034 #ifndef HAVE_DIRENT_D_TYPE
00035 #include <sys/types.h>
00036 #include <sys/stat.h>
00037 #include <unistd.h>
00038
00039 #endif
00040
00042
00045 class QoreDir {
00046 private:
00048 struct qore_qd_private *priv;
00049
00051 DLLLOCAL QoreDir(const QoreDir&);
00052
00054 DLLLOCAL QoreDir& operator=(const QoreDir&);
00055
00056 public:
00058
00063 DLLEXPORT QoreDir(ExceptionSink *xsink, const QoreEncoding *cs = QCS_DEFAULT, const char *dir = 0);
00064
00066
00069 DLLEXPORT QoreDir(ExceptionSink *xsink, const QoreDir &old);
00070
00072 DLLEXPORT ~QoreDir();
00073
00075
00080 DLLEXPORT int chdir(const char* dir, ExceptionSink *xsink);
00081
00083
00088 DLLEXPORT int mkdir(ExceptionSink *xsink, const char *subdir, int mode = 0777) const;
00089
00091
00095 DLLEXPORT int rmdir(const char *subdir, ExceptionSink *xsink) const;
00096
00098
00102 DLLEXPORT int chmod(int mode, ExceptionSink *xsink) const;
00103
00105
00110 DLLEXPORT int chown(uid_t uid, gid_t gid, ExceptionSink *xsink) const;
00111
00113
00117 DLLEXPORT int create(int mode, ExceptionSink *xsink) const;
00118
00120
00122 DLLEXPORT int checkPath() const;
00123
00125
00127 DLLEXPORT QoreStringNode *dirname() const;
00128
00130
00133 DLLEXPORT std::string getPath(const char *sub) const;
00134
00136
00138 DLLEXPORT const QoreEncoding *getEncoding() const;
00139
00141
00149 DLLEXPORT QoreFile openFile(ExceptionSink *xsink, const char* fn, int flags = O_RDONLY, int mode = 0777, const QoreEncoding *cs = QCS_DEFAULT);
00150
00152
00158 DLLEXPORT QoreListNode* list(ExceptionSink *xsink, int stat_filter, const QoreString *regex = 0, int regex_options = 0) const;
00159 };
00160
00161 #endif // _QORE_QOREDIR_H