# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

old_path.h

Go to the documentation of this file.
00001 #if 0
00002 
00008 /* Copyright, 2000 Nevrax Ltd.
00009  *
00010  * This file is part of NEVRAX NEL.
00011  * NEVRAX NEL is free software; you can redistribute it and/or modify
00012  * it under the terms of the GNU General Public License as published by
00013  * the Free Software Foundation; either version 2, or (at your option)
00014  * any later version.
00015 
00016  * NEVRAX NEL is distributed in the hope that it will be useful, but
00017  * WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00019  * General Public License for more details.
00020 
00021  * You should have received a copy of the GNU General Public License
00022  * along with NEVRAX NEL; see the file COPYING. If not, write to the
00023  * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
00024  * MA 02111-1307, USA.
00025  */
00026 
00027 #ifndef NL_PATH_H
00028 #define NL_PATH_H
00029 
00030 #include "nel/misc/types_nl.h"
00031 #include "nel/misc/common.h"
00032 #include <string>
00033 #include <vector>
00034 
00035 
00036 namespace NLMISC {
00037 
00038 
00040 typedef std::vector<std::string> CStringVector;
00041 
00042 
00043 // EPathNotFound
00044 struct EPathNotFound : public Exception
00045 {
00046         EPathNotFound( const std::string& filename ) : Exception( "Path not found for " + filename ) {}
00047 };
00048 
00049 
00056 class CPath
00057 {
00058 public:
00059 
00061         static void                     addSearchPath( const std::string& path );
00062 
00067         static std::string      lookup( const std::string& filename, bool throwException = true );
00068 
00069 private:
00070 
00071         static CStringVector    _SearchPaths;
00072 };
00073 
00074 
00081 struct CFile
00082 {
00087         static std::string getFilename (const std::string &filename);
00088 
00093         static std::string getPath (const std::string &filename);
00094 
00099         static bool isDirectory (const std::string &filename);
00100 
00106         static bool fileExists (const std::string &filename);
00107 
00113         static std::string findNewFile (const std::string &filename);
00114 
00119         static int getLastSeparator (const std::string &filename);
00120 };
00121 
00122 
00123 } // NLMISC
00124 
00125 
00126 #endif // NL_PATH_H
00127 
00128 /* End of path.h */
00129 #endif