CVCL::CLFlag Class Reference

#include <command_line_flags.h>

List of all members.

Public Member Functions

Private Attributes


Detailed Description

Class CLFlag (for Command Line Flag)

Author: Sergey Berezin

Date: Fri May 30 14:10:48 2003

This class implements a data structure to hold a value of a single command line flag.

Definition at line 60 of file command_line_flags.h.


Constructor & Destructor Documentation

CVCL::CLFlag::CLFlag bool  b,
const std::string &  help
[inline]
 

Constructor for a boolean flag.

Definition at line 77 of file command_line_flags.h.

References d_data.

CVCL::CLFlag::CLFlag int  i,
const std::string &  help
[inline]
 

Constructor for an integer flag.

Definition at line 81 of file command_line_flags.h.

References d_data.

CVCL::CLFlag::CLFlag const std::string &  s,
const std::string &  help
[inline]
 

Constructor for a string flag.

Definition at line 85 of file command_line_flags.h.

References d_data.

CVCL::CLFlag::CLFlag const char *  s,
const std::string &  help
[inline]
 

Constructor for a string flag from char*.

Definition at line 90 of file command_line_flags.h.

References d_data.

CVCL::CLFlag::CLFlag const std::vector< std::pair< std::string, bool > > &  sv,
const std::string &  help
[inline]
 

Constructor for a vector flag.

Definition at line 95 of file command_line_flags.h.

References d_data, and sv.

CVCL::CLFlag::CLFlag  )  [inline]
 

Default constructor.

Definition at line 101 of file command_line_flags.h.

CVCL::CLFlag::CLFlag const CLFlag f  )  [inline]
 

Copy constructor.

Definition at line 103 of file command_line_flags.h.

References CVCL::CLFLAG_STRING, CVCL::CLFLAG_STRVEC, d_data, and d_tp.

CVCL::CLFlag::~CLFlag  )  [inline]
 

Destructor.

Definition at line 114 of file command_line_flags.h.

References CVCL::CLFLAG_STRING, CVCL::CLFLAG_STRVEC, d_data, and d_tp.


Member Function Documentation

CLFlag& CVCL::CLFlag::operator= const CLFlag f  )  [inline]
 

Assignment from another flag.

Definition at line 122 of file command_line_flags.h.

References CVCL::CLFLAG_STRING, CVCL::CLFLAG_STRVEC, d_data, d_help, d_modified, and d_tp.

CLFlag& CVCL::CLFlag::operator= bool  b  )  [inline]
 

Assignment of a boolean value.

The flag must already have the right type

Definition at line 152 of file command_line_flags.h.

References CVCL::CLFLAG_BOOL, d_data, d_modified, and d_tp.

CLFlag& CVCL::CLFlag::operator= int  i  )  [inline]
 

Assignment of an integer value.

The flag must already have the right type

Definition at line 160 of file command_line_flags.h.

References CVCL::CLFLAG_INT, d_data, d_modified, and d_tp.

CLFlag& CVCL::CLFlag::operator= const std::string &  s  )  [inline]
 

Assignment of a string value.

The flag must already have a string type.

Definition at line 168 of file command_line_flags.h.

References CVCL::CLFLAG_STRING, d_data, d_modified, and d_tp.

CLFlag& CVCL::CLFlag::operator= const char *  s  )  [inline]
 

Assignment of an string value from char*.

The flag must already have a string type.

Definition at line 176 of file command_line_flags.h.

References CVCL::CLFLAG_STRING, d_data, d_modified, and d_tp.

CLFlag& CVCL::CLFlag::operator= const std::pair< std::string, bool > &  p  )  [inline]
 

Assignment of a string value with a boolean tag to a vector flag.

The flag must already have a vector type. The pair of <string,bool> will be appended to the vector.

Definition at line 185 of file command_line_flags.h.

References CVCL::CLFLAG_STRVEC, d_data, d_modified, and d_tp.

CLFlag& CVCL::CLFlag::operator= const std::vector< std::pair< std::string, bool > > &  sv  )  [inline]
 

Assignment of a vector value.

The flag must already have a vector type.

Definition at line 193 of file command_line_flags.h.

References CVCL::CLFLAG_STRVEC, d_data, d_modified, d_tp, and sv.

CLFlagType CVCL::CLFlag::getType  )  const [inline]
 

Return the type of the flag.

Definition at line 201 of file command_line_flags.h.

References d_tp.

Referenced by CVCL::VCCmd::evaluateCommand(), printUsage(), and CVCL::CLFlags::setFlag().

bool CVCL::CLFlag::modified  )  const [inline]
 

Return true if the flag was modified from the default value (e.g. set on the command line).

Definition at line 204 of file command_line_flags.h.

References d_modified.

Referenced by CVCL::VCCmd::evaluateCommand().

const bool& CVCL::CLFlag::getBool  )  const [inline]
 

Definition at line 211 of file command_line_flags.h.

References CVCL::CLFLAG_BOOL, d_data, and d_tp.

Referenced by printUsage().

const int& CVCL::CLFlag::getInt  )  const [inline]
 

Definition at line 216 of file command_line_flags.h.

References CVCL::CLFLAG_INT, d_data, and d_tp.

Referenced by printUsage().

const std::string& CVCL::CLFlag::getString  )  const [inline]
 

Definition at line 221 of file command_line_flags.h.

References CVCL::CLFLAG_STRING, d_data, and d_tp.

Referenced by printUsage().

const std::vector<std::pair<std::string,bool> >& CVCL::CLFlag::getStrVec  )  const [inline]
 

Definition at line 227 of file command_line_flags.h.

References CVCL::CLFLAG_STRVEC, d_data, and d_tp.

const std::string& CVCL::CLFlag::getHelp  )  const [inline]
 

Definition at line 233 of file command_line_flags.h.

References d_help.

Referenced by printUsage().


Member Data Documentation

CLFlagType CVCL::CLFlag::d_tp [private]
 

Type of the argument.

Definition at line 63 of file command_line_flags.h.

Referenced by CLFlag(), getBool(), getInt(), getString(), getStrVec(), getType(), operator=(), and ~CLFlag().

bool CVCL::CLFlag::b [private]
 

Definition at line 66 of file command_line_flags.h.

int CVCL::CLFlag::i [private]
 

Definition at line 67 of file command_line_flags.h.

std::string* CVCL::CLFlag::s [private]
 

Definition at line 68 of file command_line_flags.h.

std::vector<std::pair<std::string,bool> >* CVCL::CLFlag::sv [private]
 

Definition at line 69 of file command_line_flags.h.

Referenced by CLFlag(), and operator=().

union { ... } CVCL::CLFlag::d_data [private]
 

The argument.

Referenced by CLFlag(), getBool(), getInt(), getString(), getStrVec(), operator=(), and ~CLFlag().

bool CVCL::CLFlag::d_modified [private]
 

This tag is set to true when the flag is assigned a new value.

Definition at line 72 of file command_line_flags.h.

Referenced by modified(), and operator=().

std::string CVCL::CLFlag::d_help [private]
 

Help string.

Definition at line 74 of file command_line_flags.h.

Referenced by getHelp(), and operator=().


The documentation for this class was generated from the following file:
Generated on Thu Apr 13 16:57:42 2006 for CVC Lite by  doxygen 1.4.4