file.H

00001 /*
00002  * This file is part of the "Archon" framework.
00003  * (http://files3d.sourceforge.net)
00004  *
00005  * Copyright © 2002 by Kristian Spangsege and Brian Kristiansen.
00006  *
00007  * Permission to use, copy, modify, and distribute this software and
00008  * its documentation under the terms of the GNU General Public License is
00009  * hereby granted. No representations are made about the suitability of
00010  * this software for any purpose. It is provided "as is" without express
00011  * or implied warranty. See the GNU General Public License
00012  * (http://www.gnu.org/copyleft/gpl.html) for more details.
00013  *
00014  * The characters in this file are ISO8859-1 encoded.
00015  *
00016  * The documentation in this file is in "Doxygen" style
00017  * (http://www.doxygen.org).
00018  */
00019 
00020 #ifndef ARCHON_UTILITIES_FILE_H
00021 #define ARCHON_UTILITIES_FILE_H
00022 
00023 #include <string>
00024 #include <vector>
00025 
00026 #include <archon/util/exception.H>
00027 
00028 namespace Archon
00029 {
00030   namespace Utilities
00031   {
00032     namespace File
00033     {
00034       using namespace std;
00035 
00040       string getCWD();
00041 
00042       string getHomeDir();
00043 
00044       void makeDir(string path);
00045 
00046       vector<string> getDirNames(string dirPath);
00047 
00048       struct Stat
00049       {
00050         enum Type
00051         {
00052           type_regular,
00053           type_directory,
00054           type_characterDevice,
00055           type_blockDevice,
00056           type_fifo,
00057           type_symbolicLink,
00058           type_socket,
00059           type_other
00060         };
00061 
00062         Type getType() const { return type; }
00063 
00064         Stat(string path);
00065 
00066       private:
00067         Type type;
00068       };
00069 
00070       bool isRegular(string path);
00071       bool isDir(string path);
00072       bool isSymbolicLink(string path);
00073 
00084       string nameOf(string filePath);
00085 
00097       string suffixOf(string filePath);
00098     }
00099   }
00100 }
00101 
00102 #endif // ARCHON_UTILITIES_FILE_H

Generated on Sun Jul 30 22:55:44 2006 for Archon by  doxygen 1.4.4