|
Sierra Toolkit
Version of the Day
|
Class Option holds the command line name, environment variable name and the current value of an option. It implements the OptionDescription interface so that a help description may be generated. More...
#include <Option.hpp>


Public Member Functions | |
| Option () | |
| Option (const std::string &name, const std::string &env_name, const std::string &value=std::string(), const std::string &description="No description available", const OptionDescription *sub_option_description=0) | |
| Option (const Option &option) | |
| Option & | operator= (const Option &option) |
| Member function operator= assigns an option from another option. | |
| virtual | ~Option () |
| const std::string & | getName () const |
| const std::string & | getValue () const |
| virtual std::ostream & | describe (std::ostream &os) const |
| Member function describe prints a description of the option to the stream. | |
| operator std::string & () | |
Public Attributes | |
| std::string | m_name |
| Name/Command line option name. | |
| std::string | m_envName |
| Environment variable name. | |
| std::string | m_description |
| Brief '-h' description. | |
| std::string | m_value |
| Value of option. | |
| const OptionDescription * | m_subOptionDescription |
| Suboptions (used for '-h' parsing) | |
Class Option holds the command line name, environment variable name and the current value of an option. It implements the OptionDescription interface so that a help description may be generated.
Definition at line 47 of file Option.hpp.
| stk_classic::diag::Option::Option | ( | ) | [inline] |
Creates a new Option instance.
Definition at line 53 of file Option.hpp.
| stk_classic::diag::Option::Option | ( | const std::string & | name, |
| const std::string & | env_name, | ||
| const std::string & | value = std::string(), |
||
| const std::string & | description = "No description available", |
||
| const OptionDescription * | sub_option_description = 0 |
||
| ) | [inline] |
Creates a new Option instance.
| name | a std::string const reference to the name of the option. This is used for the command line option argument. |
| env_name | a std::string const reference to the environment variable name. |
| value | a std::string const reference to the default/initial value of the option. |
| description | a std::string const reference to the description of the option. This is printed when the -h option is parsed. |
| sub_option_description | an OptionDescription const pointer to sub options which are available for the option. |
Definition at line 81 of file Option.hpp.
| stk_classic::diag::Option::Option | ( | const Option & | option | ) | [inline] |
Creates a new Option instance.
Definition at line 98 of file Option.hpp.
| virtual stk_classic::diag::Option::~Option | ( | ) | [inline, virtual] |
Destroys a Option instance.
Definition at line 128 of file Option.hpp.
Member function operator= assigns an option from another option.
| option | an Option const reference to the rhs option. |
Definition at line 114 of file Option.hpp.
| virtual std::ostream& stk_classic::diag::Option::describe | ( | std::ostream & | os | ) | const [virtual] |
Member function describe prints a description of the option to the stream.
| os | a std::ostream reference to print to description to. |
Implements stk_classic::diag::OptionDescription.