CVC3
2.4.1
|
#include <command_line_flags.h>
Public Member Functions | |
CLFlag (bool b, const std::string &help, bool display=true) | |
Constructor for a boolean flag. More... | |
CLFlag (int i, const std::string &help, bool display=true) | |
Constructor for an integer flag. More... | |
CLFlag (const std::string &s, const std::string &help, bool display=true) | |
Constructor for a string flag. More... | |
CLFlag (const char *s, const std::string &help, bool display=true) | |
Constructor for a string flag from char*. More... | |
CLFlag (const std::vector< std::pair< std::string, bool > > &sv, const std::string &help, bool display=true) | |
Constructor for a vector flag. More... | |
CLFlag () | |
Default constructor. More... | |
CLFlag (const CLFlag &f) | |
Copy constructor. More... | |
~CLFlag () | |
Destructor. More... | |
CLFlag & | operator= (const CLFlag &f) |
Assignment from another flag. More... | |
CLFlag & | operator= (bool b) |
Assignment of a boolean value. More... | |
CLFlag & | operator= (int i) |
Assignment of an integer value. More... | |
CLFlag & | operator= (const std::string &s) |
Assignment of a string value. More... | |
CLFlag & | operator= (const char *s) |
Assignment of an string value from char*. More... | |
CLFlag & | operator= (const std::pair< std::string, bool > &p) |
Assignment of a string value with a boolean tag to a vector flag. More... | |
CLFlag & | operator= (const std::vector< std::pair< std::string, bool > > &sv) |
Assignment of a vector value. More... | |
CLFlagType | getType () const |
Return the type of the flag. More... | |
bool | modified () const |
Return true if the flag was modified from the default value (e.g. set on the command line) More... | |
bool | display () const |
Return true if flag should be displayed in regular help. More... | |
const bool & | getBool () const |
const int & | getInt () const |
const std::string & | getString () const |
const std::vector< std::pair < std::string, bool > > & | getStrVec () const |
const std::string & | getHelp () const |
Private Attributes | |
CLFlagType | d_tp |
Type of the argument. More... | |
union { | |
bool b | |
int i | |
std::string * s | |
std::vector< std::pair < std::string, bool > > * sv | |
} | d_data |
The argument. More... | |
bool | d_modified |
This tag is set to true when the flag is assigned a new value. More... | |
std::string | d_help |
Help string. More... | |
bool | d_display |
Whether to display this flag when user invokes cvc3 -h. More... | |
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 53 of file command_line_flags.h.
|
inline |
Constructor for a boolean flag.
Definition at line 72 of file command_line_flags.h.
|
inline |
Constructor for an integer flag.
Definition at line 76 of file command_line_flags.h.
|
inline |
Constructor for a string flag.
Definition at line 80 of file command_line_flags.h.
References d_data.
|
inline |
Constructor for a string flag from char*.
Definition at line 85 of file command_line_flags.h.
References d_data.
|
inline |
Constructor for a vector flag.
Definition at line 90 of file command_line_flags.h.
|
inline |
Default constructor.
Definition at line 96 of file command_line_flags.h.
|
inline |
Copy constructor.
Definition at line 98 of file command_line_flags.h.
References CVC3::CLFLAG_STRING, CVC3::CLFLAG_STRVEC, d_data, d_tp, s, and sv.
|
inline |
Destructor.
Definition at line 109 of file command_line_flags.h.
References CVC3::CLFLAG_STRING, CVC3::CLFLAG_STRVEC, d_data, and d_tp.
Assignment from another flag.
Definition at line 117 of file command_line_flags.h.
References CVC3::CLFLAG_STRING, CVC3::CLFLAG_STRVEC, d_data, d_display, d_help, d_modified, d_tp, s, and sv.
|
inline |
Assignment of a boolean value.
The flag must already have the right type
Definition at line 148 of file command_line_flags.h.
References b, CVC3::CLFLAG_BOOL, d_data, d_modified, d_tp, and DebugAssert.
|
inline |
Assignment of an integer value.
The flag must already have the right type
Definition at line 156 of file command_line_flags.h.
References CVC3::CLFLAG_INT, d_data, d_modified, d_tp, DebugAssert, and i.
|
inline |
Assignment of a string value.
The flag must already have a string type.
Definition at line 164 of file command_line_flags.h.
References CVC3::CLFLAG_STRING, d_data, d_modified, d_tp, DebugAssert, and s.
|
inline |
Assignment of an string value from char*.
The flag must already have a string type.
Definition at line 172 of file command_line_flags.h.
References CVC3::CLFLAG_STRING, d_data, d_modified, d_tp, DebugAssert, and s.
|
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 181 of file command_line_flags.h.
References CVC3::CLFLAG_STRVEC, d_data, d_modified, d_tp, and DebugAssert.
|
inline |
Assignment of a vector value.
The flag must already have a vector type.
Definition at line 189 of file command_line_flags.h.
References CVC3::CLFLAG_STRVEC, d_data, d_modified, d_tp, DebugAssert, and sv.
|
inline |
Return the type of the flag.
Definition at line 197 of file command_line_flags.h.
References d_tp.
Referenced by CVC3::VCCmd::evaluateCommand(), printUsage(), and CVC3::CLFlags::setFlag().
|
inline |
Return true if the flag was modified from the default value (e.g. set on the command line)
Definition at line 200 of file command_line_flags.h.
References d_modified.
Referenced by CVC3::VCCmd::evaluateCommand().
|
inline |
Return true if flag should be displayed in regular help.
Definition at line 202 of file command_line_flags.h.
References d_display.
Referenced by printUsage().
|
inline |
Definition at line 209 of file command_line_flags.h.
References CVC3::CLFLAG_BOOL, d_data, d_tp, and DebugAssert.
Referenced by printUsage().
|
inline |
Definition at line 214 of file command_line_flags.h.
References CVC3::CLFLAG_INT, d_data, d_tp, and DebugAssert.
Referenced by printUsage().
|
inline |
Definition at line 219 of file command_line_flags.h.
References CVC3::CLFLAG_STRING, d_data, d_tp, and DebugAssert.
Referenced by printUsage().
|
inline |
Definition at line 225 of file command_line_flags.h.
References CVC3::CLFLAG_STRVEC, d_data, d_tp, and DebugAssert.
|
inline |
|
private |
Type of the argument.
Definition at line 56 of file command_line_flags.h.
Referenced by CLFlag(), getBool(), getInt(), getString(), getStrVec(), getType(), operator=(), and ~CLFlag().
bool CVC3::CLFlag::b |
Definition at line 59 of file command_line_flags.h.
Referenced by CLFlag(), and operator=().
int CVC3::CLFlag::i |
Definition at line 60 of file command_line_flags.h.
Referenced by CLFlag(), and operator=().
std::string* CVC3::CLFlag::s |
Definition at line 61 of file command_line_flags.h.
Referenced by CLFlag(), and operator=().
std::vector<std::pair<std::string,bool> >* CVC3::CLFlag::sv |
Definition at line 62 of file command_line_flags.h.
Referenced by CLFlag(), and operator=().
union { ... } CVC3::CLFlag::d_data |
The argument.
Referenced by CLFlag(), getBool(), getInt(), getString(), getStrVec(), operator=(), and ~CLFlag().
|
private |
This tag is set to true when the flag is assigned a new value.
Definition at line 65 of file command_line_flags.h.
Referenced by modified(), and operator=().
|
private |
Help string.
Definition at line 67 of file command_line_flags.h.
Referenced by getHelp(), and operator=().
|
private |
Whether to display this flag when user invokes cvc3 -h.
Definition at line 69 of file command_line_flags.h.
Referenced by display(), and operator=().