// IniFile.h: interface for the CINI class. // ////////////////////////////////////////////////////////////////////// #if !defined(AFX_INIFILE_H__99976B4B_DBA1_4D1E_AA14_CBEB63042FD1__INCLUDED_) #define AFX_INIFILE_H__99976B4B_DBA1_4D1E_AA14_CBEB63042FD1__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include #define MAX_SECTION_SIZE 0x7FFF #define MAX_KEY_DATA_SIZE 0xFF // //setINIFileName // Sets the INI File name to read and write. // //getKeyValue // Used to retrieve a key value given the section and key name. // //getSectionData // Used to retrieve all key/value pairs of a given section. // //getSectionNames // Used to retrieve all the sections in an ini file // //sectionExists // Used to find out if a given section exists. // //setKey // Used to modify the key value or to create a key value pair for the specified section. // class CINI { public: void setINIFileName(CString strINIFile); CStringList* getSectionData(CString strSection); CStringList* getSectionNames(); BOOL sectionExists(CString strSection); long setKey(CString strValue, CString strKey, CString strSection); long DeleteKey(CString strKey, CString strSection); long CINI::DeleteSection(CString strSection); CString getKeyValue(CString strKey,CString strSection); CINI(CString strFile); CINI() { m_sectionList = new CStringList(); m_sectionDataList = new CStringList(); } virtual ~CINI(); private: CStringList *m_sectionDataList; CStringList *m_sectionList; CString m_strSection; long m_lRetValue; CString m_strFileName; }; #endif // !defined(AFX_INIFILE_H__99976B4B_DBA1_4D1E_AA14_CBEB63042FD1__INCLUDED_)