|
BOSS 8.0.0
BESIII Offline Software System
|
RPC method arguments and results are represented by Values. More...
#include <XmlRpcValue.h>
Public Types | |
| enum | Type { TypeInvalid , TypeBoolean , TypeInt , TypeDouble , TypeString , TypeDateTime , TypeBase64 , TypeArray , TypeStruct } |
| typedef std::vector< char > | BinaryData |
| typedef std::vector< XmlRpcValue > | ValueArray |
| typedef std::map< std::string, XmlRpcValue > | ValueStruct |
Public Member Functions | |
| XmlRpcValue () | |
| Constructors. | |
| 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. | |
| XmlRpcValue (XmlRpcValue const &rhs) | |
| Copy. | |
| ~XmlRpcValue () | |
| Destructor (make virtual if you want to subclass). | |
| void | clear () |
| Erase the current value. | |
| XmlRpcValue & | operator= (XmlRpcValue const &rhs) |
| XmlRpcValue & | operator= (int const &rhs) |
| XmlRpcValue & | operator= (double const &rhs) |
| XmlRpcValue & | operator= (const char *rhs) |
| bool | operator== (XmlRpcValue const &other) const |
| bool | operator!= (XmlRpcValue const &other) const |
| operator bool & () | |
| operator int & () | |
| operator double & () | |
| operator std::string & () | |
| operator BinaryData & () | |
| operator struct tm & () | |
| XmlRpcValue const & | operator[] (int i) const |
| XmlRpcValue & | operator[] (int i) |
| XmlRpcValue & | operator[] (std::string const &k) |
| XmlRpcValue & | operator[] (const char *k) |
| bool | valid () const |
| Return true if the value has been set to something. | |
| Type const & | getType () const |
| Return the type of the value stored. | |
| int | size () const |
| Return the size for string, base64, array, and struct values. | |
| void | setSize (int size) |
| Specify the size for array values. Array values will grow beyond this size if needed. | |
| bool | hasMember (const std::string &name) const |
| Check for the existence of a struct member by name. | |
| bool | fromXml (std::string const &valueXml, int *offset) |
| Decode xml. Destroys any existing value. | |
| std::string | toXml () const |
| Encode the Value in xml. | |
| std::ostream & | write (std::ostream &os) const |
| Write the value (no xml encoding). | |
Static Public Member Functions | |
| static std::string const & | getDoubleFormat () |
| Return the format used to write double values. | |
| static void | setDoubleFormat (const char *f) |
| Specify the format used to write double values. | |
Protected Member Functions | |
| void | invalidate () |
| void | assertTypeOrInvalid (Type t) |
| void | assertArray (int size) const |
| void | assertArray (int size) |
| void | assertStruct () |
| bool | boolFromXml (std::string const &valueXml, int *offset) |
| bool | intFromXml (std::string const &valueXml, int *offset) |
| bool | doubleFromXml (std::string const &valueXml, int *offset) |
| bool | stringFromXml (std::string const &valueXml, int *offset) |
| bool | timeFromXml (std::string const &valueXml, int *offset) |
| bool | binaryFromXml (std::string const &valueXml, int *offset) |
| bool | arrayFromXml (std::string const &valueXml, int *offset) |
| bool | structFromXml (std::string const &valueXml, int *offset) |
| std::string | boolToXml () const |
| std::string | intToXml () const |
| std::string | doubleToXml () const |
| std::string | stringToXml () const |
| std::string | timeToXml () const |
| std::string | binaryToXml () const |
| std::string | arrayToXml () const |
| std::string | structToXml () const |
Protected Attributes | |
| Type | _type |
| union { | |
| bool asBool | |
| int asInt | |
| double asDouble | |
| struct tm * asTime | |
| std::string * asString | |
| BinaryData * asBinary | |
| ValueArray * asArray | |
| ValueStruct * asStruct | |
| } | _value |
Static Protected Attributes | |
| static std::string | _doubleFormat |
RPC method arguments and results are represented by Values.
Definition at line 22 of file XmlRpcValue.h.
| typedef std::vector<char> XmlRpc::XmlRpcValue::BinaryData |
Definition at line 37 of file XmlRpcValue.h.
| typedef std::vector<XmlRpcValue> XmlRpc::XmlRpcValue::ValueArray |
Definition at line 38 of file XmlRpcValue.h.
| typedef std::map<std::string, XmlRpcValue> XmlRpc::XmlRpcValue::ValueStruct |
Definition at line 39 of file XmlRpcValue.h.
| Enumerator | |
|---|---|
| TypeInvalid | |
| TypeBoolean | |
| TypeInt | |
| TypeDouble | |
| TypeString | |
| TypeDateTime | |
| TypeBase64 | |
| TypeArray | |
| TypeStruct | |
Definition at line 24 of file XmlRpcValue.h.
|
inline |
Constructors.
Definition at line 42 of file XmlRpcValue.h.
Referenced by arrayFromXml(), operator!=(), operator=(), operator=(), operator=(), operator=(), operator==(), operator[](), operator[](), operator[](), operator[](), structFromXml(), and XmlRpcValue().
|
inline |
Definition at line 43 of file XmlRpcValue.h.
|
inline |
Definition at line 44 of file XmlRpcValue.h.
|
inline |
Definition at line 45 of file XmlRpcValue.h.
|
inline |
Definition at line 47 of file XmlRpcValue.h.
|
inline |
Definition at line 51 of file XmlRpcValue.h.
|
inline |
Definition at line 55 of file XmlRpcValue.h.
|
inline |
Definition at line 59 of file XmlRpcValue.h.
|
inline |
Construct from xml, beginning at *offset chars into the string, updates offset.
Definition at line 64 of file XmlRpcValue.h.
|
inline |
|
inline |
Destructor (make virtual if you want to subclass).
Definition at line 72 of file XmlRpcValue.h.
|
protected |
Definition at line 417 of file XmlRpcValue.cpp.
Referenced by fromXml().
|
protected |
Definition at line 432 of file XmlRpcValue.cpp.
Referenced by toXml().
|
protected |
Definition at line 86 of file XmlRpcValue.cpp.
|
protected |
Definition at line 80 of file XmlRpcValue.cpp.
Referenced by operator[](), operator[](), and setSize().
|
protected |
Definition at line 99 of file XmlRpcValue.cpp.
Referenced by operator[](), and operator[]().
|
protected |
Definition at line 63 of file XmlRpcValue.cpp.
Referenced by operator BinaryData &(), operator bool &(), operator double &(), operator int &(), operator std::string &(), and operator struct tm &().
|
protected |
Definition at line 379 of file XmlRpcValue.cpp.
Referenced by fromXml().
|
protected |
Definition at line 398 of file XmlRpcValue.cpp.
Referenced by toXml().
|
protected |
Definition at line 251 of file XmlRpcValue.cpp.
Referenced by fromXml().
|
protected |
Definition at line 263 of file XmlRpcValue.cpp.
Referenced by toXml().
|
inline |
Erase the current value.
Definition at line 75 of file XmlRpcValue.h.
Referenced by XmlRpc::XmlRpcClient::execute().
|
protected |
Definition at line 298 of file XmlRpcValue.cpp.
Referenced by fromXml().
|
protected |
Definition at line 310 of file XmlRpcValue.cpp.
Referenced by toXml().
| bool XmlRpc::XmlRpcValue::fromXml | ( | std::string const & | valueXml, |
| int * | offset ) |
Decode xml. Destroys any existing value.
Definition at line 198 of file XmlRpcValue.cpp.
Referenced by XmlRpc::XmlRpcClient::parseResponse(), and XmlRpcValue().
|
inlinestatic |
Return the format used to write double values.
Definition at line 159 of file XmlRpcValue.h.
Referenced by doubleToXml().
|
inline |
Return the type of the value stored.
Definition at line 137 of file XmlRpcValue.h.
Referenced by XmlRpc::XmlRpcServerConnection::executeMulticall(), XmlRpc::XmlRpcClient::generateRequest(), and getFnamesAtBkk().
| bool XmlRpc::XmlRpcValue::hasMember | ( | const std::string & | name | ) | const |
Check for the existence of a struct member by name.
Definition at line 192 of file XmlRpcValue.cpp.
|
protected |
Definition at line 273 of file XmlRpcValue.cpp.
Referenced by fromXml().
|
protected |
Definition at line 285 of file XmlRpcValue.cpp.
Referenced by toXml().
|
protected |
Definition at line 48 of file XmlRpcValue.cpp.
Referenced by clear(), fromXml(), operator=(), structFromXml(), and ~XmlRpcValue().
|
inline |
Definition at line 104 of file XmlRpcValue.h.
|
inline |
Definition at line 88 of file XmlRpcValue.h.
|
inline |
Definition at line 96 of file XmlRpcValue.h.
|
inline |
Definition at line 92 of file XmlRpcValue.h.
|
inline |
Definition at line 100 of file XmlRpcValue.h.
|
inline |
Definition at line 108 of file XmlRpcValue.h.
| bool XmlRpc::XmlRpcValue::operator!= | ( | XmlRpcValue const & | other | ) | const |
Definition at line 173 of file XmlRpcValue.cpp.
|
inline |
Definition at line 81 of file XmlRpcValue.h.
|
inline |
|
inline |
| XmlRpcValue & XmlRpc::XmlRpcValue::operator= | ( | XmlRpcValue const & | rhs | ) |
Definition at line 109 of file XmlRpcValue.cpp.
Referenced by operator=().
| bool XmlRpc::XmlRpcValue::operator== | ( | XmlRpcValue const & | other | ) | const |
Definition at line 136 of file XmlRpcValue.cpp.
|
inline |
Definition at line 126 of file XmlRpcValue.h.
|
inline |
Definition at line 117 of file XmlRpcValue.h.
|
inline |
Definition at line 113 of file XmlRpcValue.h.
|
inline |
Definition at line 122 of file XmlRpcValue.h.
|
inlinestatic |
|
inline |
Specify the size for array values. Array values will grow beyond this size if needed.
Definition at line 143 of file XmlRpcValue.h.
Referenced by XmlRpc::XmlRpcServerConnection::executeMulticall(), getFnamesAtBkk(), XmlRpc::XmlRpcServer::listMethods(), testArray(), and testStruct().
| int XmlRpc::XmlRpcValue::size | ( | ) | const |
Return the size for string, base64, array, and struct values.
Definition at line 178 of file XmlRpcValue.cpp.
Referenced by assertArray(), assertArray(), ArrayOfStructsTest::execute(), ModerateSizeArrayCheck::execute(), Sum::execute(), XmlRpc::XmlRpcServerConnection::executeMulticall(), XmlRpc::XmlRpcClient::generateRequest(), getFnamesAtBkk(), main(), and setSize().
|
protected |
Definition at line 324 of file XmlRpcValue.cpp.
Referenced by fromXml().
|
protected |
Definition at line 335 of file XmlRpcValue.cpp.
Referenced by toXml().
|
protected |
Definition at line 447 of file XmlRpcValue.cpp.
Referenced by fromXml().
|
protected |
Definition at line 472 of file XmlRpcValue.cpp.
Referenced by toXml().
|
protected |
Definition at line 345 of file XmlRpcValue.cpp.
Referenced by fromXml().
|
protected |
Definition at line 363 of file XmlRpcValue.cpp.
Referenced by toXml().
| std::string XmlRpc::XmlRpcValue::toXml | ( | ) | const |
Encode the Value in xml.
Definition at line 234 of file XmlRpcValue.cpp.
Referenced by XmlRpc::XmlRpcServerConnection::executeRequest(), XmlRpc::XmlRpcServerConnection::generateFaultResponse(), XmlRpc::XmlRpcClient::generateRequest(), and testString().
|
inline |
Return true if the value has been set to something.
Definition at line 134 of file XmlRpcValue.h.
Referenced by XmlRpc::XmlRpcServerConnection::executeMethod(), XmlRpc::XmlRpcClient::generateRequest(), XmlRpc::XmlRpcClient::parseResponse(), and structFromXml().
| std::ostream & XmlRpc::XmlRpcValue::write | ( | std::ostream & | os | ) | const |
Write the value (no xml encoding).
Definition at line 493 of file XmlRpcValue.cpp.
|
staticprotected |
Definition at line 195 of file XmlRpcValue.h.
Referenced by getDoubleFormat(), and setDoubleFormat().
|
protected |
Definition at line 198 of file XmlRpcValue.h.
Referenced by arrayFromXml(), assertArray(), assertArray(), assertStruct(), assertTypeOrInvalid(), binaryFromXml(), boolFromXml(), doubleFromXml(), getType(), hasMember(), intFromXml(), invalidate(), operator=(), operator==(), size(), stringFromXml(), structFromXml(), timeFromXml(), toXml(), valid(), write(), XmlRpcValue(), XmlRpcValue(), XmlRpcValue(), XmlRpcValue(), XmlRpcValue(), XmlRpcValue(), XmlRpcValue(), XmlRpcValue(), XmlRpcValue(), and XmlRpcValue().
| union { ... } XmlRpc::XmlRpcValue::_value |
Referenced by arrayFromXml(), arrayToXml(), assertArray(), assertArray(), assertStruct(), assertTypeOrInvalid(), binaryFromXml(), binaryToXml(), boolFromXml(), boolToXml(), doubleFromXml(), doubleToXml(), hasMember(), intFromXml(), intToXml(), invalidate(), operator BinaryData &(), operator bool &(), operator double &(), operator int &(), operator std::string &(), operator struct tm &(), operator=(), operator==(), operator[](), operator[](), operator[](), operator[](), size(), stringFromXml(), stringToXml(), structFromXml(), structToXml(), timeFromXml(), timeToXml(), write(), XmlRpcValue(), XmlRpcValue(), XmlRpcValue(), XmlRpcValue(), XmlRpcValue(), XmlRpcValue(), XmlRpcValue(), and XmlRpcValue().
| ValueArray* XmlRpc::XmlRpcValue::asArray |
Definition at line 209 of file XmlRpcValue.h.
Referenced by operator=().
| BinaryData* XmlRpc::XmlRpcValue::asBinary |
Definition at line 208 of file XmlRpcValue.h.
Referenced by operator=().
| bool XmlRpc::XmlRpcValue::asBool |
Definition at line 203 of file XmlRpcValue.h.
Referenced by operator=().
| double XmlRpc::XmlRpcValue::asDouble |
Definition at line 205 of file XmlRpcValue.h.
Referenced by operator=().
| int XmlRpc::XmlRpcValue::asInt |
Definition at line 204 of file XmlRpcValue.h.
Referenced by operator=().
| std::string* XmlRpc::XmlRpcValue::asString |
Definition at line 207 of file XmlRpcValue.h.
Referenced by binaryFromXml(), and operator=().
| ValueStruct* XmlRpc::XmlRpcValue::asStruct |
Definition at line 210 of file XmlRpcValue.h.
Referenced by operator=().
| struct tm* XmlRpc::XmlRpcValue::asTime |
Definition at line 206 of file XmlRpcValue.h.
Referenced by operator=().