Go to the documentation of this file.00001 #ifndef __INI_H__
00002 #define __INI_H__
00003
00004 #if !defined( WIN32_PLATFORM ) && !defined( NIX_PLATFORM ) && !defined( MINGW_PLATFORM ) && !defined( CYGWIN_PLATFORM )
00005 #define WIN32_PLATFORM
00006 #endif
00007
00008 #ifdef INI_FILE
00009 #if defined( WIN32_PLATFORM ) || defined( MINGW_PLATFORM ) || defined( CYGWIN_PLATFORM )
00010 #define INI_FILE_DLL_ENTITY __declspec( dllexport )
00011 #endif
00012
00013 #if defined( NIX_PLATFORM )
00014 #define INI_FILE_DLL_ENTITY
00015 #endif
00016 #else
00017 #ifdef WIN32_PLATFORM
00018 #define INI_FILE_DLL_ENTITY __declspec( dllimport )
00019 #pragma comment( lib , "ini_file.lib" )
00020 #endif
00021
00022 #if defined( CYGWIN_PLATFORM ) || defined( MINGW_PLATFORM )
00023 #define INI_FILE_DLL_ENTITY __declspec( dllimport )
00024 #endif
00025
00026 #if defined( NIX_PLATFORM )
00027 #define INI_FILE_DLL_ENTITY
00028 #endif
00029 #endif
00030
00031 #include <string>
00032 #include <vector>
00033
00034 #include <utilities/testing_utilities.h>
00035
00036 namespace nitro
00037 {
00050 class INI_FILE_DLL_ENTITY INIFile
00051 {
00052 public:
00053
00068 INIFile( void );
00069
00088 INIFile( const char * thePath );
00089
00108 INIFile( const std::string & thePath );
00109
00128 void LoadINIFile( const char * thePath );
00129
00130 ALIAS_FUNCTION_1( LoadINIFile , aliasLoadINIFile , const char * )
00131
00132
00150 void LoadINIFile( const std::string & thePath );
00151
00170 void SetPath( const char * thePath );
00171
00190 void SetPath( const std::string & thePath );
00191
00210 const char * GetPath( void ) const;
00211
00242 const char * GetString( const char * Section , const char * Key , char * Value , const char * Default = NULL ) const;
00243
00270 void SetString( const char * Section , const char * Key, const char * Value );
00271
00290 void SaveINIFile( const char * thePath = NULL );
00291
00292 ALIAS_FUNCTION_1( SaveINIFile , aliasSaveINIFile , const char * )
00293
00294
00312 void SaveINIFile( std::string & thePath );
00313
00324 virtual ~INIFile();
00325
00326 private:
00327
00338 std::string Path;
00339
00350 std::vector< std::string > FileData;
00351
00362 bool NeedSaveFile;
00363 };
00364 };
00365
00366 #endif