class BaseOption

Provides behaviour common to all option types. More...

Contains pure virtuals
Full nameUtilities::BaseOption
Definition#include <options.h>
Inherited byOption
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Protected Members


Detailed Description

Provides behaviour common to all option types. Actual options are declared using the templated Option class. The OptionParser class can be used to parse command lines.

See also: Option, OptionParser

 BaseOption (const string& k, const string& ht, bool c, ArgFlag f): key_(k), help_text_(ht), arg_flag_(f), unset_(true), compulsory_(c)

Parameters:
kcomma seperated list of key aliases
htthe help text to be printed for this option
cif true then this option is compulsory
fone of no_argument, requires_argument, optional_argument to indicate what arguments should be supplied

bool  compulsory ()

Returns: true if the option is compulsory

bool  required ()

Returns: true if the option requires an argument

bool  optional ()

Returns: true if the option has an optional argument

bool  has_arg ()

Returns: true if the option has an argument at all

bool  set ()

Returns: true if the option has been set

bool  unset ()

Returns: true if the option remains unset

bool  matches (const string& arg)

const string&  key ()

[const]

const string&  help_text ()

[const]

bool  set_value (const string& vs)

[pure virtual]

BaseOption ()

[virtual]

bool unset_

[protected]

bool compulsory_

[protected]