📄 chini.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 + -