top API to parse program options
More...
#include <ProgramOptions.h>
|
| typedef std::map< std::string, unsigned > | cat2index_map_type |
| | mapping from category to index
|
|
| | ProgramOptions (std::string const &title="Available options") |
| | constructor
|
| | ProgramOptions (ProgramOptions const &rhs) |
| | copy constructor
|
|
| ~ProgramOptions () |
| | destructor
|
| template<typename ValueType> |
| ProgramOptions & | add_option (ValueType const &data) |
| | generic API to add options of various data types
|
| bool | parse (int argc, char **argv) |
| | read command line options
|
| bool | count (std::string const &cat) const |
| void | print () const |
| | print help message
|
| void | print (std::ostream &os) const |
| | print help message
|
|
| void | print_space (std::ostream &os, unsigned num) const |
| | print a specific number of spaces
|
top API to parse program options
Definition at line 457 of file ProgramOptions.h.
◆ cat2index_map_type
◆ ProgramOptions() [1/2]
| limbo::programoptions::ProgramOptions::ProgramOptions |
( |
std::string const & | title = "Available options" | ) |
|
|
inline |
constructor
- Parameters
-
| title | title to display in help message |
Definition at line 532 of file ProgramOptions.h.
◆ ProgramOptions() [2/2]
| limbo::programoptions::ProgramOptions::ProgramOptions |
( |
ProgramOptions const & | rhs | ) |
|
copy constructor
- Parameters
-
◆ add_option()
template<typename ValueType>
| ProgramOptions & limbo::programoptions::ProgramOptions::add_option |
( |
ValueType const & | data | ) |
|
generic API to add options of various data types
- Template Parameters
-
- Parameters
-
Definition at line 537 of file ProgramOptions.h.
◆ count()
| bool limbo::programoptions::ProgramOptions::count |
( |
std::string const & | cat | ) |
const |
- Returns
- true if the option is set by command
◆ parse()
| bool limbo::programoptions::ProgramOptions::parse |
( |
int | argc, |
|
|
char ** | argv ) |
read command line options
- Parameters
-
| argc | number of options |
| argv | values of options |
◆ print() [1/2]
| void limbo::programoptions::ProgramOptions::print |
( |
| ) |
const |
|
inline |
◆ print() [2/2]
| void limbo::programoptions::ProgramOptions::print |
( |
std::ostream & | os | ) |
const |
print help message
- Parameters
-
◆ print_space()
| void limbo::programoptions::ProgramOptions::print_space |
( |
std::ostream & | os, |
|
|
unsigned | num ) const |
|
inlineprotected |
◆ operator<<
| std::ostream & operator<< |
( |
std::ostream & | os, |
|
|
ProgramOptions const & | rhs ) |
|
friend |
print help message by override operator<<
- Parameters
-
| os | output stream |
| rhs | the object |
- Returns
- reference to os
Definition at line 512 of file ProgramOptions.h.
◆ m_mCat2Index
| std::map<std::string, unsigned> limbo::programoptions::ProgramOptions::m_mCat2Index |
|
protected |
◆ m_title
| std::string limbo::programoptions::ProgramOptions::m_title |
|
protected |
◆ m_vData
| std::vector<ValueBase*> limbo::programoptions::ProgramOptions::m_vData |
|
protected |
The documentation for this class was generated from the following file:
- /home/abuild/rpmbuild/BUILD/limbo-3.5.4-build/limbo-3.5.4/limbo/programoptions/ProgramOptions.h