16 using namespace kome::objects;
21 #define new new( _NORMAL_BLOCK, __FILE__, __LINE__ )
22 #define malloc( s ) _malloc_dbg( s, _NORMAL_BLOCK, __FILE__, __LINE__ )
34 unsigned int valNum = other.
m_values.size();
38 for(
unsigned int i = 0; i < valNum; i++ ) {
48 for(
unsigned int i = 0; i < itmNum; i++ ) {
59 unsigned int valNum = other.
m_values.size();
63 for(
unsigned int i = 0; i < valNum; i++ ) {
73 for(
unsigned int i = 0; i < itmNum; i++ ) {
95 for(
unsigned int i = 0; i <
m_itemValues.size(); i++ ) {
104 std::string s =
NVL( name,
"" );
108 for(
unsigned int i = 0; i <
m_values.size() && idx < 0; i++ ) {
109 if( s.compare(
m_values[ i ].first ) == 0 ) {
125 std::string v =
NVL( value,
"" );
126 if( v.compare( MSPP_SETTINGS_NONE_VALUE ) == 0 ) {
140 std::string v =
NVL( value,
"" );
141 if( v.compare( MSPP_SETTINGS_NONE_VALUE ) == 0 ) {
147 m_values.push_back( std::make_pair (
NVL( name,
"" ), v ) );
164 return m_values[ index ].first.c_str();
172 return m_values[ index ].second.c_str();
191 const bool ret =
tobool( value, df );
200 const bool ret =
tobool( value, df );
209 const int ret =
toint( value, 10, df );
218 const int ret =
toint( value, 10, df );
227 const double ret =
todouble( value, df );
236 const double ret =
todouble( value, df );
249 std::string k =
NVL( key,
"" );
253 std::string v =
NVL( val,
"" );
257 for(
unsigned int i = 0; i <
m_itemValues.size() && itemIdx < 0; i++ ) {
287 std::string k =
NVL( key,
"" );
291 std::string v =
NVL( val,
"" );
295 for(
unsigned int i = 0; i <
m_itemValues.size() && itemIdx < 0; i++ ) {
302 return ( itemIdx >= 0 );
312 std::string p =
NVL( prefix,
"" );
318 std::string propName = name;
320 propName = FMT(
"%s : %s", p.c_str(), name.c_str() );
323 props.
setValue( propName.c_str(), value.c_str() );
SettingParameterValues & operator=(const SettingParameterValues &other)
the definition of assignment operator
double getDoubleValue(const unsigned int index, const double df)
gets double value
void setValue(const unsigned int index, const char *value)
sets parameter value
bool getBoolValue(const unsigned int index, const bool df)
gets boolean value
setting parameter values management class
bool hasSubParameterValues(const char *key, const char *val=NULL)
check the specified parameter has sub parameters
keys and values management class
SettingParameterValues()
constructor
void setValue(const char *key, const char *value)
sets parameter value
bool tobool(const char *s, bool dfVal)
get true or false from character string.
int getIntValue(const unsigned int index, const int df)
gets integer value
int toint(const char *s, const int radix, const int dfval)
convert string into integer
interfaces of SettingParameterValues class
#define NVL(checkVal, replaceVal)
std::vector< std::pair< SubSettingsKey, SettingParameterValues * > > m_itemValues
virtual ~SettingParameterValues()
destructor
int getIndex(const char *name)
gets parameter index from name
const char * getParameterValue(const unsigned int index)
gets parameter value
const char * getParameterName(const unsigned int index)
gets parameter name
unsigned int getNumberOfParameters()
gets the number of parameters
double todouble(const char *s, const double dfval)
convert string into double
void clear()
clears parameters
static void writeAllChildParameters(kome::objects::SettingParameterValues &settings, kome::core::Properties &props, const char *prefix)
write all child parameters
std::vector< std::pair< std::string, std::string > > m_values
SettingParameterValues * getSubParameterValues(const char *key, const char *val=NULL)
gets sub parameter values