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

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

#include <XmlLocalValue.h>

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, XmlRpcValueValueStruct
 

Public Member Functions

iterator begin ()
 
void clear ()
 Erase the current value. More...
 
iterator end ()
 
bool fromXml (std::string const &valueXml, int *offset)
 Decode xml. Destroys any existing value. More...
 
const TypegetType () 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 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[] (int i)
 
XmlRpcValue constoperator[] (int i) const
 
XmlRpcValueoperator[] (std::string const &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 (const char *value)
 
 XmlRpcValue (double value)
 
 XmlRpcValue (int value)
 
 XmlRpcValue (std::string const &value)
 
 XmlRpcValue (std::string const &xml, int *offset)
 Construct from xml, beginning at *offset chars into the string, updates offset. More...
 
 XmlRpcValue (struct tm *value)
 
 XmlRpcValue (void *value, int nBytes)
 
 XmlRpcValue (XmlRpcValue const &rhs)
 Copy. More...
 
 ~XmlRpcValue ()
 Destructor (make virtual if you want to subclass) More...
 

Static Public Member Functions

static std::string constgetDoubleFormat ()
 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)
 
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 25 of file XmlLocalValue.h.

Member Typedef Documentation

◆ BinaryData

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

Definition at line 42 of file XmlLocalValue.h.

◆ iterator

typedef ValueStruct::iterator XmlLocal::XmlRpcValue::iterator

Definition at line 45 of file XmlLocalValue.h.

◆ ValueArray

Definition at line 43 of file XmlLocalValue.h.

◆ ValueStruct

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

Definition at line 44 of file XmlLocalValue.h.

Member Enumeration Documentation

◆ Type

Enumerator
TypeInvalid 
TypeBoolean 
TypeInt 
TypeDouble 
TypeString 
TypeDateTime 
TypeBase64 
TypeArray 
TypeStruct 

Definition at line 29 of file XmlLocalValue.h.

Constructor & Destructor Documentation

◆ XmlRpcValue() [1/10]

XmlLocal::XmlRpcValue::XmlRpcValue ( )
inline

Constructors.

Definition at line 49 of file XmlLocalValue.h.

◆ XmlRpcValue() [2/10]

XmlLocal::XmlRpcValue::XmlRpcValue ( bool  value)
inline

Definition at line 50 of file XmlLocalValue.h.

◆ XmlRpcValue() [3/10]

XmlLocal::XmlRpcValue::XmlRpcValue ( int  value)
inline

Definition at line 51 of file XmlLocalValue.h.

◆ XmlRpcValue() [4/10]

XmlLocal::XmlRpcValue::XmlRpcValue ( double  value)
inline

Definition at line 52 of file XmlLocalValue.h.

◆ XmlRpcValue() [5/10]

XmlLocal::XmlRpcValue::XmlRpcValue ( std::string const value)
inline

Definition at line 54 of file XmlLocalValue.h.

◆ XmlRpcValue() [6/10]

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

Definition at line 59 of file XmlLocalValue.h.

◆ XmlRpcValue() [7/10]

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

Definition at line 64 of file XmlLocalValue.h.

◆ XmlRpcValue() [8/10]

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

Definition at line 70 of file XmlLocalValue.h.

◆ XmlRpcValue() [9/10]

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

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

Definition at line 76 of file XmlLocalValue.h.

◆ XmlRpcValue() [10/10]

XmlLocal::XmlRpcValue::XmlRpcValue ( XmlRpcValue const rhs)
inline

Copy.

Definition at line 82 of file XmlLocalValue.h.

◆ ~XmlRpcValue()

XmlLocal::XmlRpcValue::~XmlRpcValue ( )
inline

Destructor (make virtual if you want to subclass)

Definition at line 85 of file XmlLocalValue.h.

Member Function Documentation

◆ arrayFromXml()

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

◆ arrayToXml()

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

◆ assertArray() [1/2]

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

◆ assertArray() [2/2]

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

◆ assertStruct()

void XmlLocal::XmlRpcValue::assertStruct ( )
protected

◆ assertTypeOrInvalid()

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

◆ begin()

iterator XmlLocal::XmlRpcValue::begin ( )
inline

Definition at line 112 of file XmlLocalValue.h.

◆ binaryFromXml()

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

◆ binaryToXml()

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

◆ boolFromXml()

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

◆ boolToXml()

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

◆ clear()

void XmlLocal::XmlRpcValue::clear ( )
inline

Erase the current value.

Definition at line 88 of file XmlLocalValue.h.

◆ doubleFromXml()

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

◆ doubleToXml()

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

◆ end()

iterator XmlLocal::XmlRpcValue::end ( )
inline

Definition at line 113 of file XmlLocalValue.h.

◆ fromXml()

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

Decode xml. Destroys any existing value.

◆ getDoubleFormat()

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

Return the format used to write double values.

Definition at line 142 of file XmlLocalValue.h.

◆ getType()

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

Return the type of the value stored.

See also
Type.

Definition at line 120 of file XmlLocalValue.h.

◆ hasMember()

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

Check for the existence of a struct member by name.

◆ intFromXml()

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

◆ intToXml()

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

◆ invalidate()

void XmlLocal::XmlRpcValue::invalidate ( )
protected

◆ operator BinaryData &()

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

Definition at line 103 of file XmlLocalValue.h.

◆ operator bool &()

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

Definition at line 99 of file XmlLocalValue.h.

◆ operator double &()

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

Definition at line 101 of file XmlLocalValue.h.

◆ operator int &()

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

Definition at line 100 of file XmlLocalValue.h.

◆ operator std::string &()

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

Definition at line 102 of file XmlLocalValue.h.

◆ operator struct tm &()

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

Definition at line 104 of file XmlLocalValue.h.

◆ operator!=()

bool XmlLocal::XmlRpcValue::operator!= ( XmlRpcValue const other) const

◆ operator=() [1/4]

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

Definition at line 94 of file XmlLocalValue.h.

◆ operator=() [2/4]

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

Definition at line 93 of file XmlLocalValue.h.

◆ operator=() [3/4]

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

Definition at line 92 of file XmlLocalValue.h.

◆ operator=() [4/4]

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

◆ operator==()

bool XmlLocal::XmlRpcValue::operator== ( XmlRpcValue const other) const

◆ operator[]() [1/4]

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

Definition at line 110 of file XmlLocalValue.h.

◆ operator[]() [2/4]

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

Definition at line 107 of file XmlLocalValue.h.

◆ operator[]() [3/4]

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

Definition at line 106 of file XmlLocalValue.h.

◆ operator[]() [4/4]

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

Definition at line 109 of file XmlLocalValue.h.

◆ setDoubleFormat()

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

Specify the format used to write double values.

Definition at line 145 of file XmlLocalValue.h.

◆ setSize()

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

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

Definition at line 126 of file XmlLocalValue.h.

◆ size()

int XmlLocal::XmlRpcValue::size ( ) const

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

◆ stringFromXml()

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

◆ stringToXml()

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

◆ structFromXml()

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

◆ structToXml()

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

◆ timeFromXml()

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

◆ timeToXml()

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

◆ toXml()

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

Encode the Value in xml.

◆ valid()

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

Return true if the value has been set to something.

Definition at line 117 of file XmlLocalValue.h.

◆ write()

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

Write the value (no xml encoding)

Member Data Documentation

◆ _doubleFormat

std::string XmlLocal::XmlRpcValue::_doubleFormat
staticprotected

Definition at line 179 of file XmlLocalValue.h.

◆ _type

Type XmlLocal::XmlRpcValue::_type
protected

Definition at line 182 of file XmlLocalValue.h.

◆ _value

union { ... } XmlLocal::XmlRpcValue::_value

◆ asArray

ValueArray* XmlLocal::XmlRpcValue::asArray

Definition at line 193 of file XmlLocalValue.h.

◆ asBinary

BinaryData* XmlLocal::XmlRpcValue::asBinary

Definition at line 192 of file XmlLocalValue.h.

◆ asBool

bool XmlLocal::XmlRpcValue::asBool

Definition at line 187 of file XmlLocalValue.h.

◆ asDouble

double XmlLocal::XmlRpcValue::asDouble

Definition at line 189 of file XmlLocalValue.h.

◆ asInt

int XmlLocal::XmlRpcValue::asInt

Definition at line 188 of file XmlLocalValue.h.

◆ asString

std::string* XmlLocal::XmlRpcValue::asString

Definition at line 191 of file XmlLocalValue.h.

◆ asStruct

ValueStruct* XmlLocal::XmlRpcValue::asStruct

Definition at line 194 of file XmlLocalValue.h.

◆ asTime

struct tm* XmlLocal::XmlRpcValue::asTime

Definition at line 190 of file XmlLocalValue.h.


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


sick_scan_xd
Author(s): Michael Lehning , Jochen Sprickerhof , Martin Günther
autogenerated on Fri Oct 25 2024 02:47:22