98 ParamInfo( std::string longKey, std::string shortKey,
103 addAlternative( value, helpText);
133 _guiHints[key] =
value;
141 {
return _shortKey; }
145 return _alternatives.size();
151 return _alternatives[index];
154 const std::map<std::string, std::string>&
guiHints()
const 161 if( _longKey < rhs._longKey)
return true;
162 if( _longKey > rhs._longKey)
return false;
163 if( _shortKey < rhs._shortKey)
return true;
164 if( _shortKey > rhs._shortKey)
return false;
166 std::min(_alternatives.size(), rhs._alternatives.size());
167 for(
size_t i = 0; i < nAlter; ++i)
169 if( _alternatives[i].
helpText < rhs._alternatives[i].helpText)
171 if( _alternatives[i].
helpText > rhs._alternatives[i].helpText)
179 if( _longKey != rhs._longKey)
return false;
180 if( _shortKey != rhs._shortKey)
return false;
182 std::min( _alternatives.size(), rhs._alternatives.size());
183 for(
size_t i = 0; i < nAlter; ++i)
185 if( _alternatives[i].
helpText != rhs._alternatives[i].helpText)
193 os <<
"longKey = " << _longKey <<
"\n" 194 <<
"shortKey = " << _shortKey <<
"\n";
195 for(
unsigned int i = 0; i < _alternatives.size(); ++i)
197 os <<
"alternative[" << i <<
"].value = " 198 << _alternatives[i].value <<
"\n" 199 <<
"alternative[" << i <<
"].helpText = " 200 << _alternatives[i].helpText <<
"\n";
202 for( std::map<std::string, std::string>::const_iterator
203 p = _guiHints.begin(); p != _guiHints.end(); ++p)
205 os <<
"guiHint: " << p->first <<
" --> " << p->second <<
"\n";
212 std::string _longKey;
213 std::string _shortKey;
214 std::vector< AlternativeHelp > _alternatives;
215 std::map<std::string, std::string> _guiHints;
229 std::sort( params.begin(), params.end());
230 params.erase( std::unique( params.begin(), params.end()), params.end());
void debugPrint(std::ostream &os) const
const std::string & longKey() const
#define SVM_ASSERT(condition)
bool operator<(const ParamInfo &rhs) const
ParamInfo(std::string longKey, std::string shortKey)
Construtor for keys, that need multiple alternative values, e.g.
void addGuiHint(const std::string &key, const std::string &value)
size_t nAlternatives() const
bool operator==(const ParamInfo &rhs) const
void sortAndRemoveDuplicates(std::vector< ParamInfo > ¶ms)
sort list of ParamInfo's and remove doubles
void addAlternative(const std::string &value, const std::string &helpText)
AlternativeHelp(const std::string &v, const std::string &h)
ParamInfo(std::string longKey, std::string shortKey, std::string value, std::string helpText)
Construtor for keys, that need only one helpText (e.g.
const std::string & shortKey() const
const AlternativeHelp & alternatives(size_t index) const
The ParamInfo class contains informations about one parameter like key, help text, guiHints etc.
const std::map< std::string, std::string > & guiHints() const