eis/inc/glob/ConfigMag.h

75 lines
2.2 KiB
C++

/*********************************************************************
*
* 文 件: ConfigMag.h 声明配置文件管理接口
*
* 版权所有: Shanghai Baosight Software Co., Ltd.
*
* 概述:
* :
* :
*
* 版本历史
* 1.0 2010-09-02 echo_li 增加注释
*
*********************************************************************/
#ifndef CONFIGMAG_H_
#define CONFIGMAG_H_
#include <utility/IniProperty.h>
#include <string>
using namespace std;
#define CS_S_ENVIRONMENT "CRGS"
namespace baosight{
/*********************************************************************
* 类 名: ConfigMag
* 版权所有: Shanghai Baosight Software Co., Ltd.
* 类 职 责:复制配置文件管理,读取配置文件中某项的值
* :
* :
* 版本历史
* 1.0 2010-09-02 echo_li 增加注释
*
*********************************************************************/
class ConfigMag{
public:
ConfigMag(const char* evn = NULL);
~ConfigMag();
/**********************************************************************
* 概述: 获取某一项的值
* 函数名: ReadProperty
* 返回值: std::string
* 参数列表: 参数类型 取值范围 描述
* section: const std::string &
* key: const std::string &
*
* 版本历史
* 1.0 2010-09-02 echo_li 增加注释
*
**********************************************************************/
std::string ReadProperty(const std::string& section,const std::string& key);
/**********************************************************************
* 概述: 读取一组有结构的配置
* 函数名: ReadStructSection
* 返回值: vector<string>
* 参数列表: 参数类型 取值范围 描述
* section: const std::string &
* structCount: int
*
* 版本历史
* 1.0 2010-11-25 echo_li 初次建立
*
**********************************************************************/
vector<string> ReadStructSection(const std::string&section,int structCount);
private:
CIniProperty* mp_initPropert;
ifstream* ifFile;
string m_configPath;
string mp_evn;
std::vector<string> sectionList;
};
}
#endif