OptionBase Struct Reference

#include <rcudata/Options.h>

Inheritance diagram for OptionBase:

Option< T >

Detailed Description

Base class for options.

Definition at line 65 of file Options.h.

Public Member Functions

 OptionBase (char s, const char *l, const char *h, bool arg)
virtual ~OptionBase ()
bool IsSet () const
bool NeedArg () const
virtual char Short () const
virtual const std::string & Long () const
virtual bool Handle (char s, const char *arg)=0
virtual bool Handle (const std::string &l, const std::string &arg)=0
virtual void Help () const

Protected Attributes

char fShort
std::string fLong
std::string fHelp
bool fNeedArg
bool fSet


Constructor & Destructor Documentation

OptionBase::OptionBase char  s,
const char *  l,
const char *  h,
bool  arg
[inline]
 

Constructor.

Parameters:
s Short option, if any
l Long option, if any
h Help string
arg Whether this option needs an argument

Definition at line 72 of file Options.h.

References fHelp, fLong, fNeedArg, fSet, and fShort.

virtual OptionBase::~OptionBase  )  [inline, virtual]
 

Destructor.

Definition at line 80 of file Options.h.


Member Function Documentation

virtual bool OptionBase::Handle const std::string &  l,
const std::string &  arg
[pure virtual]
 

Handle an option.

If the option matches, decode the value if needed and return true.

Parameters:
l Long option string
arg argument to possibly decode to value
Returns:
true if we handled this option

Implemented in Option< T >.

virtual bool OptionBase::Handle char  s,
const char *  arg
[pure virtual]
 

Handle an option.

If the option matches, decode the value if needed and return true.

Parameters:
s Short option character
arg argument to possibly decode to value
Returns:
true if we handled this option

Implemented in Option< T >.

virtual void OptionBase::Help  )  const [inline, virtual]
 

Print help information.

Reimplemented in Option< T >.

Definition at line 102 of file Options.h.

References fHelp, fLong, fNeedArg, and fShort.

Referenced by Option< T >::Help().

bool OptionBase::IsSet  )  const [inline]
 

Returns:
true if value is set.
Examples:
createAddresses.cxx, createConfigs.cxx, createParams.cxx, createPriority.cxx, createTables.cxx, createValues.cxx, dropTables.cxx, and rcuconf.cxx.

Definition at line 82 of file Options.h.

References fSet.

Referenced by Option< T >::Help(), and main().

virtual const std::string& OptionBase::Long  )  const [inline, virtual]
 

Returns:
Long option string

Definition at line 88 of file Options.h.

References fLong.

bool OptionBase::NeedArg  )  const [inline]
 

Returns:
true if this option need an argument

Definition at line 84 of file Options.h.

References fNeedArg.

Referenced by Option< T >::Help().

virtual char OptionBase::Short  )  const [inline, virtual]
 

Returns:
Short option character

Definition at line 86 of file Options.h.

References fShort.


Field Documentation

std::string OptionBase::fHelp [protected]
 

Help string.

Definition at line 113 of file Options.h.

Referenced by Help(), and OptionBase().

std::string OptionBase::fLong [protected]
 

Long option string.

Definition at line 111 of file Options.h.

Referenced by Help(), Long(), and OptionBase().

bool OptionBase::fNeedArg [protected]
 

Whether this option needs an argument.

Definition at line 115 of file Options.h.

Referenced by Help(), NeedArg(), and OptionBase().

bool OptionBase::fSet [protected]
 

Whether the option has been set.

Definition at line 117 of file Options.h.

Referenced by IsSet(), and OptionBase().

char OptionBase::fShort [protected]
 

Short option character.

Definition at line 109 of file Options.h.

Referenced by Help(), OptionBase(), and Short().


The documentation for this struct was generated from the following file:
Top of page Last update Fri Apr 27 01:54:16 2007
Copyright © 2004 Christian Holm Created by DoxyGen 1.3.5