You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "LlUtils_global.h"
|
|
|
|
|
#include "Defines.h"
|
|
|
|
|
|
|
|
|
|
/// @brief Ini文件解析类的封装
|
|
|
|
|
class I_UTILSSHARED_EXPORT IniFileTool
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
// 如果sIni不是全路径,则默认从Config/[Module]下面查找
|
|
|
|
|
// 如下三种模式均可
|
|
|
|
|
// E:\Run\mWTAI\Bin\Config\WTAI\WTAIConfig.ini
|
|
|
|
|
// WTAIConfig.ini
|
|
|
|
|
// WTAIConfig
|
|
|
|
|
IniFileTool(QString sIni, bool bRead = true);
|
|
|
|
|
~IniFileTool();
|
|
|
|
|
|
|
|
|
|
// 直取String
|
|
|
|
|
QString getValue(QString sKey);
|
|
|
|
|
|
|
|
|
|
// 直取StringList
|
|
|
|
|
QStringList getValueList(QString sKey);
|
|
|
|
|
|
|
|
|
|
// 如果bParseFromStr=true
|
|
|
|
|
// 先以Sring取,然后parse,类似{}{}{}格式的ini
|
|
|
|
|
QStringList getValueList(QString sKey, bool bParseFromStr);
|
|
|
|
|
|
|
|
|
|
// 设置数值
|
|
|
|
|
void setValue(QString sKey, QVariant o);
|
|
|
|
|
|
|
|
|
|
// 这是QSetting的本身的函数
|
|
|
|
|
QStringList allKeys() const;
|
|
|
|
|
QStringList childKeys() const;
|
|
|
|
|
QStringList childGroups() const;
|
|
|
|
|
|
|
|
|
|
// 对于其它的可以直接通过QSetting处理
|
|
|
|
|
QSettings* getSettings();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
|
|
QSettings* m_pSettings;
|
|
|
|
|
bool m_bRead; //读写标识,目前基本都是读
|
|
|
|
|
};
|