25 for(
unsigned int i=0 ; i< values.
size() ; i++){
27 _map[ key ].push_back( values[i] ) ;
33 for(
unsigned int i= 1 ; i< tokens.
size() ; i++){
35 _map[ tokens[0] ].push_back( tokens[i] ) ;
51 if(
_map[ key ].size() == 0 )
return 0 ;
58 if(
_map[ key ].size() == 0 )
return 0 ;
67 if(
_map[ key ].size() == 0 )
return empty ;
68 return _map[ key ][0] ;
75 transform(
_map[ key ].begin() ,
_map[ key ].end() , back_inserter(intVec) ,
intVal ) ;
83 transform(
_map[ key ].begin() ,
_map[ key ].end() , back_inserter(floatVec) ,
floatVal ) ;
91 copy(
_map[ key ].begin() ,
_map[ key ].end() , back_inserter(stringVec) ) ;
111 return ( ! (stream >>
std::setbase(0) >> value).fail() ) && stream.
eof();
128 sstr <<
"failed converting int from string: " << str <<
std::endl ;
130 throw Exception( sstr.
str() );
151 sstr <<
"failed converting float from string: " << str <<
std::endl ;
153 throw Exception( sstr.
str() );
161 s <<
" " << m->first <<
": " ;
163 for(
unsigned int i=0; i < m->second.size(); i++ ){
165 s <<
"[" << m->second[i] <<
"] " ;
bool isParameterSet(const std::string &key)
StringVec & getStringVals(const std::string &key, StringVec &stringVec)
void add(const std::string &key, const std::vector< std::string > &values)
bool convert(std::string input, T &value)
virtual ~StringParameters()
StringVec & getStringKeys(StringVec &stringVec)
const std::string & getStringVal(const std::string &key)
int getIntVal(const std::string &key)
int intVal(const std::string &str)
float getFloatVal(const std::string &key)
void erase(const std::string &key)
float floatVal(const std::string &str)
IntVec & getIntVals(const std::string &key, IntVec &intVec)
Simple parameters class for Marlin.
FloatVec & getFloatVals(const std::string &key, FloatVec &floatVec)
std::ostream & operator<<(std::ostream &s, Expression &e)