C++客户端开发接口库 V5.1.8.15
连接信创集成中间件服务程序的二次开发接口
载入中...
搜索中...
未找到
CIniHelper类 参考

#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 &section, const std::string &key, const std::string &sDefValue="")
int GetIntValue (const std::string &section, const std::string &key, int iDefValue=0)
float GetFloatValue (const std::string &section, const std::string &key, float fDefValue=0)
bool GetBoolValue (const std::string &section, const std::string &key, bool fDefValue=false)
bool SetValue (const std::string &section, const std::string &key, const std::string &value)
bool SetIntValue (const std::string &section, const std::string &key, int iValue)
bool SetFloatValue (const std::string &section, const std::string &key, float fValue)
bool SetBoolValue (const std::string &section, const std::string &key, bool bValue)
bool DeleteKey (const std::string &section, const std::string &key)
bool DeleteSection (const std::string &section)
void Clear ()
bool KeyExist (const std::string &section, const std::string &key)
bool SectionExist (const std::string &section)
SectionValues GetSectionValues (const std::string &section)
SectionNodes GetAllSectionValues ()
std::string GetLastError ()

详细描述

Ini文件解析类

构造及析构函数说明

◆ CIniHelper()

CIniHelper::CIniHelper ( )
inline

构造函数

◆ ~CIniHelper()

CIniHelper::~CIniHelper ( )
inline

析构函数

成员函数说明

◆ Clear()

void CIniHelper::Clear ( )
inline

删除所有配置项

◆ DeleteKey()

bool CIniHelper::DeleteKey ( const std::string & section,
const std::string & key )

删除配置项

◆ DeleteSection()

bool CIniHelper::DeleteSection ( const std::string & section)

删除Section

◆ GetAllSectionValues()

SectionNodes CIniHelper::GetAllSectionValues ( )
inline

取得所有配置项

◆ GetBoolValue()

bool CIniHelper::GetBoolValue ( const std::string & section,
const std::string & key,
bool fDefValue = false )

获取布尔值

函数调用图:
这是这个函数的调用关系图:

◆ GetFloatValue()

float CIniHelper::GetFloatValue ( const std::string & section,
const std::string & key,
float fDefValue = 0 )

获取浮点数值

函数调用图:

◆ GetIntValue()

int CIniHelper::GetIntValue ( const std::string & section,
const std::string & key,
int iDefValue = 0 )

取得整数值

获取整数值

函数调用图:
这是这个函数的调用关系图:

◆ GetLastError()

std::string CIniHelper::GetLastError ( )
inline

取得错误信息

◆ GetSectionNames()

std::vector< std::string > CIniHelper::GetSectionNames ( )
inline

取得配置SectionName列表

◆ GetSectionValues()

SectionValues CIniHelper::GetSectionValues ( const std::string & section)

取得指定Section下的所有配置项

◆ GetValue()

std::string CIniHelper::GetValue ( const std::string & section,
const std::string & key,
const std::string & sDefValue = "" )

取得字符串值

获取值字符串值

这是这个函数的调用关系图:

◆ KeyExist()

bool CIniHelper::KeyExist ( const std::string & section,
const std::string & key )

判断对应的配置项是否存在

这是这个函数的调用关系图:

◆ ReadFile()

bool CIniHelper::ReadFile ( const std::string & path)

读配置文件.

参数
path配置文件路径
返回
返回true:成功,false:失败

读取Ini文件

这是这个函数的调用关系图:

◆ SectionExist()

bool CIniHelper::SectionExist ( const std::string & section)

判断对应的Section是否存在

◆ SetBoolValue()

bool CIniHelper::SetBoolValue ( const std::string & section,
const std::string & key,
bool bValue )

设置浮点数值

函数调用图:
这是这个函数的调用关系图:

◆ SetFloatValue()

bool CIniHelper::SetFloatValue ( const std::string & section,
const std::string & key,
float fValue )

设置浮点数值

函数调用图:

◆ SetGBKCode()

void CIniHelper::SetGBKCode ( bool bIsGBKCode)
inline

设置读写文件为GBK编码

这是这个函数的调用关系图:

◆ SetIntValue()

bool CIniHelper::SetIntValue ( const std::string & section,
const std::string & key,
int iValue )

设置整数值

函数调用图:
这是这个函数的调用关系图:

◆ SetValue()

bool CIniHelper::SetValue ( const std::string & section,
const std::string & key,
const std::string & value )

设置字符串值

这是这个函数的调用关系图:

◆ WriteFile()

bool CIniHelper::WriteFile ( const std::string & path)

写配置文件.

参数
path配置文件路径
返回
返回true:成功,false:失败

保存到Ini文件

这是这个函数的调用关系图:

该类的文档由以下文件生成:
  • E:/GreatMIMP.Linux.Client/MDWClient/IniHelper.h
  • E:/GreatMIMP.Linux.Client/MDWClient/IniHelper.cpp