Public Member Functions | |
rdaData () | |
Constructs an empty rdaData object. | |
rdaData (const rdaData &data) | |
Copy constructs an rdaData object. | |
virtual | ~rdaData () |
Destructor. | |
rdaData & | operator= (const rdaData &data) |
Removes all entries from this rdaData object and copies into it all entries conatained in the specified data object. | |
void | asciiDump (unsigned long maxElements=5) const |
Prints contents of this Data object to the standard output. | |
bool | contains (const char *tag) const |
Returns true if this rdaData object contains an entry with the specified tag;false otherwise. | |
bool | isEmpty () const |
Returns true if this rdaData contains no entries; false otherwise. | |
rdaDataEntry * | get (const char *tag) const |
Returns a pointer to the entry with the specified tag, or NULL if there is no such entry in this rdaData object. | |
void | remove (const char *tag) |
Removes an entry with the specified tag from this data object. | |
void | removeAll () |
Removes all entries from this data object. | |
Print methods | |
These methods send a text representation of the data object to the standard output or a file.
The printout includes tags, data types, and values for all entries contained in this data. | |
void | print (FILE *fp, unsigned long maxElements) const |
Prints contents of this data object to the specified file. | |
void | print (unsigned long maxElements) const |
Prints contents of this data object to the standard output. | |
void | print () const |
Prints contents of this data object to the standard output. | |
Extraction methods | |
bool | extractBoolean (const char *tag) const |
Returns the boolean value stored in the data entry identified by tag. | |
bool * | extractBooleanArray (const char *tag, unsigned long &size) const |
Returns a copy of the boolean array stored in the data entry identified by tag. | |
const bool * | getBooleanArray (const char *tag, unsigned long &size) const |
Returns a pointer to the boolean array stored in the entry identified by tag. | |
signed char | extractByte (const char *tag) const |
Returns the byte value stored in the data entry identified by tag. | |
signed char * | extractByteArray (const char *tag, unsigned long &size) const |
Returns a copy of the byte array stored in the data entry identified by tag. | |
const signed char * | getByteArray (const char *tag, unsigned long &size) const |
Returns a pointer to the byte array stored in the entry identified by tag. | |
short | extractShort (const char *tag) const |
Returns the short value stored in the data entry identified by tag. | |
short * | extractShortArray (const char *tag, unsigned long &size) const |
Returns a copy of the short array stored in the data entry identified by tag. | |
const short * | getShortArray (const char *tag, unsigned long &size) const |
Returns a pointer to the short array stored in the entry identified by tag. | |
long | extractInt (const char *tag) const |
Returns the integer value stored in the data entry identified by tag. | |
long * | extractIntArray (const char *tag, unsigned long &size) const |
Returns a copy of the integer array stored in the data entry identified by tag. | |
const long * | getIntArray (const char *tag, unsigned long &size) const |
Returns a pointer to the integer array stored in the entry identified by tag. | |
longlong | extractLong (const char *tag) const |
Returns the longlong value stored in the data entry identified by tag. | |
longlong * | extractLongArray (const char *tag, unsigned long &size) const |
Returns a copy of the longlong array stored in the data entry identified by tag. | |
const longlong * | getLongArray (const char *tag, unsigned long &size) const |
Returns a pointer to the longlong array stored in the entry identified by tag. | |
float | extractFloat (const char *tag) const |
Returns the float value stored in the data entry identified by tag. | |
float * | extractFloatArray (const char *tag, unsigned long &size) const |
Returns a copy of the float array stored in the data entry identified by tag. | |
const float * | getFloatArray (const char *tag, unsigned long &size) const |
Returns a pointer to the float array stored in the entry identified by tag. | |
double | extractDouble (const char *tag) const |
Returns the double value stored in the data entry identified by tag. | |
double * | extractDoubleArray (const char *tag, unsigned long &size) const |
Returns a copy of the double array stored in the data entry identified by tag. | |
const double * | getDoubleArray (const char *tag, unsigned long &size) const |
Returns a pointer to the double array stored in the entry identified by tag. | |
char * | extractString (const char *tag) const |
Returns a copy of the string stored in the data entry identified by tag. | |
const char * | getString (const char *tag) const |
Returns a pointer to the string stored in the entry identified by tag. | |
char ** | extractStringArray (const char *tag, unsigned long &size) const |
Returns a deep copy of the string array stored in the data entry identified by tag. | |
const char ** | getStringArray (const char *tag, unsigned long &size) const |
Returns a pointer to the string array stored in the entry identified by tag. | |
Insertion methods | |
void | insert (const char *tag, bool value) |
Inserts the boolean value into the entry identified by tag. | |
void | insert (const char *tag, const bool *value, unsigned long size) |
Inserts the boolean array value into the entry identified by tag. | |
void | put (const char *tag, const bool *value, unsigned long size) |
Inserts a boolean array "by pointer" into the entry identified by tag. | |
void | insert (const char *tag, signed char value) |
Inserts the byte value into the entry identified by tag. | |
void | insert (const char *tag, const signed char *value, unsigned long size) |
Inserts the byte array value into the entry identified by tag. | |
void | put (const char *tag, const signed char *value, unsigned long size) |
Inserts a byte array "by pointer" into the entry identified by tag. | |
void | insert (const char *tag, short value) |
Inserts the short value into the entry identified by tag. | |
void | insert (const char *tag, const short *value, unsigned long size) |
Inserts the short array value into the entry identified by tag. | |
void | put (const char *tag, const short *value, unsigned long size) |
Inserts a short array "by pointer" into the entry identified by tag. | |
void | insert (const char *tag, long value) |
Inserts the integer value into the entry identified by tag. | |
void | insert (const char *tag, const long *value, unsigned long size) |
Inserts the integer array value into the entry identified by tag. | |
void | put (const char *tag, const long *value, unsigned long size) |
Inserts an integer array "by pointer" into the entry identified by tag. | |
void | insert (const char *tag, longlong value) |
Inserts the longlong value into the entry identified by tag. | |
void | insert (const char *tag, const longlong *value, unsigned long size) |
Inserts the longlong array value into the entry identified by tag. | |
void | put (const char *tag, const longlong *value, unsigned long size) |
Inserts a longlong array "by pointer" into the entry identified by tag. | |
void | insert (const char *tag, float value) |
Inserts the float value into the entry identified by tag. | |
void | insert (const char *tag, const float *value, unsigned long size) |
Inserts the float array value into the entry identified by tag. | |
void | put (const char *tag, const float *value, unsigned long size) |
Inserts a float array "by pointer" into the entry identified by tag. | |
void | insert (const char *tag, double value) |
Inserts the double value into the entry identified by tag. | |
void | insert (const char *tag, const double *value, unsigned long size) |
Inserts the double array value into the entry identified by tag. | |
void | put (const char *tag, const double *value, unsigned long size) |
Inserts a double array "by pointer" into the entry identified by tag. | |
void | insert (const char *tag, const char *value) |
Inserts the string value into the entry identified by tag. | |
void | put (const char *tag, const char *value) |
Inserts the string value "by pointer" into the entry identified by tag. | |
void | insert (const char *tag, const char **value, unsigned long size) |
Inserts the string array value into the entry identified by tag. | |
void | put (const char *tag, const char **value, unsigned long size) |
Inserts a string array "by pointer" into the entry identified by tag. | |
Friends | |
class | rdaDataIterator |
Related Functions | |
(Note that these are not member functions.) | |
ostream & | operator<< (ostream &os, const rdaData &data) |
Prints a string representation of the data object to the output stream os . |
An rdaData object may contain zero or more rdaDataEntry objects; each entry is uniquely identified by a string tag. The entries can be accessed sequentially (see rdaDataIterator) or randomly by tags.
Each entry can store a value of different types: see rdaDataEntry for the description of supported data types. For each supported type, the rdaData class provides methods for inserting values into and extracting values from a data entry. For a given type X, these methods are:
NULL
value is returned.
NULL
value is returned. Note that strings can also be extracted by pointer, see #getString(const char*).
Decode.cpp, and Encode.cpp.
|
Prints contents of this Data object to the standard output. If a data entry contains an array, at most maxElements of the array will be included in the printout.
|
|
Returns the boolean value stored in the data entry identified by tag.
|
|
Returns a copy of the boolean array stored in the data entry identified by tag.
|
|
Returns the byte value stored in the data entry identified by tag.
|
|
Returns a copy of the byte array stored in the data entry identified by tag.
|
|
Returns the double value stored in the data entry identified by tag.
|
|
Returns a copy of the double array stored in the data entry identified by tag.
|
|
Returns the float value stored in the data entry identified by tag.
|
|
Returns a copy of the float array stored in the data entry identified by tag.
|
|
Returns the integer value stored in the data entry identified by tag.
|
|
Returns a copy of the integer array stored in the data entry identified by tag.
|
|
Returns the longlong value stored in the data entry identified by tag.
|
|
Returns a copy of the longlong array stored in the data entry identified by tag.
|
|
Returns the short value stored in the data entry identified by tag.
|
|
Returns a copy of the short array stored in the data entry identified by tag.
|
|
Returns a copy of the string stored in the data entry identified by tag. The returned string must be released by the caller when it is no longer needed.
|
|
Returns a deep copy of the string array stored in the data entry identified by tag.
|
|
Returns a pointer to the boolean array stored in the entry identified by tag.
|
|
Returns a pointer to the byte array stored in the entry identified by tag.
|
|
Returns a pointer to the double array stored in the entry identified by tag.
|
|
Returns a pointer to the float array stored in the entry identified by tag.
|
|
Returns a pointer to the integer array stored in the entry identified by tag.
|
|
Returns a pointer to the longlong array stored in the entry identified by tag.
|
|
Returns a pointer to the short array stored in the entry identified by tag.
|
|
Returns a pointer to the string stored in the entry identified by tag.
|
|
Returns a pointer to the string array stored in the entry identified by tag.
|
|
Inserts the string array value into the entry identified by tag. The method makes a deep copy of the value array, and stores it the data entry.
|
|
Inserts the string value into the entry identified by tag. The method makes a copy of the value string, and stores it in the data entry.
|
|
Inserts the double array value into the entry identified by tag.
|
|
Inserts the float array value into the entry identified by tag.
|
|
Inserts the longlong array value into the entry identified by tag.
|
|
Inserts the integer array value into the entry identified by tag.
|
|
Inserts the short array value into the entry identified by tag.
|
|
Inserts the byte array value into the entry identified by tag.
|
|
Inserts the boolean array value into the entry identified by tag.
|
|
Prints contents of this data object to the standard output. For array values, at most maxElements of the array will be included in the printout. |
|
Prints contents of this data object to the specified file. For for array values, at most maxElements of the array will be included in the printout.
|
|
Inserts a string array "by pointer" into the entry identified by tag.
|
|
Inserts the string value "by pointer" into the entry identified by tag.
|
|
Inserts a double array "by pointer" into the entry identified by tag.
|
|
Inserts a float array "by pointer" into the entry identified by tag.
|
|
Inserts a longlong array "by pointer" into the entry identified by tag.
|
|
Inserts an integer array "by pointer" into the entry identified by tag.
|
|
Inserts a short array "by pointer" into the entry identified by tag.
|
|
Inserts a byte array "by pointer" into the entry identified by tag.
|
|
Inserts a boolean array "by pointer" into the entry identified by tag.
|
|
Removes an entry with the specified tag from this data object. This method does nothing if there is no such entry in the data. |