Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
XmlRpc::XmlRpcValue Class Reference

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< XmlRpcValueValueArray
 
typedef std::map< std::string, XmlRpcValueValueStruct
 

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 const BinaryData & () const
 
 operator const bool & () const
 
 operator const double & () const
 
 operator const int & () const
 
 operator const std::string & () const
 
 operator const struct tm & () const
 
 operator double & ()
 
 operator int & ()
 
 operator std::string & ()
 
 operator struct tm & ()
 
bool operator!= (XmlRpcValue const &other) const
 
XmlRpcValueoperator= (XmlRpcValue const &rhs)
 
XmlRpcValueoperator= (bool const &rhs)
 
XmlRpcValueoperator= (int const &rhs)
 
XmlRpcValueoperator= (double const &rhs)
 
XmlRpcValueoperator= (const char *rhs)
 
bool operator== (XmlRpcValue const &other) const
 
XmlRpcValue const & operator[] (int i) const
 
XmlRpcValueoperator[] (int i)
 
XmlRpcValueoperator[] (std::string const &k) const
 
XmlRpcValueoperator[] (std::string const &k)
 
XmlRpcValueoperator[] (const char *k) const
 
XmlRpcValueoperator[] (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) const
 
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
 

Detailed Description

RPC method arguments and results are represented by Values.

Definition at line 24 of file XmlRpcValue.h.

Member Typedef Documentation

◆ BinaryData

typedef std::vector<char> XmlRpc::XmlRpcValue::BinaryData

Definition at line 41 of file XmlRpcValue.h.

◆ const_iterator

typedef ValueStruct::const_iterator XmlRpc::XmlRpcValue::const_iterator

Definition at line 45 of file XmlRpcValue.h.

◆ iterator

typedef ValueStruct::iterator XmlRpc::XmlRpcValue::iterator

Definition at line 44 of file XmlRpcValue.h.

◆ ValueArray

Definition at line 42 of file XmlRpcValue.h.

◆ ValueStruct

typedef std::map<std::string, XmlRpcValue> XmlRpc::XmlRpcValue::ValueStruct

Definition at line 43 of file XmlRpcValue.h.

Member Enumeration Documentation

◆ Type

Enumerator
TypeInvalid 
TypeBoolean 
TypeInt 
TypeDouble 
TypeString 
TypeDateTime 
TypeBase64 
TypeArray 
TypeStruct 

Definition at line 28 of file XmlRpcValue.h.

Constructor & Destructor Documentation

◆ XmlRpcValue() [1/10]

XmlRpc::XmlRpcValue::XmlRpcValue ( )
inline

Constructors.

Definition at line 48 of file XmlRpcValue.h.

◆ XmlRpcValue() [2/10]

XmlRpc::XmlRpcValue::XmlRpcValue ( bool  value)
inline

Definition at line 49 of file XmlRpcValue.h.

◆ XmlRpcValue() [3/10]

XmlRpc::XmlRpcValue::XmlRpcValue ( int  value)
inline

Definition at line 50 of file XmlRpcValue.h.

◆ XmlRpcValue() [4/10]

XmlRpc::XmlRpcValue::XmlRpcValue ( double  value)
inline

Definition at line 51 of file XmlRpcValue.h.

◆ XmlRpcValue() [5/10]

XmlRpc::XmlRpcValue::XmlRpcValue ( std::string const &  value)
inline

Definition at line 53 of file XmlRpcValue.h.

◆ XmlRpcValue() [6/10]

XmlRpc::XmlRpcValue::XmlRpcValue ( const char *  value)
inline

Definition at line 56 of file XmlRpcValue.h.

◆ XmlRpcValue() [7/10]

XmlRpc::XmlRpcValue::XmlRpcValue ( struct tm *  value)
inline

Definition at line 59 of file XmlRpcValue.h.

◆ XmlRpcValue() [8/10]

XmlRpc::XmlRpcValue::XmlRpcValue ( void *  value,
int  nBytes 
)
inline

Definition at line 63 of file XmlRpcValue.h.

◆ XmlRpcValue() [9/10]

XmlRpc::XmlRpcValue::XmlRpcValue ( std::string const &  xml,
int *  offset 
)
inline

Construct from xml, beginning at *offset chars into the string, updates offset.

Definition at line 69 of file XmlRpcValue.h.

◆ XmlRpcValue() [10/10]

XmlRpc::XmlRpcValue::XmlRpcValue ( XmlRpcValue const &  rhs)
inline

Copy.

Definition at line 73 of file XmlRpcValue.h.

◆ ~XmlRpcValue()

XmlRpc::XmlRpcValue::~XmlRpcValue ( )
inline

Destructor (make virtual if you want to subclass)

Definition at line 76 of file XmlRpcValue.h.

Member Function Documentation

◆ arrayFromXml()

bool XmlRpc::XmlRpcValue::arrayFromXml ( std::string const &  valueXml,
int *  offset 
)
protected

Definition at line 527 of file XmlRpcValue.cpp.

◆ arrayToXml()

std::string XmlRpc::XmlRpcValue::arrayToXml ( ) const
protected

Definition at line 546 of file XmlRpcValue.cpp.

◆ assertArray() [1/2]

void XmlRpc::XmlRpcValue::assertArray ( int  size) const
protected

Definition at line 99 of file XmlRpcValue.cpp.

◆ assertArray() [2/2]

void XmlRpc::XmlRpcValue::assertArray ( int  size)
protected

Definition at line 108 of file XmlRpcValue.cpp.

◆ assertStruct() [1/2]

void XmlRpc::XmlRpcValue::assertStruct ( ) const
protected

Definition at line 120 of file XmlRpcValue.cpp.

◆ assertStruct() [2/2]

void XmlRpc::XmlRpcValue::assertStruct ( )
protected

Definition at line 126 of file XmlRpcValue.cpp.

◆ assertTypeOrInvalid() [1/2]

void XmlRpc::XmlRpcValue::assertTypeOrInvalid ( Type  t) const
protected

Definition at line 75 of file XmlRpcValue.cpp.

◆ assertTypeOrInvalid() [2/2]

void XmlRpc::XmlRpcValue::assertTypeOrInvalid ( Type  t)
protected

Definition at line 81 of file XmlRpcValue.cpp.

◆ begin() [1/2]

iterator XmlRpc::XmlRpcValue::begin ( )
inline

Definition at line 113 of file XmlRpcValue.h.

◆ begin() [2/2]

const_iterator XmlRpc::XmlRpcValue::begin ( ) const
inline

Definition at line 116 of file XmlRpcValue.h.

◆ binaryFromXml()

bool XmlRpc::XmlRpcValue::binaryFromXml ( std::string const &  valueXml,
int *  offset 
)
protected

Definition at line 484 of file XmlRpcValue.cpp.

◆ binaryToXml()

std::string XmlRpc::XmlRpcValue::binaryToXml ( ) const
protected

Definition at line 505 of file XmlRpcValue.cpp.

◆ boolFromXml()

bool XmlRpc::XmlRpcValue::boolFromXml ( std::string const &  valueXml,
int *  offset 
)
protected

Definition at line 295 of file XmlRpcValue.cpp.

◆ boolToXml()

std::string XmlRpc::XmlRpcValue::boolToXml ( ) const
protected

Definition at line 309 of file XmlRpcValue.cpp.

◆ clear()

void XmlRpc::XmlRpcValue::clear ( )
inline

Erase the current value.

Definition at line 79 of file XmlRpcValue.h.

◆ doubleFromXml()

bool XmlRpc::XmlRpcValue::doubleFromXml ( std::string const &  valueXml,
int *  offset 
)
protected

Definition at line 348 of file XmlRpcValue.cpp.

◆ doubleToXml()

std::string XmlRpc::XmlRpcValue::doubleToXml ( ) const
protected

Definition at line 380 of file XmlRpcValue.cpp.

◆ end() [1/2]

iterator XmlRpc::XmlRpcValue::end ( )
inline

Definition at line 114 of file XmlRpcValue.h.

◆ end() [2/2]

const_iterator XmlRpc::XmlRpcValue::end ( ) const
inline

Definition at line 117 of file XmlRpcValue.h.

◆ fromXml()

bool XmlRpc::XmlRpcValue::fromXml ( std::string const &  valueXml,
int *  offset 
)

Decode xml. Destroys any existing value.

Definition at line 232 of file XmlRpcValue.cpp.

◆ getDoubleFormat()

static std::string const& XmlRpc::XmlRpcValue::getDoubleFormat ( )
inlinestatic

Return the format used to write double values.

Definition at line 146 of file XmlRpcValue.h.

◆ getType()

Type const& XmlRpc::XmlRpcValue::getType ( ) const
inline

Return the type of the value stored.

See also
Type.

Definition at line 124 of file XmlRpcValue.h.

◆ hasMember()

bool XmlRpc::XmlRpcValue::hasMember ( const std::string &  name) const

Check for the existence of a struct member by name.

Definition at line 225 of file XmlRpcValue.cpp.

◆ intFromXml()

bool XmlRpc::XmlRpcValue::intFromXml ( std::string const &  valueXml,
int *  offset 
)
protected

Definition at line 320 of file XmlRpcValue.cpp.

◆ intToXml()

std::string XmlRpc::XmlRpcValue::intToXml ( ) const
protected

Definition at line 334 of file XmlRpcValue.cpp.

◆ invalidate()

void XmlRpc::XmlRpcValue::invalidate ( )
protected

Definition at line 59 of file XmlRpcValue.cpp.

◆ operator BinaryData &()

XmlRpc::XmlRpcValue::operator BinaryData & ( )
inline

Definition at line 95 of file XmlRpcValue.h.

◆ operator bool &()

XmlRpc::XmlRpcValue::operator bool & ( )
inline

Definition at line 91 of file XmlRpcValue.h.

◆ operator const BinaryData &()

XmlRpc::XmlRpcValue::operator const BinaryData & ( ) const
inline

Definition at line 102 of file XmlRpcValue.h.

◆ operator const bool &()

XmlRpc::XmlRpcValue::operator const bool & ( ) const
inline

Definition at line 98 of file XmlRpcValue.h.

◆ operator const double &()

XmlRpc::XmlRpcValue::operator const double & ( ) const
inline

Definition at line 100 of file XmlRpcValue.h.

◆ operator const int &()

XmlRpc::XmlRpcValue::operator const int & ( ) const
inline

Definition at line 99 of file XmlRpcValue.h.

◆ operator const std::string &()

XmlRpc::XmlRpcValue::operator const std::string & ( ) const
inline

Definition at line 101 of file XmlRpcValue.h.

◆ operator const struct tm &()

XmlRpc::XmlRpcValue::operator const struct tm & ( ) const
inline

Definition at line 103 of file XmlRpcValue.h.

◆ operator double &()

XmlRpc::XmlRpcValue::operator double & ( )
inline

Definition at line 93 of file XmlRpcValue.h.

◆ operator int &()

XmlRpc::XmlRpcValue::operator int & ( )
inline

Definition at line 92 of file XmlRpcValue.h.

◆ operator std::string &()

XmlRpc::XmlRpcValue::operator std::string & ( )
inline

Definition at line 94 of file XmlRpcValue.h.

◆ operator struct tm &()

XmlRpc::XmlRpcValue::operator struct tm & ( )
inline

Definition at line 96 of file XmlRpcValue.h.

◆ operator!=()

bool XmlRpc::XmlRpcValue::operator!= ( XmlRpcValue const &  other) const

Definition at line 204 of file XmlRpcValue.cpp.

◆ operator=() [1/5]

XmlRpcValue & XmlRpc::XmlRpcValue::operator= ( XmlRpcValue const &  rhs)

Definition at line 137 of file XmlRpcValue.cpp.

◆ operator=() [2/5]

XmlRpcValue& XmlRpc::XmlRpcValue::operator= ( bool const &  rhs)
inline

Definition at line 83 of file XmlRpcValue.h.

◆ operator=() [3/5]

XmlRpcValue& XmlRpc::XmlRpcValue::operator= ( int const &  rhs)
inline

Definition at line 84 of file XmlRpcValue.h.

◆ operator=() [4/5]

XmlRpcValue& XmlRpc::XmlRpcValue::operator= ( double const &  rhs)
inline

Definition at line 85 of file XmlRpcValue.h.

◆ operator=() [5/5]

XmlRpcValue& XmlRpc::XmlRpcValue::operator= ( const char *  rhs)
inline

Definition at line 86 of file XmlRpcValue.h.

◆ operator==()

bool XmlRpc::XmlRpcValue::operator== ( XmlRpcValue const &  other) const

Definition at line 166 of file XmlRpcValue.cpp.

◆ operator[]() [1/6]

XmlRpcValue const& XmlRpc::XmlRpcValue::operator[] ( int  i) const
inline

Definition at line 105 of file XmlRpcValue.h.

◆ operator[]() [2/6]

XmlRpcValue& XmlRpc::XmlRpcValue::operator[] ( int  i)
inline

Definition at line 106 of file XmlRpcValue.h.

◆ operator[]() [3/6]

XmlRpcValue& XmlRpc::XmlRpcValue::operator[] ( std::string const &  k) const
inline

Definition at line 108 of file XmlRpcValue.h.

◆ operator[]() [4/6]

XmlRpcValue& XmlRpc::XmlRpcValue::operator[] ( std::string const &  k)
inline

Definition at line 109 of file XmlRpcValue.h.

◆ operator[]() [5/6]

XmlRpcValue& XmlRpc::XmlRpcValue::operator[] ( const char *  k) const
inline

Definition at line 110 of file XmlRpcValue.h.

◆ operator[]() [6/6]

XmlRpcValue& XmlRpc::XmlRpcValue::operator[] ( const char *  k)
inline

Definition at line 111 of file XmlRpcValue.h.

◆ setDoubleFormat()

static void XmlRpc::XmlRpcValue::setDoubleFormat ( const char *  f)
inlinestatic

Specify the format used to write double values.

Definition at line 149 of file XmlRpcValue.h.

◆ setSize()

void XmlRpc::XmlRpcValue::setSize ( int  size)
inline

Specify the size for array values. Array values will grow beyond this size if needed.

Definition at line 130 of file XmlRpcValue.h.

◆ size()

int XmlRpc::XmlRpcValue::size ( ) const

Return the size for string, base64, array, and struct values.

Definition at line 211 of file XmlRpcValue.cpp.

◆ stringFromXml()

bool XmlRpc::XmlRpcValue::stringFromXml ( std::string const &  valueXml,
int *  offset 
)
protected

Definition at line 397 of file XmlRpcValue.cpp.

◆ stringToXml()

std::string XmlRpc::XmlRpcValue::stringToXml ( ) const
protected

Definition at line 409 of file XmlRpcValue.cpp.

◆ structFromXml()

bool XmlRpc::XmlRpcValue::structFromXml ( std::string const &  valueXml,
int *  offset 
)
protected

Definition at line 564 of file XmlRpcValue.cpp.

◆ structToXml()

std::string XmlRpc::XmlRpcValue::structToXml ( ) const
protected

Definition at line 589 of file XmlRpcValue.cpp.

◆ timeFromXml()

bool XmlRpc::XmlRpcValue::timeFromXml ( std::string const &  valueXml,
int *  offset 
)
protected

Definition at line 420 of file XmlRpcValue.cpp.

◆ timeToXml()

std::string XmlRpc::XmlRpcValue::timeToXml ( ) const
protected

Definition at line 443 of file XmlRpcValue.cpp.

◆ toXml()

std::string XmlRpc::XmlRpcValue::toXml ( ) const

Encode the Value in xml.

Definition at line 277 of file XmlRpcValue.cpp.

◆ valid()

bool XmlRpc::XmlRpcValue::valid ( ) const
inline

Return true if the value has been set to something.

Definition at line 121 of file XmlRpcValue.h.

◆ write()

std::ostream & XmlRpc::XmlRpcValue::write ( std::ostream &  os) const

Write the value (no xml encoding)

Definition at line 612 of file XmlRpcValue.cpp.

Member Data Documentation

◆ _doubleFormat

std::string XmlRpc::XmlRpcValue::_doubleFormat
staticprotected

Definition at line 185 of file XmlRpcValue.h.

◆ _type

Type XmlRpc::XmlRpcValue::_type
protected

Definition at line 188 of file XmlRpcValue.h.

◆ _value

union { ... } XmlRpc::XmlRpcValue::_value

◆ asArray

ValueArray* XmlRpc::XmlRpcValue::asArray

Definition at line 199 of file XmlRpcValue.h.

◆ asBinary

BinaryData* XmlRpc::XmlRpcValue::asBinary

Definition at line 198 of file XmlRpcValue.h.

◆ asBool

bool XmlRpc::XmlRpcValue::asBool

Definition at line 193 of file XmlRpcValue.h.

◆ asDouble

double XmlRpc::XmlRpcValue::asDouble

Definition at line 195 of file XmlRpcValue.h.

◆ asInt

int XmlRpc::XmlRpcValue::asInt

Definition at line 194 of file XmlRpcValue.h.

◆ asString

std::string* XmlRpc::XmlRpcValue::asString

Definition at line 197 of file XmlRpcValue.h.

◆ asStruct

ValueStruct* XmlRpc::XmlRpcValue::asStruct

Definition at line 200 of file XmlRpcValue.h.

◆ asTime

struct tm* XmlRpc::XmlRpcValue::asTime

Definition at line 196 of file XmlRpcValue.h.


The documentation for this class was generated from the following files:


xmlrpcpp
Author(s): Chris Morley, Konstantin Pilipchuk, Morgan Quigley, Austin Hendrix, Dirk Thomas
autogenerated on Mon Feb 28 2022 23:33:22