Main Page   Class Hierarchy   Compound List   File List   Compound Members  

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 std::vector< XmlRpcValue > ValueArray
typedef std::map< std::string,
XmlRpcValue > 
ValueStruct
enum  Type {
  TypeInvalid, TypeBoolean, TypeInt, TypeDouble,
  TypeString, TypeDateTime, TypeBase64, TypeArray,
  TypeStruct
}

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.
See also:
Type.


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

std::string const & getDoubleFormat ()
 Return the format used to write double values.

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
   tm *   asTime
   std::string *   asString
   BinaryData *   asBinary
   ValueArray *   asArray
   ValueStruct *   asStruct
_value

Static Protected Attributes

std::string _doubleFormat


Detailed Description

RPC method arguments and results are represented by Values.


The documentation for this class was generated from the following files:
Generated on Thu Mar 6 11:32:58 2003 for XmlRpc++ by doxygen1.3-rc3