1
0

config.h 977 B

12345678910111213141516171819202122232425262728293031
  1. #ifndef _C_CONFIG_H_
  2. #define _C_CONFIG_H_
  3. class C_Config
  4. {
  5. public:
  6. C_Config( wchar_t *ini );
  7. ~C_Config();
  8. void WriteInt( wchar_t *name, int value );
  9. wchar_t *WriteString( wchar_t *name, wchar_t *string );
  10. char *WriteString( char *name, char *string );
  11. int ReadInt( wchar_t *name, int defvalue );
  12. wchar_t *ReadString( wchar_t *name, wchar_t *defvalue );
  13. char *ReadString( const char *name, char *defvalue );
  14. char *ReadString( const char *section_name, const char *key_name, char *defvalue );
  15. bool ReadString( const char *name, const char *defvalue, char *storage, size_t len ); // returns true
  16. bool ReadString( const wchar_t *name, const wchar_t *defvalue, wchar_t *storage, size_t len ); // returns true
  17. wchar_t *GetIniFile() { return m_inifile; }
  18. private:
  19. wchar_t m_strbuf[ 8192 ];
  20. char m_strbufA[ 8192 ];
  21. wchar_t *m_inifile;
  22. char *m_inifileA;
  23. wchar_t *m_section;
  24. };
  25. #endif//_C_CONFIG_H_