base_file.hh

Go to the documentation of this file.
00001 /*
00008  * LEGAL:   COPYRIGHT (C) 2004 JIM E. BROOKS
00009  *          THIS SOURCE CODE IS RELEASED UNDER THE TERMS
00010  *          OF THE GNU GENERAL PUBLIC LICENSE VERSION 2 (GPL 2).
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 // Maximum pathname length.
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/*IN/OUT*/, 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 /*OUT*/ );
00053 
00054 string
00055 GetCwd( void );
00056 
00057 } // namespace base
00058 
00059 #endif /* BASE_FILE_HH */
Palomino 3D Engine documents generated by doxygen 1.5.3 on Fri Nov 23 11:26:06 2007