SetParameter Class Reference
Inheritance diagram for SetParameter:
[legend]
Collaboration diagram for SetParameter:
[legend]

## Public Member Functions

| SetParameter (char c, const char *desc, int &v, OptionList *opt)
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 | Status ()=0
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 void | Translate (const char *value)=0
virtual bool | TranslateExtras (const char *value, const char *extras)

## Protected Attributes

String | key
OptionList * | options
Protected Attributes inherited from Parameter
char | ch
char * | description
void * | var
String * | warnings
bool | myNoPhoneHome
String | myVersion

## 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)
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 223 of file Parameters.h.

## Constructor & Destructor Documentation

## SetParameter()

SetParameter::SetParameter | ( | char | c,
|  | const char * | desc,
|  | int & | v,
|  | OptionList * | opt
| ) |  |

Definition at line 238 of file Parameters.cpp.

: Parameter(c, desc, &v)
{
options = opt;
for (OptionList * l = options; l->ch != 0; l++)
{
key += l->ch;
key += '|';
}
key.SetLength(key.Length() - 1);
}
Parameter
Definition: Parameters.h:30
OptionList
Definition: Parameters.h:201

## Member Function Documentation

## Status()

void SetParameter::Status | ( |  | ) |

virtual

Implements Parameter.

Definition at line 251 of file Parameters.cpp.

{
bool first = 0;
int temp = * (int *) var;
for (OptionList * l = options; l->ch != 0; l++)
if ((l->code & temp) || (l->code == *(int *) var))
{
if (!first)
fprintf(stderr, "%*s : %*s (-%c{%s})\n", nameCol, description,
statusCol, l->description, ch, (const char *) key);
else
fprintf(stderr, "%*s & %*s\n", nameCol, "",
statusCol, l->description);
first = true;
temp &= ~l->code;
}
}

## Translate()

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

protected virtual

Implements Parameter.

Definition at line 270 of file Parameters.cpp.

{
*(int*)var = 0;
for (const char * chr = value; *chr != 0; chr++)
{
int valid = false;
for (OptionList * l = options; l->ch != 0; l++)
if (tolower(l->ch) == tolower(*chr))
{
*((int*) var) |= l->code;
valid = true;
}
if (!valid)
warning("Command line parameter -%c%s: the option '%c' has no meaning\n",
ch, value, *chr);
}
}

## Member Data Documentation

## key

String SetParameter::key

protected

Definition at line 231 of file Parameters.h.

## options

OptionList* SetParameter::options

protected

Definition at line 232 of file Parameters.h.

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

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