📄 inifile.h
字号:
// IniFile.h: interface for the CIniFile class.
/********************************************************************************
//解析INI文件
// Written by: YiJian Feng
// Email: netfyee@hotmail.com
// Last Edit: 2003-5-1
---使用
首先必须设置
BOOL SetFileName(CString FileName);
BOOL SetSectionName(CString SectionName);
**********************************************************************************/
#if !defined(AFX_INIFILE_H__D6BE0D97_13A8_11D4_A5D2_002078B03530__INCLUDED_)
#define AFX_INIFILE_H__D6BE0D97_13A8_11D4_A5D2_002078B03530__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define BUF_SIZE 1024 //32*1024
#include <afxtempl.h>
class CIniFile
{
//all private variables
private:
struct key
{
//list of values in key
CArray<CString, CString> values;
//corresponding list of value names
CArray<CString, CString> names;
};
CArray<key, key> keys;
//all private functions
private:
CString m_szSectionName;
CString m_szFileName;
CStringList* pSl;
//public variables
public:
//public functions
public:
//default constructor
CIniFile();
//constructor, can specify filename here instead of using Setfile later
CIniFile(CString FileName);
//default destructor
virtual ~CIniFile();
//Set key values
BOOL SetIniValues(int value, CString keys);
BOOL SetIniValues(CString value, CString keys);
//get key values
BOOL GetIniValues(UINT &value, CString keys, INT DefaultValue = 0);
BOOL GetIniValues(CString& value, CString keys, CString DefaultValue = "0");
//get now Section
CString GetSectionName();
//set now Section
BOOL SetSectionName(CString SectionName);
//set IniFileNames
CString GetFileName();
//get IniFileNames
BOOL SetFileName(CString FileName);
// get Total Section Values ,and result put at keys
BOOL GetSectionValues(CStringList* pSl);//not suppet
};
#endif // !defined(AFX_INIFILE_H__D6BE0D97_13A8_11D4_A5D2_002078B03530__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -