RPC method arguments and results are represented by Values. More...
#include <XmlRpcValue.h>
Public Types | |
typedef std::vector< char > | BinaryData |
typedef ValueStruct::const_iterator | const_iterator |
typedef ValueStruct::iterator | iterator |
enum | Type { TypeInvalid, TypeBoolean, TypeInt, TypeDouble, TypeString, TypeDateTime, TypeBase64, TypeArray, TypeStruct } |
typedef std::vector< XmlRpcValue > | ValueArray |
typedef std::map< std::string, XmlRpcValue > | ValueStruct |
Public Member Functions | |
iterator | begin () |
const_iterator | begin () const |
void | clear () |
Erase the current value. More... | |
iterator | end () |
const_iterator | end () const |
bool | fromXml (std::string const &valueXml, int *offset) |
Decode xml. Destroys any existing value. More... | |
Type const & | getType () const |
Return the type of the value stored. More... | |
bool | hasMember (const std::string &name) const |
Check for the existence of a struct member by name. More... | |
operator BinaryData & () | |
operator bool & () | |
operator double & () | |
operator int & () | |
operator std::string & () | |
operator struct tm & () | |
bool | operator!= (XmlRpcValue const &other) const |
XmlRpcValue & | operator= (XmlRpcValue const &rhs) |
XmlRpcValue & | operator= (bool const &rhs) |
XmlRpcValue & | operator= (int const &rhs) |
XmlRpcValue & | operator= (double const &rhs) |
XmlRpcValue & | operator= (const char *rhs) |
bool | operator== (XmlRpcValue const &other) const |
XmlRpcValue const & | operator[] (int i) const |
XmlRpcValue & | operator[] (int i) |
XmlRpcValue & | operator[] (std::string const &k) const |
XmlRpcValue & | operator[] (std::string const &k) |
XmlRpcValue & | operator[] (const char *k) const |
XmlRpcValue & | operator[] (const char *k) |
void | setSize (int size) |
Specify the size for array values. Array values will grow beyond this size if needed. More... | |
int | size () const |
Return the size for string, base64, array, and struct values. More... | |
std::string | toXml () const |
Encode the Value in xml. More... | |
bool | valid () const |
Return true if the value has been set to something. More... | |
std::ostream & | write (std::ostream &os) const |
Write the value (no xml encoding) More... | |
XmlRpcValue () | |
Constructors. More... | |
XmlRpcValue (bool value) | |
XmlRpcValue (int value) | |
XmlRpcValue (double value) | |
XmlRpcValue (std::string const &value) | |
XmlRpcValue (const char *value) | |
XmlRpcValue (struct tm *value) | |
XmlRpcValue (void *value, int nBytes) | |
XmlRpcValue (std::string const &xml, int *offset) | |
Construct from xml, beginning at *offset chars into the string, updates offset. More... | |
XmlRpcValue (XmlRpcValue const &rhs) | |
Copy. More... | |
~XmlRpcValue () | |
Destructor (make virtual if you want to subclass) More... | |
Static Public Member Functions | |
static std::string const & | getDoubleFormat () |
Return the format used to write double values. More... | |
static void | setDoubleFormat (const char *f) |
Specify the format used to write double values. More... | |
Protected Member Functions | |
bool | arrayFromXml (std::string const &valueXml, int *offset) |
std::string | arrayToXml () const |
void | assertArray (int size) const |
void | assertArray (int size) |
void | assertStruct () const |
void | assertStruct () |
void | assertTypeOrInvalid (Type t) |
bool | binaryFromXml (std::string const &valueXml, int *offset) |
std::string | binaryToXml () const |
bool | boolFromXml (std::string const &valueXml, int *offset) |
std::string | boolToXml () const |
bool | doubleFromXml (std::string const &valueXml, int *offset) |
std::string | doubleToXml () const |
bool | intFromXml (std::string const &valueXml, int *offset) |
std::string | intToXml () const |
void | invalidate () |
bool | stringFromXml (std::string const &valueXml, int *offset) |
std::string | stringToXml () const |
bool | structFromXml (std::string const &valueXml, int *offset) |
std::string | structToXml () const |
bool | timeFromXml (std::string const &valueXml, int *offset) |
std::string | timeToXml () const |
Protected Attributes | |
Type | _type |
union { | |
ValueArray * asArray | |
BinaryData * asBinary | |
bool asBool | |
double asDouble | |
int asInt | |
std::string * asString | |
ValueStruct * asStruct | |
struct tm * asTime | |
} | _value |
Static Protected Attributes | |
static std::string | _doubleFormat |
RPC method arguments and results are represented by Values.
Definition at line 24 of file XmlRpcValue.h.
typedef std::vector<char> XmlRpc::XmlRpcValue::BinaryData |
Definition at line 41 of file XmlRpcValue.h.
typedef ValueStruct::const_iterator XmlRpc::XmlRpcValue::const_iterator |
Definition at line 45 of file XmlRpcValue.h.
typedef ValueStruct::iterator XmlRpc::XmlRpcValue::iterator |
Definition at line 44 of file XmlRpcValue.h.
typedef std::vector<XmlRpcValue> XmlRpc::XmlRpcValue::ValueArray |
Definition at line 42 of file XmlRpcValue.h.
typedef std::map<std::string, XmlRpcValue> XmlRpc::XmlRpcValue::ValueStruct |
Definition at line 43 of file XmlRpcValue.h.
Enumerator | |
---|---|
TypeInvalid | |
TypeBoolean | |
TypeInt | |
TypeDouble | |
TypeString | |
TypeDateTime | |
TypeBase64 | |
TypeArray | |
TypeStruct |
Definition at line 28 of file XmlRpcValue.h.
|
inline |
Constructors.
Definition at line 48 of file XmlRpcValue.h.
|
inline |
Definition at line 49 of file XmlRpcValue.h.
|
inline |
Definition at line 50 of file XmlRpcValue.h.
|
inline |
Definition at line 51 of file XmlRpcValue.h.
|
inline |
Definition at line 53 of file XmlRpcValue.h.
|
inline |
Definition at line 56 of file XmlRpcValue.h.
|
inline |
Definition at line 59 of file XmlRpcValue.h.
|
inline |
Definition at line 63 of file XmlRpcValue.h.
|
inline |
Construct from xml, beginning at *offset chars into the string, updates offset.
Definition at line 69 of file XmlRpcValue.h.
|
inline |
Copy.
Definition at line 73 of file XmlRpcValue.h.
|
inline |
Destructor (make virtual if you want to subclass)
Definition at line 76 of file XmlRpcValue.h.
|
protected |
Definition at line 491 of file XmlRpcValue.cpp.
|
protected |
Definition at line 510 of file XmlRpcValue.cpp.
|
protected |
Definition at line 89 of file XmlRpcValue.cpp.
|
protected |
Definition at line 98 of file XmlRpcValue.cpp.
|
protected |
Definition at line 110 of file XmlRpcValue.cpp.
|
protected |
Definition at line 116 of file XmlRpcValue.cpp.
|
protected |
Definition at line 71 of file XmlRpcValue.cpp.
|
inline |
Definition at line 106 of file XmlRpcValue.h.
|
inline |
Definition at line 109 of file XmlRpcValue.h.
|
protected |
Definition at line 449 of file XmlRpcValue.cpp.
|
protected |
Definition at line 471 of file XmlRpcValue.cpp.
|
protected |
Definition at line 283 of file XmlRpcValue.cpp.
|
protected |
Definition at line 297 of file XmlRpcValue.cpp.
|
inline |
Erase the current value.
Definition at line 79 of file XmlRpcValue.h.
|
protected |
Definition at line 336 of file XmlRpcValue.cpp.
|
protected |
Definition at line 368 of file XmlRpcValue.cpp.
|
inline |
Definition at line 107 of file XmlRpcValue.h.
|
inline |
Definition at line 110 of file XmlRpcValue.h.
bool XmlRpc::XmlRpcValue::fromXml | ( | std::string const & | valueXml, |
int * | offset | ||
) |
Decode xml. Destroys any existing value.
Definition at line 222 of file XmlRpcValue.cpp.
|
inlinestatic |
Return the format used to write double values.
Definition at line 139 of file XmlRpcValue.h.
|
inline |
bool XmlRpc::XmlRpcValue::hasMember | ( | const std::string & | name | ) | const |
Check for the existence of a struct member by name.
Definition at line 215 of file XmlRpcValue.cpp.
|
protected |
Definition at line 308 of file XmlRpcValue.cpp.
|
protected |
Definition at line 322 of file XmlRpcValue.cpp.
|
protected |
Definition at line 55 of file XmlRpcValue.cpp.
|
inline |
Definition at line 95 of file XmlRpcValue.h.
|
inline |
Definition at line 91 of file XmlRpcValue.h.
|
inline |
Definition at line 93 of file XmlRpcValue.h.
|
inline |
Definition at line 92 of file XmlRpcValue.h.
|
inline |
Definition at line 94 of file XmlRpcValue.h.
|
inline |
Definition at line 96 of file XmlRpcValue.h.
bool XmlRpc::XmlRpcValue::operator!= | ( | XmlRpcValue const & | other | ) | const |
Definition at line 194 of file XmlRpcValue.cpp.
XmlRpcValue & XmlRpc::XmlRpcValue::operator= | ( | XmlRpcValue const & | rhs | ) |
Definition at line 127 of file XmlRpcValue.cpp.
|
inline |
Definition at line 83 of file XmlRpcValue.h.
|
inline |
Definition at line 84 of file XmlRpcValue.h.
|
inline |
Definition at line 85 of file XmlRpcValue.h.
|
inline |
Definition at line 86 of file XmlRpcValue.h.
bool XmlRpc::XmlRpcValue::operator== | ( | XmlRpcValue const & | other | ) | const |
Definition at line 156 of file XmlRpcValue.cpp.
|
inline |
Definition at line 98 of file XmlRpcValue.h.
|
inline |
Definition at line 99 of file XmlRpcValue.h.
|
inline |
Definition at line 101 of file XmlRpcValue.h.
|
inline |
Definition at line 102 of file XmlRpcValue.h.
|
inline |
Definition at line 103 of file XmlRpcValue.h.
|
inline |
Definition at line 104 of file XmlRpcValue.h.
|
inlinestatic |
Specify the format used to write double values.
Definition at line 142 of file XmlRpcValue.h.
|
inline |
Specify the size for array values. Array values will grow beyond this size if needed.
Definition at line 123 of file XmlRpcValue.h.
int XmlRpc::XmlRpcValue::size | ( | ) | const |
Return the size for string, base64, array, and struct values.
Definition at line 201 of file XmlRpcValue.cpp.
|
protected |
Definition at line 385 of file XmlRpcValue.cpp.
|
protected |
Definition at line 397 of file XmlRpcValue.cpp.
|
protected |
Definition at line 528 of file XmlRpcValue.cpp.
|
protected |
Definition at line 553 of file XmlRpcValue.cpp.
|
protected |
Definition at line 408 of file XmlRpcValue.cpp.
|
protected |
Definition at line 431 of file XmlRpcValue.cpp.
std::string XmlRpc::XmlRpcValue::toXml | ( | ) | const |
Encode the Value in xml.
Definition at line 265 of file XmlRpcValue.cpp.
|
inline |
Return true if the value has been set to something.
Definition at line 114 of file XmlRpcValue.h.
std::ostream & XmlRpc::XmlRpcValue::write | ( | std::ostream & | os | ) | const |
Write the value (no xml encoding)
Definition at line 576 of file XmlRpcValue.cpp.
|
staticprotected |
Definition at line 177 of file XmlRpcValue.h.
|
protected |
Definition at line 180 of file XmlRpcValue.h.
union { ... } XmlRpc::XmlRpcValue::_value |
ValueArray* XmlRpc::XmlRpcValue::asArray |
Definition at line 191 of file XmlRpcValue.h.
BinaryData* XmlRpc::XmlRpcValue::asBinary |
Definition at line 190 of file XmlRpcValue.h.
bool XmlRpc::XmlRpcValue::asBool |
Definition at line 185 of file XmlRpcValue.h.
double XmlRpc::XmlRpcValue::asDouble |
Definition at line 187 of file XmlRpcValue.h.
int XmlRpc::XmlRpcValue::asInt |
Definition at line 186 of file XmlRpcValue.h.
std::string* XmlRpc::XmlRpcValue::asString |
Definition at line 189 of file XmlRpcValue.h.
ValueStruct* XmlRpc::XmlRpcValue::asStruct |
Definition at line 192 of file XmlRpcValue.h.
struct tm* XmlRpc::XmlRpcValue::asTime |
Definition at line 188 of file XmlRpcValue.h.