00001 #ifndef DIRECTORY_CLASS
00002 #define DIRECTORY_CLASS
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00019
00020 #include "opsysdll.h"
00021
00022 #include <basis/object_base.h>
00023
00024 class OPSYSTEM_CLASS_STYLE directory
00025 {
00026 public:
00027 directory(const istring &path, const char *pattern = "*");
00029
00036 directory(const directory &to_copy);
00037
00038 virtual ~directory();
00039
00040 directory &operator =(const directory &to_copy);
00041
00042 IMPLEMENT_CLASS_NAME("directory");
00043
00044 bool good() const { return _scanned_okay; }
00046
00047 const istring &path() const;
00049
00050 const istring &pattern() const;
00052
00053 static istring absolute_path(const istring &relative_path);
00055
00057 bool reset(const istring &path, const char *pattern = "*");
00059
00061 bool move_up(const char *pattern = "*");
00063
00064 bool move_down(const istring &subdir, const char *pattern = "*");
00066
00072 bool rescan();
00074
00075 const string_array &files() const;
00077
00081 const string_array &directories() const;
00083
00087
00088
00089 static istring current();
00091
00092 static bool make_directory(const istring &path);
00094
00095 static bool remove_directory(const istring &path);
00097
00098 static bool recursive_create(const istring &directory_name);
00100
00104 private:
00105 bool _scanned_okay;
00106 istring *_path;
00107 string_array *_files;
00108 string_array *_folders;
00109 istring *_pattern;
00110 };
00111
00112 #endif
00113