![]() |
C++客户端开发接口库 V5.1.8.15
连接信创集成中间件服务程序的二次开发接口
|
#include <IniHelper.h>
Public 成员函数 | |
| CIniHelper () | |
| ~CIniHelper () | |
| bool | ReadFile (const std::string &path) |
| bool | WriteFile (const std::string &path) |
| void | SetGBKCode (bool bIsGBKCode) |
| std::vector< std::string > | GetSectionNames () |
| std::string | GetValue (const std::string §ion, const std::string &key, const std::string &sDefValue="") |
| int | GetIntValue (const std::string §ion, const std::string &key, int iDefValue=0) |
| float | GetFloatValue (const std::string §ion, const std::string &key, float fDefValue=0) |
| bool | GetBoolValue (const std::string §ion, const std::string &key, bool fDefValue=false) |
| bool | SetValue (const std::string §ion, const std::string &key, const std::string &value) |
| bool | SetIntValue (const std::string §ion, const std::string &key, int iValue) |
| bool | SetFloatValue (const std::string §ion, const std::string &key, float fValue) |
| bool | SetBoolValue (const std::string §ion, const std::string &key, bool bValue) |
| bool | DeleteKey (const std::string §ion, const std::string &key) |
| bool | DeleteSection (const std::string §ion) |
| void | Clear () |
| bool | KeyExist (const std::string §ion, const std::string &key) |
| bool | SectionExist (const std::string §ion) |
| SectionValues | GetSectionValues (const std::string §ion) |
| SectionNodes | GetAllSectionValues () |
| std::string | GetLastError () |
Ini文件解析类
|
inline |
构造函数
|
inline |
析构函数
|
inline |
删除所有配置项
| bool CIniHelper::DeleteKey | ( | const std::string & | section, |
| const std::string & | key ) |
删除配置项
| bool CIniHelper::DeleteSection | ( | const std::string & | section | ) |
删除Section
|
inline |
取得所有配置项
| bool CIniHelper::GetBoolValue | ( | const std::string & | section, |
| const std::string & | key, | ||
| bool | fDefValue = false ) |
获取布尔值


| float CIniHelper::GetFloatValue | ( | const std::string & | section, |
| const std::string & | key, | ||
| float | fDefValue = 0 ) |
获取浮点数值

| int CIniHelper::GetIntValue | ( | const std::string & | section, |
| const std::string & | key, | ||
| int | iDefValue = 0 ) |
取得整数值
获取整数值


|
inline |
取得错误信息
|
inline |
取得配置SectionName列表
| SectionValues CIniHelper::GetSectionValues | ( | const std::string & | section | ) |
取得指定Section下的所有配置项
| std::string CIniHelper::GetValue | ( | const std::string & | section, |
| const std::string & | key, | ||
| const std::string & | sDefValue = "" ) |
取得字符串值
获取值字符串值

| bool CIniHelper::KeyExist | ( | const std::string & | section, |
| const std::string & | key ) |
判断对应的配置项是否存在

| bool CIniHelper::ReadFile | ( | const std::string & | path | ) |
读配置文件.
| path | 配置文件路径 |
读取Ini文件

| bool CIniHelper::SectionExist | ( | const std::string & | section | ) |
判断对应的Section是否存在
| bool CIniHelper::SetBoolValue | ( | const std::string & | section, |
| const std::string & | key, | ||
| bool | bValue ) |
设置浮点数值


| bool CIniHelper::SetFloatValue | ( | const std::string & | section, |
| const std::string & | key, | ||
| float | fValue ) |
设置浮点数值

|
inline |
设置读写文件为GBK编码

| bool CIniHelper::SetIntValue | ( | const std::string & | section, |
| const std::string & | key, | ||
| int | iValue ) |
设置整数值


| bool CIniHelper::SetValue | ( | const std::string & | section, |
| const std::string & | key, | ||
| const std::string & | value ) |
设置字符串值

| bool CIniHelper::WriteFile | ( | const std::string & | path | ) |
写配置文件.
| path | 配置文件路径 |
保存到Ini文件
