Loading...
Searching...
No Matches
SwitchParameter Class Reference
Inheritance diagram for SwitchParameter:
[legend]
Collaboration diagram for SwitchParameter:
[legend]

## Public Member Functions

| SwitchParameter (char c, const char *desc, bool &v)
virtual void | Status ()
Public Member Functions inherited from Parameter
| Parameter (char c, const char *desc, void *v)
virtual bool | Read (int argc, char **argv, int argn)
virtual void | addParamsToString (String &params)
void | SetWarningBuffer (String &buffer)
void | warning (const char *format,...)

## Protected Member Functions

virtual void | Translate (const char *value)
Protected Member Functions inherited from Parameter
virtual bool | TranslateExtras (const char *value, const char *extras)

## Additional Inherited Members

Static Public Member Functions inherited from Parameter
static void | SetNameLen (int len)
static void | SetStatusLen (int len)
Static Protected Member Functions inherited from Parameter
static bool | CheckInteger (const char *value)
static bool | CheckDouble (const char *value)
Protected Attributes inherited from Parameter
char | ch
char * | description
void * | var
String * | warnings
bool | myNoPhoneHome
String | myVersion
Static Protected Attributes inherited from Parameter
static const char | PARAM_STR_SEP = ','
static int | nameCol = 30
static int | statusCol = 15

## Detailed Description

Definition at line 118 of file Parameters.h.

## Constructor & Destructor Documentation

## SwitchParameter()

SwitchParameter::SwitchParameter | ( | char | c,
|  | const char * | desc,
|  | bool & | v )

inline

Definition at line 121 of file Parameters.h.

: Parameter(c, desc, &v)
{}

## Member Function Documentation

## Status()

void SwitchParameter::Status | ( |  | ) |

virtual

Implements Parameter.

Definition at line 124 of file Parameters.cpp.

{
fprintf(stderr, "%*s : %*s (-%c[+|-])\n", nameCol, description,
statusCol, *(bool *) var == false ? "OFF" : "ON", ch);
}

## Translate()

void SwitchParameter::Translate | ( | const char * | value | ) |

protected virtual

Implements Parameter.

Definition at line 105 of file Parameters.cpp.

{
switch (*value)
{
case '+' :
*(bool *) var = true;
break;
case '-' :
*(bool *) var = false;
break;
case 0 :
*(bool *) var = ! * (bool *) var;
break;
default :
warning("Command line parameter -%c%s: the option '%c' has no meaning\n",
ch, value, value[0]);
}
}

The documentation for this class was generated from the following files:

- general/Parameters.h
- general/Parameters.cpp