00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _pdirectory_h_
00021 #define _pdirectory_h_
00022
00023 #include <pclasses/pexport.h>
00024 #include <pclasses/pexception.h>
00025 #include <string>
00026 #include <list>
00027
00028 namespace P {
00029
00031
00040 class PCORE_EXPORT Directory {
00041 public:
00043
00050 Directory(const char* path) throw(IOError);
00051 ~Directory() throw();
00052
00054 inline const std::string& path() const throw()
00055 { return m_path; }
00056
00058 const char* operator++() throw(IOError);
00059
00061 const char* operator*() const throw();
00062
00064 void rewind() throw();
00065
00067 static void create(const char* path) throw(IOError);
00068
00070 static void remove(const char* path) throw(IOError);
00071
00073 static std::string current() throw(IOError);
00074
00076 static void change(const char* path) throw(IOError);
00077
00079 static std::string separator() throw();
00080
00082 static std::string homeDir() throw();
00083
00085 static void getDriveList(std::list<std::string>& dl) throw();
00086
00087 private:
00088 struct dir_handle_t;
00089 dir_handle_t* m_handle;
00090 std::string m_path;
00091 };
00092
00093 }
00094
00095 #endif