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

📄 chini.h

📁 此文档是用vistual studio 2005 开发的用来描述3D-tree 的生长过程
💻 H
字号:
/*
* Copyleft (c) 2008 Lauming chen, SooChow University.
*
*
*
*/

/*
* File: ChIni.h
* Read and write ini file
*/

#ifndef _CHINI__INCLUDE_
#define _CHINI__INCLUDE_

#include <map>
#include <list>
#include <string>
#include <fstream>
#include <iostream>
#include <algorithm>
#include <sstream>
using namespace std;

typedef map<string, string> MAP_KEY_VALUE;
struct _node 
{
	string section;
	MAP_KEY_VALUE section_node;
};
typedef list<_node> LIST_INI;

class ChIni {
public :
	ChIni( char* fileName );
	~ChIni();
	string readValueAsString( string section, string key );
	int readValueAsInt( string section, string key );
	double readValueAsDouble( string section, string key );
	bool readValueAsBoolean( string section, string key );
	bool writeValue( string section, string key, string value );
	bool writeValue( string section, string key, int value );
	bool writeValue( string section, string key, float value );
	bool writeValue( string section, string key, double value );
	bool writeValue( string section, string key, bool value );
protected :
	bool readFile();
	bool writeFile();
	LIST_INI m_listini;
private :
	string fileName;
};

#endif /* _CHINI__INCLUDE_ */

⌨️ 快捷键说明

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