Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages | Examples

pdirectory.h

Go to the documentation of this file.
00001 /*
00002  *   P::Classes - Portable C++ Application Framework
00003  *   Copyright (C) 2000-2003  Christian Prochnow <cproch@seculogix.de>
00004  *
00005  *   This library is free software; you can redistribute it and/or
00006  *   modify it under the terms of the GNU Lesser General Public
00007  *   License as published by the Free Software Foundation; either
00008  *   version 2 of the License, or (at your option) any later version.
00009  *
00010  *   This library is distributed in the hope that it will be useful,
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  *   Lesser General Public License for more details.
00014  *
00015  *   You should have received a copy of the GNU Lesser General Public
00016  *   License along with this library; if not, write to the Free Software
00017  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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

Generated on Fri Mar 12 21:08:31 2004 for P::Classes by doxygen 1.3.3