Rudiments
|
Inherits object.
Public Member Functions | |
parameterstring () | |
~parameterstring () | |
void | setDelimiter (char delim) |
bool | parse (const char *string) |
const char * | getValue (const char *name) |
bool | clear () |
dictionary< char *, char * > * | getDictionary () |
Public Member Functions inherited from object | |
virtual | ~object () |
The parameterstring class provides methods for parsing and accessing name/value pairs in so-called "parameter strings" formatted like this:
char *string="name1=value1;name2='value2';name3=value3";
Parameter strings are often used to define connections to servers, databases or for other similar things.
parameterstring::parameterstring | ( | ) |
Creates an instance of the parameterstring class.
parameterstring::~parameterstring | ( | ) |
Deletes this instance of the parameterstring class.
bool parameterstring::clear | ( | ) |
Clears the stored set of names and values. After a call to clear(), getValue() will return NULL until parse() is called again.
Always returns true.
dictionary<char *,char *>* parameterstring::getDictionary | ( | ) |
Returns the dictionary used internally by this instance of the parameterstring class.
const char* parameterstring::getValue | ( | const char * | name | ) |
Returns the corresponding value for "name". parse() must have been called already or this method will return NULL.
bool parameterstring::parse | ( | const char * | string | ) |
Parses "string" and extracts the names and values.
void parameterstring::setDelimiter | ( | char | delim | ) |
Defines the delimiter separating the parameters. The default is a semicolon.