Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

OptionLiteral Class Reference

An OptionLiteral matches a literal string in the command line. More...

#include <command_line_parsing.h>

Inheritance diagram for OptionLiteral:

Option List of all members.

Public Methods

 OptionLiteral ( String argument, bool* storage_for_is_set = 0, bool default_value = false )
 Construct with a name for this option and, a location for a boolean value, and a boolean to set the location if a match is found.

 OptionLiteral ( String argument, String description, bool* storage_for_is_set = 0, bool default_value = false )
virtual ~OptionLiteral ()
virtual bool is_set () const
 Returns true if a successful match is made. More...

virtual bool is_set ( ValueClass* value, Option* context ) const
virtual bool parse ( TokenStream* tokens, bool &changed, ValueClass* parent = 0 )
 returns true if the token stream parsing does not fail at this option. More...

virtual void print ( String& command_line_string, suif_vector<OptionDescription>* descriptions ) const
 Prepare the printable description of this option. More...


Detailed Description

An OptionLiteral matches a literal string in the command line.


Constructor & Destructor Documentation

OptionLiteral::OptionLiteral ( String argument,
bool * storage_for_is_set = 0,
bool default_value = false)

Construct with a name for this option and, a location for a boolean value, and a boolean to set the location if a match is found.

OptionLiteral::OptionLiteral ( String argument,
String description,
bool * storage_for_is_set = 0,
bool default_value = false)

OptionLiteral::~OptionLiteral () [virtual]


Member Function Documentation

bool OptionLiteral::is_set ( ValueClass * value,
Option * context) const [virtual]

bool OptionLiteral::is_set () const [inline, virtual]

Returns true if a successful match is made.

Independent of the value set to storage_for_is_set.

bool OptionLiteral::parse ( TokenStream * tokens,
bool & changed,
ValueClass * parent = 0) [virtual]

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 from Option.

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

Prepare the printable description of this option.

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

Reimplemented from Option.


The documentation for this class was generated from the following files:
Generated at Mon Jul 31 13:44:14 2000 for NCI SUIF by doxygen 1.1.2 written by Dimitri van Heesch, © 1997-2000