133 return (
_map.find( key) !=
_map.end());
150 void setValue(
const std::string& key,
const T& value);
163 template<
typename ForwardIter>
164 void setArray(
const std::string& key,
165 const ForwardIter& arrBegin,
182 template<
typename ForwardIter>
184 const ForwardIter& arrBegin,
204 void getValue(
const std::string& key, T& value)
const;
252 template<
typename ForwardIter>
253 void getArray(
const std::string& key,
const ForwardIter& arrBegin,
254 int containerSize=-1)
const;
276 template<
typename ForwardIter>
277 void getFVArray(
const std::string& key,
const ForwardIter& arrBegin,
278 int containerSize=-1)
const;
315 const std::string&
asString(
const std::string& key)
const 317 std::map<std::string, std::string>::const_iterator
323 e <<
"Key '" << key <<
"' not found.";
339 unsigned int asUint(
const std::string& key)
const 341 unsigned int tmp = 0;
362 std::istringstream iss(s);
367 <<
"' could not be converted to requested type";
392 std::map<std::string, std::string>::const_iterator
begin()
const 397 std::map<std::string, std::string>::const_iterator
end()
const 415 for( std::map<std::string,std::string>::const_iterator
416 p =
_map.begin(); p !=
_map.end(); ++p)
418 os << p->first <<
' ' << p->second << std::endl;
438 std::map<std::string, std::string>::const_iterator
439 findKey(
const std::string& key)
const 441 std::map<std::string, std::string>::const_iterator p =
448 e <<
"Key '" << key <<
"' not found.";
456 template<
typename T>
457 void setPrecisionForType( std::ostream& os,
const T&)
const 459 os.precision( std::numeric_limits<float>::digits10);
462 void setPrecisionForType( std::ostream& os,
const double&)
const 464 os.precision( std::numeric_limits<double>::digits10);
469 std::map<std::string, std::string>
_map;
477 #include "StDataASCII.icc" std::map< std::string, std::string >::const_iterator begin() const
const access to internal map
std::map< std::string, std::string > _map
const std::string & asString(const std::string &key) const
return the associated string to the given key directly
void debugPrint(std::ostream &os) const
for debugging print whole internal map
size_t getArraySize(std::string key) const
get size of Array associated with given key.
char separatorChar() const
void setSeparatorChar(char c)
set character to separate elements of vectors within the value-string.
void stringToValue(const std::string &s, T &value) const
convert any std::string to any type using an std::istringstream.
bool valueExists(const std::string &key) const
check wether a value exists for requested key
void setExceptionFlag(bool f)
Specify, if getValue() should throw expcetions for unknown keys.
std::map< std::string, std::string >::const_iterator end() const
void getArray(const std::string &key, const ForwardIter &arrBegin, int containerSize=-1) const
getArray.
bool exceptionFlag() const
void getValue(const std::string &key, T &value) const
get a value (with arbitrary type) from the internal map<string,string> specified by the given key...
void setValue(const std::string &key, const T &value)
setValue writes/adds a value (with arbitrary type) to the internal map<string,string>.
void setFVArray(const std::string &key, const ForwardIter &arrBegin, size_t size)
setFVPList writes/adds a list (or a 1D array) of feature vectors to the internal map<string,string>.
void readArraySizeFromStream(std::istream &is, size_t &size) const
double asDouble(const std::string &key) const
size_t getFVArraySize(std::string key) const
get number of Feature vectors in the list associated with that kay
void stringToValue(const std::string &s, std::string &value) const
void getFVArray(const std::string &key, const ForwardIter &arrBegin, int containerSize=-1) const
get a list (or a 1D array) of feature vectors.
unsigned int asUint(const std::string &key) const
The StDataASCII class is a container for "structured data", that is kept completly in memory...
void setArray(const std::string &key, const ForwardIter &arrBegin, size_t size)
setArray writes/adds an array of values (with arbitrary type) to the internal map<string,string>.