📄 inifile.h
字号:
//////////////////////////////////////////////////////////////////////////
// CIniFile类,文件读取类,打开ini文件并获取文件的信息。
//
// IniFile.h: CIniFile类的声明
//
// Copy Rights Wonderful 2006
//////////////////////////////////////////////////////////////////////////
#ifndef __INIFILE_H_INCLUDED__
#define __INIFILE_H_INCLUDED__
//-------------------------------------------------------------------------------
// ini文件读取类
//-------------------------------------------------------------------------------
class CIniFile
{
public:
// 构造函数
CIniFile();
// 打开ini文件(设置路径)
bool Open(const char *filename);
// 检查section(节)是否存在
bool SectionExist(const char *section);
// 读取指定section下key的value(字符串)
const char * ReadString(const char *section, const char *key, const char *defaultvalue);
// 设置指定section下key的value(字符串),不存在则创建
bool WriteString(const char *section, const char *key, const char *value);
// 删除指定section下的key及其value
bool DeleteKey(const char *section, const char *key);
// 删除指定section及其所有的key及value
bool DeleteSection(const char *section);
protected:
char m_szFileName[128]; // 文件名
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -