⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ini.h

📁 TabBars的开源源码
💻 H
字号:
// Ini.h: interface for the CIni class.
/*********************************************************************
*	class:		用于操作Ini结构的文件的类
*	Author:		orbit
*	Date:		1999-09-21
*	Contact us:	support@winmsg.com
*	Web Page: http://www.winmsg.com/cn/orbit.htm (for Chinese version)
*						http://www.winmsg.com/orbit.htm (for English version)
**********************************************************************/
#if !defined(AFX_INI_H__4A8E7C07_902F_11D1_8B70_0000B43382FE__INCLUDED_)
#define AFX_INI_H__4A8E7C07_902F_11D1_8B70_0000B43382FE__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

#include <afxcoll.h>

class CIni  
{
public:
	CIni();
	CIni(LPCTSTR lpszFileName);
	virtual ~CIni();
public:
	static CString m_csLineEnd;
public:
	void RemoveMultiLineItem(const int idx);
	int FindItem(const int iSection, LPCTSTR cItem, CString &csVal);
	int FindMultiItem(const int iSection, LPCTSTR cItem, CString &csVal);
	BOOL RemoveSection(LPCTSTR cSection);
	BOOL IsSection(const int iSection);
	int InsertSection(LPCTSTR cSection);
	int FindSection(LPCTSTR cSection);

	int GetEndOfSection(int nSectionIndex);

	BOOL SetMultiValue(LPCTSTR cSection, LPCTSTR cItem, LPCTSTR cVal);

	BOOL SetBoolValue(LPCTSTR cSection, LPCTSTR cItem, const BOOL bVal);
	BOOL SetValue(LPCTSTR cSection, LPCTSTR cItem, LPCTSTR cVal);
	BOOL SetDwordValue(LPCTSTR cSection, LPCTSTR cItem, const DWORD lVal);
	BOOL SetValue(LPCTSTR cSection, LPCTSTR cItem, const int iVal);

	BOOL GetMultiValue(LPCTSTR cSection, LPCTSTR cItem, CString &cVal);

	BOOL GetBoolValue(LPCTSTR cSection, LPCTSTR cItem, BOOL &bVal, const BOOL bDefault = FALSE);
	BOOL GetValue(LPCTSTR cSection, LPCTSTR cItem, CString &cVal, const CString strDefault = _T(""));
	BOOL GetDwordValue(LPCTSTR cSection, LPCTSTR cItem, DWORD &lVal, const DWORD dwDefault = 0);
	BOOL GetValue(LPCTSTR cSection, LPCTSTR cItem, int &iVal, const int iDefault = 0);
//特别的接口为LPSTR
	BOOL GetValue(LPCTSTR cSection, LPCTSTR cItem, LPTSTR szVal, LPCTSTR szDefault = _T(""));

	void Clear();
	BOOL Write(LPCTSTR cFileName);
	BOOL Read(LPCTSTR cFileName);
	void AddRemarkLine(LPCTSTR lpszRemarkLine,int nPos = 1);
	void AddRemarkLine(CStringArray & strARemarkLine,int nPos = 1);

	static int GetVersionC() {return 1118;}
	static LPCTSTR GetVersionS() {return _T("1.1.18");}
private:
	CStringArray	m_csList;
};

#endif // !defined(AFX_INI_H__4A8E7C07_902F_11D1_8B70_0000B43382FE__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -