WBA_Argument
WBA_Argument
wba
1998 12-05
CLASS
WBA_Argument - C++ class representing a single unified argument
SYNOPSIS
This class is used to represent an argument whose data may have originated
from either the program itself, the command line, a configuration file, or
an environment variable. A WBA_Argument is made up of a key string, a
value string, a description string, and a list of aliases. The aliases are
primarily used by WBA_Environment::LoadCommandLine() to allow for
alternate flags (such as the commonly used single letter flags).
CONSTRUCTORS
WBA_Argument(void)
The value is set to "0".
WBA_Argument(const GPL_String &k)
Create an argument with key k. The value is set to "0".
WBA_Argument(const GPL_String &k, const GPL_String &v)
Create an argument with key k, and value v.
WBA_Argument(const GPL_String &k, const GPL_String &v, const GPL_String &d)
Create an argument with key k, value v, and description d.
MEMBER FUNCTIONS
GPL_Boolean GetQuiet()
Return the quiet setting.
void SetQuiet(GPL_Boolean q)
Set quiet. If an argument is quiet it will not be included in a
WBA_Application::GetUsage(FALSE) call.
void SetKey(const GPL_String &k)
Set the key to k.
void SetValue(const GPL_String &v)
Set the value to v.
void SetDescription(const GPL_String &d)
Set the description to d.
void AddAlias(const GPL_String &a)
Add alias a to the alias list.
const GPL_String &GetKey(void) const
Return the key.
const GPL_String &GetValue(void) const
Return the value.
const GPL_String &GetDescription(void) const
Return the description.
const GPL_List<GPL_String> & GetAliases(void) const
Return the alias list.
GPL_Boolean IsAlias(const GPL_String &alias) const
Return TRUE if alias is in the alias list, otherwise return
FALSE.
GPL_Boolean IsTrue(void) const
Return the logical negation of IsFalse().
GPL_Boolean IsFalse(void) const
Return TRUE if value is not set or if value is equal to "0",
"FALSE", "false", or "False". Otherwise return
FALSE.
long GetLong(void) const
Return a long representation of the value.
double GetDouble(void) const
Return a double representation of the value.
void SetLong(long l)
Set value to a string representation of a long.
void SetDouble(double f)
Set value to a string representation of a double.
void Increment(void)
This function increments the value in terms of a long. The resulting
value will be a string representation of a long.
void Decrement(void)
This function decrements the value in terms of a long.
The resulting value will be a string representation of a long.
void Print(void) const
Print a string representation of the argument name, value, and description
to stderr.