Public Types |
enum | { MaxKeywordLength = 256
} |
enum | KeyValError {
OK,
HasNoValue,
WrongType,
UnknownKeyword,
OperationFailed
} |
Public Methods |
virtual | ~KeyVal () |
int | exists (const char *) |
| This takes as its only argument a keyword. More...
|
int | count (const char *=0) |
| If the value of a keyword is an array, then return its length. More...
|
Ref< KeyValValue > | value (const char *=0, const KeyValValue &def=KeyValValue()) |
| Return the value associated with the keyword.
|
int | booleanvalue (const char *key=0, const KeyValValue &def=KeyValValueboolean()) |
| Returns the boolean value (0 = false, 1 = true) of key.
|
double | doublevalue (const char *key=0, const KeyValValue &def=KeyValValuedouble()) |
| Returns the double value of key.
|
float | floatvalue (const char *key=0, const KeyValValue &def=KeyValValuefloat()) |
| Returns the float value of key.
|
char | charvalue (const char *key=0, const KeyValValue &def=KeyValValuechar()) |
| Returns the char value of key.
|
int | intvalue (const char *key=0, const KeyValValue &def=KeyValValueint()) |
| Returns the int value of key.
|
size_t | sizevalue (const char *key=0, const KeyValValue &def=KeyValValuesize()) |
| Returns the size_t value of key.
|
char * | pcharvalue (const char *key=0, const KeyValValue &def=KeyValValuepchar()) |
| Returns a copy of the string representation of the key's value. More...
|
Ref< DescribedClass > | describedclassvalue (const char *key=0, const KeyValValue &def=KeyValValueRefDescribedClass()) |
| Returns a reference to an object of type DescribedClass.
|
int | exists (const char *, int) |
int | count (const char *, int) |
int | booleanvalue (const char *, int, const KeyValValue &def=KeyValValueboolean()) |
double | doublevalue (const char *key, int, const KeyValValue &def=KeyValValuedouble()) |
float | floatvalue (const char *key, int, const KeyValValue &def=KeyValValuefloat()) |
char | charvalue (const char *key, int, const KeyValValue &def=KeyValValuechar()) |
int | intvalue (const char *key, int, const KeyValValue &def=KeyValValueint()) |
size_t | sizevalue (const char *key, int, const KeyValValue &def=KeyValValuesize()) |
char * | pcharvalue (const char *key, int, const KeyValValue &def=KeyValValuepchar()) |
Ref< DescribedClass > | describedclassvalue (const char *key, int, const KeyValValue &def=KeyValValueRefDescribedClass()) |
int | exists (int i) |
int | count (int i) |
int | booleanvalue (int i, const KeyValValue &def=KeyValValueboolean()) |
double | doublevalue (int i, const KeyValValue &def=KeyValValuedouble()) |
float | floatvalue (int i, const KeyValValue &def=KeyValValuefloat()) |
char | charvalue (int i, const KeyValValue &def=KeyValValuechar()) |
int | intvalue (int i, const KeyValValue &def=KeyValValueint()) |
size_t | sizevalue (int i, const KeyValValue &def=KeyValValuesize()) |
char * | pcharvalue (int i, const KeyValValue &def=KeyValValuepchar()) |
Ref< DescribedClass > | describedclassvalue (int i, const KeyValValue &def=KeyValValueRefDescribedClass()) |
int | exists (const char *, int, int) |
int | count (const char *, int, int) |
int | booleanvalue (const char *, int, int, const KeyValValue &def=KeyValValueboolean()) |
double | doublevalue (const char *key, int, int, const KeyValValue &def=KeyValValuedouble()) |
float | floatvalue (const char *key, int, int, const KeyValValue &def=KeyValValuefloat()) |
char | charvalue (const char *key, int, int, const KeyValValue &def=KeyValValuechar()) |
int | intvalue (const char *key, int, int, const KeyValValue &def=KeyValValueint()) |
size_t | sizevalue (const char *key, int, int, const KeyValValue &def=KeyValValuesize()) |
char * | pcharvalue (const char *key, int, int, const KeyValValue &def=KeyValValuepchar()) |
Ref< DescribedClass > | describedclassvalue (const char *key, int, int, const KeyValValue &def=KeyValValueRefDescribedClass()) |
int | exists (int i, int j) |
int | count (int i, int j) |
int | booleanvalue (int i, int j, const KeyValValue &def=KeyValValueboolean()) |
double | doublevalue (int i, int j, const KeyValValue &def=KeyValValuedouble()) |
float | floatvalue (int i, int j, const KeyValValue &def=KeyValValuefloat()) |
char | charvalue (int i, int j, const KeyValValue &def=KeyValValuechar()) |
int | intvalue (int i, int j, const KeyValValue &def=KeyValValueint()) |
size_t | sizevalue (int i, int j, const KeyValValue &def=KeyValValuesize()) |
char * | pcharvalue (int i, int j, const KeyValValue &def=KeyValValuepchar()) |
Ref< DescribedClass > | describedclassvalue (int i, int j, const KeyValValue &def=KeyValValueRefDescribedClass()) |
int | Va_exists (const char *, int,...) |
int | Va_count (const char *, int,...) |
int | Va_booleanvalue (const char *, int,...) |
double | Va_doublevalue (const char *key, int,...) |
float | Va_floatvalue (const char *key, int,...) |
char | Va_charvalue (const char *key, int,...) |
int | Va_intvalue (const char *key, int,...) |
size_t | Va_sizevalue (const char *key, int,...) |
char * | Va_pcharvalue (const char *key, int,...) |
Ref< DescribedClass > | Va_describedclassvalue (const char *key, int,...) |
KeyValError | error () |
| Return the current error condition.
|
const char * | errormsg (KeyValError err) |
| Return a textual representation of err.
|
const char * | errormsg () |
| Return a textual representation of the current error.
|
virtual void | errortrace (std::ostream &fp=ExEnv::err0()) |
virtual void | dump (std::ostream &fp=ExEnv::err0()) |
virtual void | print_unseen (std::ostream &fp=ExEnv::out0()) |
| Print keywords that were never looked at, if possible.
|
virtual int | have_unseen () |
| Return 1 if there were unseen keywords, 0 if there are none, or -1 this keyval doesn't keep track of unseen keywords.
|
void | verbose (int v) |
| Control printing of assignments.
|
int | verbose () const |
| Returns nonzero if assignments are printed.
|
Protected Methods |
| KeyVal () |
void | seterror (KeyValError err) |
| Set the current error condition.
|
void | seterror (KeyValValue::KeyValValueError err) |
| Set the current error condition.
|
virtual int | key_exists (const char *)=0 |
| Ultimately called by exists.
|
virtual int | key_count (const char *=0) |
| Ultimately called by count.
|
virtual Ref< KeyValValue > | key_value (const char *, const KeyValValue &def)=0 |
| Ultimately called by value.
|
virtual int | key_booleanvalue (const char *, const KeyValValue &def) |
| Ultimately called by booleanvalue.
|
virtual double | key_doublevalue (const char *key, const KeyValValue &def) |
| Ultimately called by doublevalue.
|
virtual float | key_floatvalue (const char *key, const KeyValValue &def) |
| Ultimately called by floatvalue.
|
virtual char | key_charvalue (const char *key, const KeyValValue &def) |
| Ultimately called by charvalue.
|
virtual int | key_intvalue (const char *key, const KeyValValue &def) |
| Ultimately called by intvalue.
|
virtual size_t | key_sizevalue (const char *key, const KeyValValue &def) |
| Ultimately called by sizevalue.
|
virtual char * | key_pcharvalue (const char *key, const KeyValValue &def) |
| Ultimately called by pcharvalue.
|
virtual Ref< DescribedClass > | key_describedclassvalue (const char *key, const KeyValValue &def) |
| Ultimately called by describedclassvalue.
|
Protected Attributes |
int | verbose_ |
Friends |
class | AggregateKeyVal |
class | PrefixKeyVal |
A flexible input style and ease of use for the programmer is achieved with this method. Keywords are represented by null terminated character arrays. The keywords are organized hierarchially, in a manner similar to the way that many file systems are organized. One character is special, ":", which is used to separate the various hierarchial labels, which are referred to as "segments", in the keyword.