00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef CEYLAN_FILE_LOCATOR_H_
00028 #define CEYLAN_FILE_LOCATOR_H_
00029
00030
00031 #include "CeylanTextDisplayable.h"
00032 #include "CeylanSystem.h"
00033
00034
00035 #include <string>
00036 #include <list>
00037
00038
00039
00040
00041 namespace Ceylan
00042 {
00043
00044
00045 namespace System
00046 {
00047
00048
00049
00051 class FileLocatorException : public SystemException
00052 {
00053
00054 public:
00055
00056 FileLocatorException( const std::string & message ) ;
00057 virtual ~FileLocatorException() throw() ;
00058
00059 } ;
00060
00061
00062
00063
00076 class CEYLAN_DLL FileLocator : public TextDisplayable
00077 {
00078
00079
00080 public:
00081
00082
00083
00085 FileLocator() ;
00086
00087
00088
00097 explicit FileLocator( const std::string & variableName,
00098 char separator = ':' ) ;
00099
00100
00101
00103 virtual ~FileLocator() throw() ;
00104
00105
00106
00116 virtual bool addPath( const std::string & newPath ) ;
00117
00118
00119
00129 virtual bool addPaths( const std::list<std::string> & paths ) ;
00130
00131
00132
00146 virtual bool addPathsFromEnvironmentVariable(
00147 const std::string & variableName,
00148 char separator = ':' ) ;
00149
00150
00151
00162 virtual bool removePath( const std::string & pathToRemove ) ;
00163
00164
00165
00181 virtual std::string find( const std::string & filename )
00182 const ;
00183
00184
00185
00187 virtual const std::list<std::string> & getPaths() const ;
00188
00189
00190
00202 virtual const std::string toString(
00203 Ceylan::VerbosityLevels level = Ceylan::high ) const ;
00204
00205
00206
00207
00208 protected:
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218 #pragma warning( push )
00219 #pragma warning( disable : 4251 )
00220
00222 std::list<std::string> _paths ;
00223
00224 #pragma warning( pop )
00225
00226
00227
00228
00229 private:
00230
00231
00232
00242 FileLocator( const FileLocator & source ) ;
00243
00244
00245
00254 FileLocator & operator = ( const FileLocator & source ) ;
00255
00256
00257
00258 } ;
00259
00260
00261 }
00262
00263 }
00264
00265
00266
00267 #endif // CEYLAN_FILE_LOCATOR_H_
00268