IniFile.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. //***********************************************************************
  2. // (c) xqsoft,版权所有不得拷贝(2003)
  3. // IniFile.h
  4. // 功能:修改后的INI文件类,支持读写删除。
  5. // 记录到INI格式文件
  6. //***********************************************************************
  7. #if !defined(AFX_INIFILE_H__D6BE0D97_13A8_11D4_A5D2_002078B03530__INCLUDED_)
  8. #define AFX_INIFILE_H__D6BE0D97_13A8_11D4_A5D2_002078B03530__INCLUDED_
  9. #if _MSC_VER > 1000
  10. #pragma once
  11. #endif // _MSC_VER > 1000
  12. class CIniFile
  13. {
  14. //all private variables
  15. private:
  16. //stores path of ini file to read/write
  17. TCHAR m_szFilePath[MAX_PATH];
  18. //public functions
  19. public:
  20. //read value of int from ini file
  21. BOOL GetVarInt(LPCTSTR strSection,LPCTSTR strVarName,int & iValue);
  22. //read value of CString from ini file
  23. BOOL GetVarStr(LPCTSTR strSection,LPCTSTR strVarName,LPTSTR strReturnValue);
  24. //read value of CString from ini file
  25. BOOL GetVarStr(LPCTSTR strSection,LPCTSTR strVarName,CString & strValue);
  26. //重新设置变量整数型数值
  27. BOOL SetVarInt(LPCTSTR strSection,LPCTSTR strVarName,const int iValue);
  28. //重新设置变量字符串型数值
  29. BOOL SetVarStr(LPCTSTR strSection,LPCTSTR strVarName,LPCTSTR strValue);
  30. //sets path of ini file to read and write from
  31. void SetPath(LPCTSTR szPath);
  32. //default constructor
  33. CIniFile();
  34. //default destructor
  35. virtual ~CIniFile();
  36. };
  37. #endif // !defined(AFX_INIFILE_H__D6BE0D97_13A8_11D4_A5D2_002078B03530__INCLUDED_)