#include <suifkernel/command_line_parsing.h>
Inheritance diagram for Option:
Public Methods | |
virtual bool | parse_options ( istream& input_stream, bool &changed, ErrorSubSystem* output_for_errors ) |
parses the command line and returns true if succeeded. | |
virtual bool | parse_options ( int argc, char *argv[], bool &changed, ErrorSubSystem* output_for_errors ) |
virtual void | print_to_stream ( ostream& print_stream ) const |
virtual String | to_string () const |
virtual void | print_debug () const |
virtual bool | parse ( TokenStream* tokens, bool &changed, ValueClass* parent = 0) = 0 |
returns true if the token stream parsing does not fail at this option. More... | |
virtual int | get_number_of_values () const |
virtual void | delete_values () |
virtual void | print ( String& command_line_string, suif_vector<OptionDescription>* descriptions ) const |
Prepare the printable description of this option. More... | |
virtual void | set_argument ( const String& argument ) |
Set the name of the option to be printed out in a help message. | |
virtual void | set_description ( const String& description, const String& group = emptyString ) |
Set the description which explains what the option is. | |
virtual String | get_description () const |
virtual | ~Option () |
Protected Methods | |
Option ( String arguments = emptyString, Option* parent = 0) | |
Option ( String arguments, String description, Option* parent) | |
virtual ValueClass* | get_value_class ( ValueClass* value, Option* context ) const |
Protected Attributes | |
String | _description |
String | _group |
String | _argument |
Option* | _parent |
suif_vector<sf_owned ValueClass*>* sf_owned | _values |
One can build a option tree with option instances as nodes to represent the grammar for the acceptable options. See the subclasses of Option for ways to construct the tree.
Each option may have multiple values associated with it.
Each option has the following component: parent - the parent option in the option tree. value - the values associated with this option, represented as a list of ValueClass instances. group - name associated with the collection of options argument - the name of this option, used in help message description - help message for this option.
|
|
|
|
Reimplemented in OptionList, OptionLoop, and OptionSelection.
|
|
|
|
returns true if the token stream parsing does not fail at this option.
sets the changed parameter to true if the option parsing generated some state. The changed token is important in loops because OptionSelections can succeed without actually consuming any of the token stream.
Reimplemented in OptionInt, OptionList, OptionLiteral, OptionLoop, OptionMultiString, OptionPrefixString, OptionSelection, OptionStream, and OptionString.
|
|
parses the command line and returns true if succeeded.
|
Prepare the printable description of this option.
Append a printed message to command_line_string, and a description to descriptions.
Reimplemented in OptionList, OptionLiteral, OptionLoop, and OptionSelection.
|
|
|
Set the name of the option to be printed out in a help message.
|
Set the description which explains what the option is.
|
|
|
|
|
|