57 #ifndef STDATACMDLINE_HH 58 #define STDATACMDLINE_HH 81 :_helpRequested( false)
86 :_helpRequested( false)
163 const std::string&
mode()
const 202 void getValue(
const std::string& key, T& value)
const 204 _keyOccurenceMap[key]++;
232 template<
typename ForwardIter>
233 void getArray(
const std::string& key,
const ForwardIter& arrBegin,
234 int containerSize=-1)
const 236 _keyOccurenceMap[key]++;
252 return _keyOccurenceMap;
268 std::map<std::string, std::string>::const_iterator
270 std::map<std::string,int>::const_iterator
271 itOccu = _keyOccurenceMap.begin();
273 && itOccu != _keyOccurenceMap.end())
275 if( itParam->first == itOccu->first)
280 else if( itParam->first < itOccu->first)
283 unusedParameters.push_back( itParam->first);
296 unusedParameters.push_back( itParam->first);
311 return _helpRequested;
317 for( std::map<std::string, std::string>::const_iterator
318 p = _shortToLongKeyMap.begin();
319 p != _shortToLongKeyMap.end(); ++p)
321 os <<
"'" << p->first <<
"' --> '" << p->second <<
"'\n";
327 mutable std::map<std::string, int> _keyOccurenceMap;
329 std::vector<std::string> _filenames;
330 std::map<std::string, std::string> _shortToLongKeyMap;
std::map< std::string, std::string >::const_iterator begin() const
const access to internal map
bool helpRequested() const
check if the parameter "--help" was given
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 translateShortKeys()
translate short keys (like "-g") to long keys ("gamma") using the internal short cut table...
void findUnusedParameters(std::vector< std::string > &unusedParameters) const
find unused parameters (these are parameters, that were extracted from command line ba parseCommandli...
StDataCmdLine()
Constructors.
const std::vector< std::string > filenames() const
return the filenames that were extracted by parseCommandline()
void updateShortCutTable(const std::vector< ParamInfo > ¶ms)
update shortcut table.
StDataCmdLine(int argc, const char **argv)
void debugPrintShortCutTable(std::ostream &os) const
std::map< std::string, std::string >::const_iterator end() const
void getArray(const std::string &key, const ForwardIter &arrBegin, int containerSize=-1) const
getArray.
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 parseCommandline(int argc, const char **argv)
parse given commandline.
const std::string & mode() const
return the mode (1st Command line argument) that was extracted by parseCommandline() ...
void getArray(const std::string &key, const ForwardIter &arrBegin, int containerSize=-1) const
getArray.
std::map< std::string, int > & keyOccurenceMap()
return the key Occurence map.
The StDataASCII class is a container for "structured data", that is kept completly in memory...