00001
00008
00009
00010
00011
00012
00013 #ifndef BASE_FILE_HH
00014 #define BASE_FILE_HH 1
00015
00016 #include "base_common.hh"
00017 #include "base_misc.hh"
00018
00019 namespace base {
00020
00021
00022 const uint MAX_PATH = 256;
00023
00024 bool
00025 IfFileExists( const string& fname );
00026
00027 long
00028 FileSize( FILE* file );
00029
00030 bool
00031 ReadFile( const string& fname, string& obuf );
00032
00033 bool
00034 ReadFile( const string& fname, StringBuf& strbuf );
00035
00036 bool
00037 ReadFileGzip( const string& fname, string& obuf, const uint chunkLen = 256*1024 );
00038
00039 bool
00040 RemoveFile( const string& fname );
00041
00042 void
00043 RemoveSuffix( string& fname, const string& suffix );
00044
00045 bool
00046 IfAbsPath( const string& path );
00047
00048 bool
00049 IfDirExists( const string& dirname );
00050
00051 bool
00052 FilesInDir( const string& dirname, vector<string>& vec );
00053
00054 string
00055 GetCwd( void );
00056
00057 }
00058
00059 #endif