logplus/Workflow/WFEngine/WorkflowEngine/include/ConfigureManager.h

85 lines
2.0 KiB
C
Raw Normal View History

2026-01-16 17:18:41 +08:00
/**
* @file ConfigureManager.h
* @brief
*
* @author
* @date 2011-8-10
*/
#ifndef PAI_FRAME_WORKFLOWENGINE_CONFIGUREMANAGER_H
#define PAI_FRAME_WORKFLOWENGINE_CONFIGUREMANAGER_H
#include <fstream>
#include <map>
#include <sstream>
#include <stdexcept>
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <string>
#include "Turtle.h"
#include "WorkflowConstants.h"
#include "Configure.h"
namespace pai{
namespace workflow {
typedef std::map<std::string, std::string> Properties;
/**
* @brief
* 1.Property类型的配置文件Key的方式去查找配置项
* 2.Property选项为Properties配置文件
*/
class PAI_WORKFLOWENGINE_EXPORT CConfigureManager {
public:
CConfigureManager();
virtual ~CConfigureManager();
private:
/*
*
* */
Properties m_mapProperties;
std::string m_strPropFilePath;
pai::conf::CConfigure configure;
public:
/*
* @brief
* m_properties字段获取配置项目
* @param[in] strPropFilePath
* @return
*/
bool ParserFile(const std::string& strPropFilePath);
/*
* @brief
* @param[in] strKey
* @return (string.empty()==true),
*/
const std::string GetValue(const std::string& strKey);
/*
* @brief [=WORKFLOW_CONFIG_PATH]
* m_properties字段获取配置项目
* @return
*/
bool ParaseDefaultFile();
/*
* @brief Key/Value配置项
* @return
*/
bool Save(Properties& prop,const std::string& filepath);
};
}
}
/**
* @brief
*/
extern PAI_WORKFLOWENGINE_EXPORT pai::workflow::CConfigureManager* GetConfigureManager();
#endif