Class Hierarchy   Compound List   File List   Header Files   Compound Members   File Members  

Option Class Reference

An Option represents an argument or a flag (like -I) in a unix command. More...

#include <suifkernel/command_line_parsing.h>

Class diagram for Option:

OptionString OptionStream OptionSelection OptionMultiString OptionLoop OptionLiteral OptionList OptionInt

List of all members.

Public Members

Protected Members


Detailed Description

An Option represents an argument or a flag (like -I) in a unix command.

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.


Member Function Documentation

virtual bool Option::parse_options (istream & input_stream, ErrorSubSystem * output_for_errors) [virtual]

parses the command line and returns true if succeeded.

virtual bool Option::parse_options (int argc, char *argv[], ErrorSubSystem * output_for_errors) [virtual]

virtual void Option::print_to_stream (ostream & print_stream) [virtual]

virtual bool Option::parse (TokenStream * tokens, ValueClass * parent = 0) [pure virtual]

Reimplemented in OptionString, OptionStream, OptionSelection, OptionMultiString, OptionLoop, OptionLiteral, OptionList and OptionInt.

virtual int Option::get_number_of_values () const [virtual]

virtual void Option::delete_values () [virtual]

Reimplemented in OptionSelection, OptionLoop and OptionList.

virtual void Option::print (String & command_line_string, suif_vector<OptionDescription>* descriptions) [virtual]

Prepare the printable description of this option.

Append a printed message to command_line_string, and a description to descriptions.

Reimplemented in OptionSelection, OptionLoop, OptionLiteral and OptionList.

virtual void Option::set_argument (const String & argument) [virtual]

Set the name of the option to be printed out in a help message.

virtual void Option::set_description (const String & description, const String & group = emptyString) [virtual]

Set the description which explains what the option is.

virtual Option::~Option () [virtual]

Option::Option (String arguments = emptyString, Option * parent = 0) [protected]

virtual ValueClass * Option::get_value_class (ValueClass * value, Option * context) const [protected, virtual]


Member Data Documentation

String Option::_description [protected]

String Option::_group [protected]

String Option::_argument [protected]

Option* Option::_parent [protected]

suif_vector<sf_owned ValueClass*>* sf_owned Option::_values [protected]


The documentation for this class was generated from the following file:
Generated at Mon Nov 22 19:43:36 1999 for NCI SUIF by doxygen  written by Dimitri van Heesch, © 1997-1999