home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / Xenon / XenonSource.exe / gamesystem / includes / gs_inifile.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-07-16  |  1.3 KB  |  55 lines

  1. //-------------------------------------------------------------
  2. //
  3. // Class:    gsCIniFile
  4. //
  5. // Author:    John M Phillips
  6. //
  7. // Started:    12/03/00
  8. //
  9. // Base:    CObject
  10. //
  11. // Derived:    None
  12. //
  13. //-------------------------------------------------------------
  14.  
  15. #ifndef _INCLUDE_GS_INIFILE_H
  16. #define _INCLUDE_GS_INIFILE_H
  17.  
  18. #include "gs_object.h"
  19.  
  20. //-------------------------------------------------------------
  21.  
  22. const int gsINIFILE_BUFFER_SIZE = 100;
  23.  
  24. //-------------------------------------------------------------
  25.  
  26. class gsCIniFile : public gsCObject
  27. {
  28.     private:
  29.         char m_fullname[_MAX_PATH];
  30.         bool m_is_open;
  31.         char m_buffer[gsINIFILE_BUFFER_SIZE];
  32.  
  33.     public:
  34.  
  35.         gsCIniFile();
  36.         ~gsCIniFile();
  37.  
  38.         bool open(const char *filename);
  39.         bool close();
  40.  
  41.         bool isOpen();
  42.  
  43.         int readInt(const char *section,const char *key,int default_value);
  44.         float readFloat(const char *section,const char *key,float default_value);
  45.         const char *readString(const char *section,const char *key,const char *default_value);
  46.  
  47.         bool writeInt(const char *section,const char *key,int value);
  48.         bool writeFloat(const char *section,const char *key,float value);
  49.         bool writeString(const char *section,const char *key,const char *value);
  50. };
  51.  
  52. //-------------------------------------------------------------
  53.  
  54. #endif
  55.