17 #include <boost/regex.hpp>
18 #include <boost/algorithm/string/case_conv.hpp>
21 using namespace kome::core;
26 #define new new( _NORMAL_BLOCK, __FILE__, __LINE__ )
27 #define malloc( s ) _malloc_dbg( s, _NORMAL_BLOCK, __FILE__, __LINE__ )
31 #define SECTION "Common Parameters"
58 for(
unsigned int i=0; i <
m_paramInfo.size(); i++ ){
59 if( paramName.compare(
m_paramInfo[i].paramName ) == 0 ){
65 info.paramName = paramName;
66 info.paramValue = paramValue;
67 info.tempFlg = tempFlg;
72 setIniString( paramName, paramValue );
77 void CommonParameterManager::setIniString( std::string strKey, std::string strValue ){
82 const char* strRegex =
"([^0-9a-zA-Z])";
83 boost::regex reg_exp(strRegex);
85 std::string replace =
"_";
86 std::string result =
"";
89 result = boost::regex_replace( strKey, reg_exp, replace, boost::format_all );
91 boost::algorithm::to_upper(result);
94 ini->
setString( SECTION, result.c_str(), strValue.c_str() );
99 std::string str = defaultName;
100 for(
unsigned int i=0; i <
m_paramInfo.size(); i++ ){
101 if( paramName.compare(
m_paramInfo[i].paramName ) == 0 ){
static MsppManager & getInstance()
gets MsppManager object (This is the only object.)
virtual ~CommonParameterManager()
destructor
int getNumberOfParameters()
gets the number of parameters variables
IniFile * getIniFile()
gets ini file
void setParameter(std::string paramName, std::string paramValue, bool tempFlg)
sets parameter
interfaces of IniFile class
implements of MsppManager class
std::string getParameter(std::string paramName, std::string defaultName)
gets parameter
bool isTemporaryParameter(unsigned int index)
is temporary parameter
common parameter manager class
std::vector< ParamInfo > m_paramInfo
static CommonParameterManager & getInstance()
gets common parameter management object.
std::string getParameterName(unsigned int index)
gets parameters variable name
interfaces of common parameter manager class
ini file management class
CommonParameterManager()
constructor
void setString(const char *section, const char *key, const char *value)
sets string value