GIniFile.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /** *************************************************************** **
  2. ** Interface for the GIniFile class **
  3. ** by S.B. **
  4. ** *************************************************************** **/
  5. #include <tchar.h>
  6. #ifndef USE_SB_GINIFILE_CLASS
  7. #define USE_SB_GINIFILE_CLASS
  8. class GIniFile
  9. {
  10. public:
  11. TCHAR rFName[255],
  12. rSName[255];
  13. BOOL rLastResult;
  14. void SetFileName( const TCHAR *AFileName );
  15. // sets name of ini file
  16. void SetSectName( const TCHAR *ASectName );
  17. // sets name of section
  18. int GetIniStr( const TCHAR *AKeyName, TCHAR *AResult, const TCHAR *ADeflt );
  19. // returns ini-value and its length
  20. int SGetIniStr( const TCHAR *AKeyName, TCHAR *AResult, const TCHAR *ADeflt );
  21. // same as GetIniStr, but write ini-value if it does not exist yet
  22. BOOL SetIniStr( const TCHAR *AKeyName, const TCHAR *AStr );
  23. // writes ini-value
  24. long GetIniInt( const TCHAR *AKeyName, long ADeflt );
  25. // returns ini-value
  26. long SGetIniInt( const TCHAR *AKeyName, long ADeflt );
  27. // same as GetIniInt, but write ini-value if it does not exist yet
  28. BOOL SetIniInt( const TCHAR *AKeyName, long AVal );
  29. // writes ini-value
  30. double GetIniFloat( const TCHAR *AKeyName, double ADeflt );
  31. // returns ini-value
  32. double SGetIniFloat( const TCHAR *AKeyName, double ADeflt );
  33. // same as GetIniInt, but write ini-value if it does not exist yet
  34. BOOL SetIniFloat( const TCHAR *AKeyName, double AVal );
  35. // writes ini-value
  36. };
  37. #endif // #ifndef USE_SB_GINIFILE_CLASS