XmlRpc::XmlRpcValue Class Reference

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

#include <XmlRpcValue.h>

List of all members.

Public Types

enum  Type {
  TypeInvalid, TypeBoolean, TypeInt, TypeDouble,
  TypeString, TypeDateTime, TypeBase64, TypeArray,
  TypeStruct
}
typedef std::vector< char > BinaryData
typedef std::vector< XmlRpcValueValueArray
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.
XmlRpcValueoperator= (XmlRpcValue const &rhs)
XmlRpcValueoperator= (int const &rhs)
XmlRpcValueoperator= (double const &rhs)
XmlRpcValueoperator= (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
XmlRpcValueoperator[] (int i)
XmlRpcValueoperator[] (std::string const &k)
XmlRpcValueoperator[] (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


Detailed Description

RPC method arguments and results are represented by Values.

Member Function Documentation

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

Return the type of the value stored.

See also:
Type.


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

Generated on Sat Oct 18 22:40:05 2008 for XmlRpc++ by  doxygen 1.5.5