|
Limbo 3.5.4
|
a generic class for various data values More...
#include <ProgramOptions.h>
Public Types | |
| typedef T | value_type |
| data type | |
| typedef ValueBase | base_type |
| base type | |
Public Member Functions | |
| Value (std::string const &cat, value_type *target, std::string const &m) | |
| constructor | |
| Value (Value const &rhs) | |
| copy constructor | |
| Value & | operator= (Value const &rhs) |
| assignment | |
| virtual | ~Value () |
| destructor | |
| virtual bool | parse (const char *v) |
| parse data from string | |
| virtual void | print (std::ostream &os) const |
| print target value | |
| virtual void | print_default (std::ostream &os) const |
| print default value | |
| virtual void | apply_default () |
| apply default value | |
| virtual void | apply_toggle () |
| apply toggle value | |
| virtual bool | valid_target () const |
| check whether target value is valid | |
| virtual bool | valid_default () const |
| check whether default value is valid | |
| virtual bool | valid_toggle () const |
| check whether toggle value is valid | |
| virtual unsigned | count_default_chars () const |
| count the length of default value string | |
| virtual bool | help_on () const |
| check whether help message is turned on | |
| virtual Value & | default_value (value_type const &v, std::string const &d="") |
| set default value | |
| virtual Value & | toggle_value (value_type const &v) |
| set toggle value | |
| virtual Value & | help (bool h) |
| set help flag | |
| virtual Value & | required (bool r) |
| set required flag | |
| virtual Value & | toggle (bool t) |
| set toggle flag | |
| Public Member Functions inherited from limbo::programoptions::ValueBase | |
| ValueBase (std::string const &cat, std::string const &m) | |
| constructor | |
| ValueBase (ValueBase const &rhs) | |
| copy constructor | |
| ValueBase & | operator= (ValueBase const &rhs) |
| assignment | |
| virtual | ~ValueBase () |
| destructor | |
| std::string const & | category () const |
| std::string const & | msg () const |
| bool | help () const |
| bool | required () const |
| bool | valid () const |
| bool | toggle () const |
| void | print_category (std::ostream &os) const |
| print category | |
| void | print_msg (std::ostream &os) const |
| print message | |
Protected Member Functions | |
| void | copy (Value const &rhs) |
| copy another object | |
| Protected Member Functions inherited from limbo::programoptions::ValueBase | |
| void | copy (ValueBase const &rhs) |
| copy another object | |
Protected Attributes | |
| value_type * | m_target |
| NULL for help. | |
| value_type * | m_default_value |
| default value | |
| value_type * | m_toggle_value |
| only valid when this option is a toggle value | |
| std::string | m_default_display |
| display default value | |
| Protected Attributes inherited from limbo::programoptions::ValueBase | |
| std::string | m_category |
| category | |
| std::string | m_msg |
| helper message | |
| unsigned char | m_help: 1 |
| whether is help option | |
| unsigned char | m_required: 1 |
| whether the value is a required option | |
| unsigned char | m_valid: 1 |
| true if target is set, not default | |
| unsigned char | m_toggle: 1 |
| true if this option is a toggle value | |
a generic class for various data values
| T | data type |
Definition at line 217 of file ProgramOptions.h.
| typedef ValueBase limbo::programoptions::Value< T >::base_type |
base type
Definition at line 223 of file ProgramOptions.h.
| typedef T limbo::programoptions::Value< T >::value_type |
data type
Definition at line 221 of file ProgramOptions.h.
|
inline |
constructor
| cat | category |
| target | a pointer of target |
| m | message |
Definition at line 231 of file ProgramOptions.h.
|
inline |
|
inlinevirtual |
destructor
Definition at line 264 of file ProgramOptions.h.
|
inlinevirtual |
apply default value
Implements limbo::programoptions::ValueBase.
Definition at line 313 of file ProgramOptions.h.
|
inlinevirtual |
apply toggle value
Implements limbo::programoptions::ValueBase.
Definition at line 321 of file ProgramOptions.h.
|
inlineprotected |
|
inlinevirtual |
count the length of default value string
Implements limbo::programoptions::ValueBase.
Definition at line 357 of file ProgramOptions.h.
|
inlinevirtual |
set default value
| v | value |
| d | a string to display the value |
Definition at line 380 of file ProgramOptions.h.
|
inlinevirtual |
set help flag
| h | value |
Definition at line 405 of file ProgramOptions.h.
|
inlinevirtual |
check whether help message is turned on
Implements limbo::programoptions::ValueBase.
Definition at line 367 of file ProgramOptions.h.
|
inline |
assignment
| rhs | the other object |
Definition at line 252 of file ProgramOptions.h.
|
inlinevirtual |
parse data from string
| v | data value in string |
Implements limbo::programoptions::ValueBase.
Definition at line 277 of file ProgramOptions.h.
|
inlinevirtual |
print target value
| os | output stream |
Implements limbo::programoptions::ValueBase.
Definition at line 292 of file ProgramOptions.h.
|
inlinevirtual |
print default value
| os | output stream |
Implements limbo::programoptions::ValueBase.
Definition at line 301 of file ProgramOptions.h.
|
inlinevirtual |
set required flag
| r | value |
Definition at line 415 of file ProgramOptions.h.
|
inlinevirtual |
set toggle flag
| t | value |
Definition at line 425 of file ProgramOptions.h.
|
inlinevirtual |
set toggle value
| v | value |
Definition at line 393 of file ProgramOptions.h.
|
inlinevirtual |
check whether default value is valid
Implements limbo::programoptions::ValueBase.
Definition at line 341 of file ProgramOptions.h.
|
inlinevirtual |
check whether target value is valid
Implements limbo::programoptions::ValueBase.
Definition at line 333 of file ProgramOptions.h.
|
inlinevirtual |
check whether toggle value is valid
Implements limbo::programoptions::ValueBase.
Definition at line 349 of file ProgramOptions.h.
|
protected |
display default value
Definition at line 450 of file ProgramOptions.h.
|
protected |
default value
Definition at line 448 of file ProgramOptions.h.
|
protected |
NULL for help.
Definition at line 447 of file ProgramOptions.h.
|
protected |
only valid when this option is a toggle value
Definition at line 449 of file ProgramOptions.h.