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

## Public Member Functions

| StringParameter (char c, const char *desc, String &v, bool allowBlank=true)
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)
virtual bool | TranslateExtras (const char *value, const char *extras)

## Protected Attributes

bool | required
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 172 of file Parameters.h.

## Constructor & Destructor Documentation

## StringParameter()

StringParameter::StringParameter | ( | char | c,
|  | const char * | desc,
|  | String & | v,
|  | bool | allowBlank = `true`
| ) |  |

inline

Definition at line 175 of file Parameters.h.

: Parameter(c, desc, &v)
{
required = !allowBlank;
}
Parameter
Definition Parameters.h:30

## Member Function Documentation

## Status()

void StringParameter::Status | ( |  | ) |

virtual

Implements Parameter.

Definition at line 191 of file Parameters.cpp.

{
fprintf(stderr, "%*s : %*s (-%cname)\n", nameCol, description,
statusCol, (const char *)(*(String *) var), ch);
}
String
Definition StringBasics.h:39

## Translate()

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

protected virtual

Implements Parameter.

Definition at line 172 of file Parameters.cpp.

{
String * s = (String *) var;
*s = value;
}

## TranslateExtras()

bool StringParameter::TranslateExtras | ( | const char * | value,
|  | const char * | extras
| ) |  |

protected virtual

Reimplemented from Parameter.

Definition at line 179 of file Parameters.cpp.

{
if ((value[0] != 0) || ((!required) && (extras[0] == '-')))
return false;
String * s = (String *) var;
*s = extras;
return true;
}

## Member Data Documentation

## required

bool StringParameter::required

protected

Definition at line 184 of file Parameters.h.

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

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