$search

XmlRpc::XmlRpcValue Class Reference

RPC method arguments and results are represented by Values. More...

#include <XmlRpcValue.h>

List of all members.

Public Types

typedef std::vector< char > BinaryData
typedef ValueStruct::iterator iterator
enum  Type {
  TypeInvalid, TypeBoolean, TypeInt, TypeDouble,
  TypeString, TypeDateTime, TypeBase64, TypeArray,
  TypeStruct
}
typedef std::vector< XmlRpcValueValueArray
typedef std::map< std::string,
XmlRpcValue
ValueStruct

Public Member Functions

iterator begin ()
void clear ()
 Erase the current value.
iterator end ()
bool fromXml (std::string const &valueXml, int *offset)
 Decode xml. Destroys any existing value.
Type const & getType () const
 Return the type of the value stored.
bool hasMember (const std::string &name) const
 Check for the existence of a struct member by name.
 operator BinaryData & ()
 operator bool & ()
 operator double & ()
 operator int & ()
 operator std::string & ()
 operator struct tm & ()
bool operator!= (XmlRpcValue const &other) const
XmlRpcValueoperator= (const char *rhs)
XmlRpcValueoperator= (double const &rhs)
XmlRpcValueoperator= (int const &rhs)
XmlRpcValueoperator= (XmlRpcValue const &rhs)
bool operator== (XmlRpcValue const &other) const
XmlRpcValueoperator[] (const char *k)
XmlRpcValueoperator[] (std::string const &k)
XmlRpcValueoperator[] (int i)
XmlRpcValue const & operator[] (int i) const
void setSize (int size)
 Specify the size for array values. Array values will grow beyond this size if needed.
int size () const
 Return the size for string, base64, array, and struct values.
std::string toXml () const
 Encode the Value in xml.
bool valid () const
 Return true if the value has been set to something.
std::ostream & write (std::ostream &os) const
 Write the value (no xml encoding).
 XmlRpcValue (XmlRpcValue const &rhs)
 Copy.
 XmlRpcValue (std::string const &xml, int *offset)
 Construct from xml, beginning at *offset chars into the string, updates offset.
 XmlRpcValue (void *value, int nBytes)
 XmlRpcValue (struct tm *value)
 XmlRpcValue (const char *value)
 XmlRpcValue (std::string const &value)
 XmlRpcValue (double value)
 XmlRpcValue (int value)
 XmlRpcValue (bool value)
 XmlRpcValue ()
 Constructors.
 ~XmlRpcValue ()
 Destructor (make virtual if you want to subclass).

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

bool arrayFromXml (std::string const &valueXml, int *offset)
std::string arrayToXml () const
void assertArray (int size)
void assertArray (int size) 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

Detailed Description

RPC method arguments and results are represented by Values.

Definition at line 24 of file XmlRpcValue.h.


Member Typedef Documentation

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

Definition at line 41 of file XmlRpcValue.h.

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

Definition at line 44 of file XmlRpcValue.h.

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.


Member Enumeration Documentation

Enumerator:
TypeInvalid 
TypeBoolean 
TypeInt 
TypeDouble 
TypeString 
TypeDateTime 
TypeBase64 
TypeArray 
TypeStruct 

Definition at line 28 of file XmlRpcValue.h.


Constructor & Destructor Documentation

XmlRpc::XmlRpcValue::XmlRpcValue (  )  [inline]

Constructors.

Definition at line 48 of file XmlRpcValue.h.

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

Definition at line 49 of file XmlRpcValue.h.

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

Definition at line 50 of file XmlRpcValue.h.

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

Definition at line 51 of file XmlRpcValue.h.

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

Definition at line 53 of file XmlRpcValue.h.

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

Definition at line 56 of file XmlRpcValue.h.

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

Definition at line 59 of file XmlRpcValue.h.

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

Definition at line 63 of file XmlRpcValue.h.

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.

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

Copy.

Definition at line 73 of file XmlRpcValue.h.

XmlRpc::XmlRpcValue::~XmlRpcValue (  )  [inline]

Destructor (make virtual if you want to subclass).

Definition at line 76 of file XmlRpcValue.h.


Member Function Documentation

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

Definition at line 475 of file XmlRpcValue.cpp.

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

Definition at line 494 of file XmlRpcValue.cpp.

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

Definition at line 88 of file XmlRpcValue.cpp.

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

Definition at line 79 of file XmlRpcValue.cpp.

void XmlRpc::XmlRpcValue::assertStruct (  )  [protected]

Definition at line 100 of file XmlRpcValue.cpp.

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

Definition at line 61 of file XmlRpcValue.cpp.

iterator XmlRpc::XmlRpcValue::begin (  )  [inline]

Definition at line 103 of file XmlRpcValue.h.

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

Definition at line 433 of file XmlRpcValue.cpp.

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

Definition at line 455 of file XmlRpcValue.cpp.

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

Definition at line 267 of file XmlRpcValue.cpp.

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

Definition at line 281 of file XmlRpcValue.cpp.

void XmlRpc::XmlRpcValue::clear (  )  [inline]

Erase the current value.

Definition at line 79 of file XmlRpcValue.h.

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

Definition at line 320 of file XmlRpcValue.cpp.

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

Definition at line 352 of file XmlRpcValue.cpp.

iterator XmlRpc::XmlRpcValue::end (  )  [inline]

Definition at line 104 of file XmlRpcValue.h.

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

Decode xml. Destroys any existing value.

Definition at line 206 of file XmlRpcValue.cpp.

static std::string const& XmlRpc::XmlRpcValue::getDoubleFormat (  )  [inline, static]

Return the format used to write double values.

Definition at line 133 of file XmlRpcValue.h.

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

Return the type of the value stored.

See also:
Type.

Definition at line 111 of file XmlRpcValue.h.

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

Check for the existence of a struct member by name.

Definition at line 199 of file XmlRpcValue.cpp.

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

Definition at line 292 of file XmlRpcValue.cpp.

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

Definition at line 306 of file XmlRpcValue.cpp.

void XmlRpc::XmlRpcValue::invalidate (  )  [protected]

Definition at line 45 of file XmlRpcValue.cpp.

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

Definition at line 94 of file XmlRpcValue.h.

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

Definition at line 90 of file XmlRpcValue.h.

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

Definition at line 92 of file XmlRpcValue.h.

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

Definition at line 91 of file XmlRpcValue.h.

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

Definition at line 93 of file XmlRpcValue.h.

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

Definition at line 95 of file XmlRpcValue.h.

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

Definition at line 178 of file XmlRpcValue.cpp.

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

Definition at line 85 of file XmlRpcValue.h.

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

Definition at line 84 of file XmlRpcValue.h.

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

Definition at line 83 of file XmlRpcValue.h.

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

Definition at line 111 of file XmlRpcValue.cpp.

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

Definition at line 140 of file XmlRpcValue.cpp.

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

Definition at line 101 of file XmlRpcValue.h.

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

Definition at line 100 of file XmlRpcValue.h.

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

Definition at line 98 of file XmlRpcValue.h.

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

Definition at line 97 of file XmlRpcValue.h.

static void XmlRpc::XmlRpcValue::setDoubleFormat ( const char *  f  )  [inline, static]

Specify the format used to write double values.

Definition at line 136 of file XmlRpcValue.h.

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 117 of file XmlRpcValue.h.

int XmlRpc::XmlRpcValue::size (  )  const

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

Definition at line 185 of file XmlRpcValue.cpp.

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

Definition at line 369 of file XmlRpcValue.cpp.

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

Definition at line 381 of file XmlRpcValue.cpp.

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

Definition at line 512 of file XmlRpcValue.cpp.

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

Definition at line 537 of file XmlRpcValue.cpp.

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

Definition at line 392 of file XmlRpcValue.cpp.

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

Definition at line 415 of file XmlRpcValue.cpp.

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

Encode the Value in xml.

Definition at line 249 of file XmlRpcValue.cpp.

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

Return true if the value has been set to something.

Definition at line 108 of file XmlRpcValue.h.

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

Write the value (no xml encoding).

Definition at line 560 of file XmlRpcValue.cpp.


Member Data Documentation

std::string XmlRpc::XmlRpcValue::_doubleFormat [static, protected]

Definition at line 170 of file XmlRpcValue.h.

Definition at line 173 of file XmlRpcValue.h.

union { ... } XmlRpc::XmlRpcValue::_value [protected]

Definition at line 184 of file XmlRpcValue.h.

Definition at line 183 of file XmlRpcValue.h.

Definition at line 178 of file XmlRpcValue.h.

Definition at line 180 of file XmlRpcValue.h.

Definition at line 179 of file XmlRpcValue.h.

Definition at line 182 of file XmlRpcValue.h.

Definition at line 185 of file XmlRpcValue.h.

Definition at line 181 of file XmlRpcValue.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


xmlrpcpp
Author(s): Chris Morley and Konstantin Pilipchuk, slight modifications and ROS wrapping by Morgan Quigley
autogenerated on Sat Mar 2 13:22:54 2013