ulxr::Value Class Reference

Abstraction of an XML RPC parameter. More...

#include <ulxr_value.h>

Collaboration diagram for ulxr::Value:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Value ()
 Creates an empty Value.
 Value (const Value &val)
 Creates a Value as duplicate of another Value.
 Value (const Boolean &val)
 Creates a value from a Boolean.
 Value (const Integer &val)
 Creates a value from an Integer.
 Value (const Double &val)
 Creates a value from a Double.
 Value (const Array &val)
 Creates a value from an Array.
 Value (const Struct &val)
 Creates a value from a Struct.
 Value (const RpcString &val)
 Creates a value from a RpcString.
 Value (const Base64 &val)
 Creates a value from a Base64.
 Value (const DateTime &val)
 Creates a value from a DateTime.
 Value (const char *val)
 Creates a value from a const char*.
 Value (const wchar_t *val)
 Creates a value from a const wchar_t*.
 Value (const double &val)
 Creates a value from a double.
 Value (const int &val)
 Creates a value from an int.
 Value (const bool &val)
 Creates a value from a bool.
virtual ~Value ()
 Destroys the Value.
Valueoperator= (const Value &val)
 Creates a Value as copy of another Value.
CppString getSignature (bool deep=false) const
 Returns the signature of value.
virtual std::string getWbXml () const
 Returns the call as binary xml string.
CppString getXml (int indent=0) const
 Returns the value as xml string.
 operator Void & ()
 Converts the Value into a Void.
 operator const Void & () const
 Converts the Value into a Void.
 operator Boolean & ()
 Converts the Value into a Boolean.
 operator const Boolean & () const
 Converts the Value into a Boolean.
 operator Integer & ()
 Converts the Value into an Integer.
 operator const Integer & () const
 Converts the Value into an Integer.
 operator Double & ()
 Converts the Value into a Double.
 operator const Double & () const
 Converts the Value into a Double.
 operator Array & ()
 Converts the Value into an Array.
 operator const Array & () const
 Converts the Value into an Array.
 operator Struct & ()
 Converts the Value into a Struct.
 operator const Struct & () const
 Converts the Value into a Struct.
 operator RpcString & ()
 Converts the Value into a RpcString.
 operator const RpcString & () const
 Converts the Value into a RpcString.
 operator Base64 & ()
 Converts the Value into a Base64.
 operator const Base64 & () const
 Converts the Value into a Base64.
 operator DateTime & ()
 Converts the Value into a DateTime.
 operator const DateTime & () const
 Converts the Value into a DateTime.
StructgetStruct ()
 Converts the Value into a Struct.
const StructgetStruct () const
 Converts the Value into a Struct.
ArraygetArray ()
 Converts the Value into an Array.
const ArraygetArray () const
 Converts the Value into an Array.
bool isBoolean () const
 Determines if the Value is of type Boolean.
bool isVoid () const
 Determines if the Value is of type Void.
bool isInteger () const
 Determines if the Value is of type Integer.
bool isDouble () const
 Determines if the Value is of type Double.
bool isArray () const
 Determines if the Value is of type Array.
bool isStruct () const
 Determines if the Value is of type Struct.
bool isString () const
 Determines if the Value is of type RpcString.
bool isBase64 () const
 Determines if the Value is of type Base64.
bool isDateTime () const
 Determines if the Value is of type DateTime.
ValueType getType () const
 Returns the type of the Value.
CppString getTypeName () const
 Returns the C++-name of the ValueType.

Private Attributes

union {
   ValueBase *   baseVal
   Void *   voidVal
   Boolean *   boolVal
   Integer *   intVal
   Double *   doubleVal
   Array *   arrayVal
   Struct *   structVal
   RpcString *   stringVal
   Base64 *   base64Val
   DateTime *   dateVal
}; 

Detailed Description

Abstraction of an XML RPC parameter.

Parameters are passed to and returned by method calls.

Definition at line 70 of file ulxr_value.h.


Constructor & Destructor Documentation

ulxr::Value::Value (  ) 

Creates an empty Value.

Definition at line 312 of file ulxr_value.cpp.

References voidVal.

ulxr::Value::Value ( const Value val  ) 

Creates a Value as duplicate of another Value.

Parameters:
val the source value

Definition at line 318 of file ulxr_value.cpp.

References baseVal, and ulxr::ValueBase::cloneValue().

ulxr::Value::Value ( const Boolean val  ) 

Creates a value from a Boolean.

Parameters:
val the source value

Definition at line 324 of file ulxr_value.cpp.

References boolVal.

ulxr::Value::Value ( const Integer val  ) 

Creates a value from an Integer.

Parameters:
val the source value

Definition at line 330 of file ulxr_value.cpp.

References intVal.

ulxr::Value::Value ( const Double val  ) 

Creates a value from a Double.

Parameters:
val the source value

Definition at line 336 of file ulxr_value.cpp.

References doubleVal.

ulxr::Value::Value ( const Array val  ) 

Creates a value from an Array.

Parameters:
val the source value

Definition at line 342 of file ulxr_value.cpp.

References arrayVal.

ulxr::Value::Value ( const Struct val  ) 

Creates a value from a Struct.

Parameters:
val the source value

Definition at line 348 of file ulxr_value.cpp.

References structVal.

ulxr::Value::Value ( const RpcString val  ) 

Creates a value from a RpcString.

Parameters:
val the source value

Definition at line 354 of file ulxr_value.cpp.

References stringVal.

ulxr::Value::Value ( const Base64 val  ) 

Creates a value from a Base64.

Parameters:
val the source value

Definition at line 360 of file ulxr_value.cpp.

References base64Val.

ulxr::Value::Value ( const DateTime val  ) 

Creates a value from a DateTime.

Parameters:
val the source value

Definition at line 367 of file ulxr_value.cpp.

References dateVal.

ulxr::Value::Value ( const char *  val  ) 

Creates a value from a const char*.

Parameters:
val the source value

Definition at line 376 of file ulxr_value.cpp.

References stringVal.

ulxr::Value::Value ( const wchar_t *  val  ) 

Creates a value from a const wchar_t*.

Parameters:
val the source value

Definition at line 384 of file ulxr_value.cpp.

References stringVal, and ulxr::unicodeToUtf8().

ulxr::Value::Value ( const double &  val  ) 

Creates a value from a double.

Parameters:
val the source value

Definition at line 393 of file ulxr_value.cpp.

References doubleVal.

ulxr::Value::Value ( const int &  val  ) 

Creates a value from an int.

Parameters:
val the source value

Definition at line 399 of file ulxr_value.cpp.

References intVal.

ulxr::Value::Value ( const bool &  val  ) 

Creates a value from a bool.

Parameters:
val the source value

Definition at line 405 of file ulxr_value.cpp.

References boolVal.

ulxr::Value::~Value (  )  [virtual]

Destroys the Value.

Definition at line 423 of file ulxr_value.cpp.

References baseVal.


Member Function Documentation

Value & ulxr::Value::operator= ( const Value val  ) 

Creates a Value as copy of another Value.

Parameters:
val the source value

Definition at line 414 of file ulxr_value.cpp.

CppString ulxr::Value::getSignature ( bool  deep = false  )  const

Returns the signature of value.

The signature consists of its type name.

Parameters:
deep if nested types exist, include them
Returns:
The signature

Definition at line 145 of file ulxr_value.cpp.

Referenced by ulxr::Signature::addParam().

std::string ulxr::Value::getWbXml (  )  const [virtual]

Returns the call as binary xml string.

The method call is converted to a wbxml sequence. It is prepended with the necessary xml procession instruction with version and encoding set to UTF-8.

Returns:
The wbxml content

Definition at line 163 of file ulxr_value.cpp.

CppString ulxr::Value::getXml ( int  indent = 0  )  const

Returns the value as xml string.

The content and its type name is converted to an xml text. The structure of the text is indented to facilitate easy reading of larger blocks.

Parameters:
indent current indentation level
Returns:
The xml content

Definition at line 154 of file ulxr_value.cpp.

ulxr::Value::operator Void & (  ) 

Converts the Value into a Void.

If the type does not match exactly a RuntimeException is thrown.

Returns:
the converted Value.

ulxr::Value::operator const Void & (  )  const

Converts the Value into a Void.

If the type does not match exactly a RuntimeException is thrown.

Returns:
the converted Value.

ulxr::Value::operator Boolean & (  ) 

Converts the Value into a Boolean.

If the type does not match exactly a RuntimeException is thrown.

Returns:
the converted Value.

Definition at line 200 of file ulxr_value.cpp.

References boolVal, ulxr::RpcBoolean, and ULXR_ASSERT_RPCTYPE.

ulxr::Value::operator const Boolean & (  )  const

Converts the Value into a Boolean.

If the type does not match exactly a RuntimeException is thrown.

Returns:
the converted Value.

Definition at line 207 of file ulxr_value.cpp.

References boolVal, ulxr::RpcBoolean, and ULXR_ASSERT_RPCTYPE.

ulxr::Value::operator Integer & (  ) 

Converts the Value into an Integer.

If the type does not match exactly a RuntimeException is thrown.

Returns:
the converted Value.

Definition at line 214 of file ulxr_value.cpp.

References intVal, ulxr::RpcInteger, and ULXR_ASSERT_RPCTYPE.

ulxr::Value::operator const Integer & (  )  const

Converts the Value into an Integer.

If the type does not match exactly a RuntimeException is thrown.

Returns:
the converted Value.

Definition at line 221 of file ulxr_value.cpp.

References intVal, ulxr::RpcInteger, and ULXR_ASSERT_RPCTYPE.

ulxr::Value::operator Double & (  ) 

Converts the Value into a Double.

If the type does not match exactly a RuntimeException is thrown.

Returns:
the converted Value.

Definition at line 228 of file ulxr_value.cpp.

References doubleVal, ulxr::RpcDouble, and ULXR_ASSERT_RPCTYPE.

ulxr::Value::operator const Double & (  )  const

Converts the Value into a Double.

If the type does not match exactly a RuntimeException is thrown.

Returns:
the converted Value.

Definition at line 235 of file ulxr_value.cpp.

References doubleVal, ulxr::RpcDouble, and ULXR_ASSERT_RPCTYPE.

ulxr::Value::operator Array & (  ) 

Converts the Value into an Array.

If the type does not match exactly a RuntimeException is thrown.

Returns:
the converted Value.

Definition at line 242 of file ulxr_value.cpp.

References arrayVal, ulxr::RpcArray, and ULXR_ASSERT_RPCTYPE.

ulxr::Value::operator const Array & (  )  const

Converts the Value into an Array.

If the type does not match exactly a RuntimeException is thrown.

Returns:
the converted Value.

Definition at line 249 of file ulxr_value.cpp.

References arrayVal, ulxr::RpcArray, and ULXR_ASSERT_RPCTYPE.

ulxr::Value::operator Struct & (  ) 

Converts the Value into a Struct.

If the type does not match exactly a RuntimeException is thrown.

Returns:
the converted Value.

Definition at line 256 of file ulxr_value.cpp.

References ulxr::RpcStruct, structVal, and ULXR_ASSERT_RPCTYPE.

ulxr::Value::operator const Struct & (  )  const

Converts the Value into a Struct.

If the type does not match exactly a RuntimeException is thrown.

Returns:
the converted Value.

Definition at line 263 of file ulxr_value.cpp.

References ulxr::RpcStruct, structVal, and ULXR_ASSERT_RPCTYPE.

ulxr::Value::operator RpcString & (  ) 

Converts the Value into a RpcString.

If the type does not match exactly a RuntimeException is thrown.

Returns:
the converted Value.

Definition at line 270 of file ulxr_value.cpp.

References ulxr::RpcStrType, stringVal, and ULXR_ASSERT_RPCTYPE.

ulxr::Value::operator const RpcString & (  )  const

Converts the Value into a RpcString.

If the type does not match exactly a RuntimeException is thrown.

Returns:
the converted Value.

Definition at line 277 of file ulxr_value.cpp.

References ulxr::RpcStrType, stringVal, and ULXR_ASSERT_RPCTYPE.

ulxr::Value::operator Base64 & (  ) 

Converts the Value into a Base64.

If the type does not match exactly a RuntimeException is thrown.

Returns:
the converted Value.

Definition at line 284 of file ulxr_value.cpp.

References base64Val, ulxr::RpcBase64, and ULXR_ASSERT_RPCTYPE.

ulxr::Value::operator const Base64 & (  )  const

Converts the Value into a Base64.

If the type does not match exactly a RuntimeException is thrown.

Returns:
the converted Value.

Definition at line 291 of file ulxr_value.cpp.

References base64Val, ulxr::RpcBase64, and ULXR_ASSERT_RPCTYPE.

ulxr::Value::operator DateTime & (  ) 

Converts the Value into a DateTime.

If the type does not match exactly a RuntimeException is thrown.

Returns:
the converted Value.

Definition at line 298 of file ulxr_value.cpp.

References dateVal, ulxr::RpcDateTime, and ULXR_ASSERT_RPCTYPE.

ulxr::Value::operator const DateTime & (  )  const

Converts the Value into a DateTime.

If the type does not match exactly a RuntimeException is thrown.

Returns:
the converted Value.

Definition at line 305 of file ulxr_value.cpp.

References dateVal, ulxr::RpcDateTime, and ULXR_ASSERT_RPCTYPE.

Struct * ulxr::Value::getStruct (  ) 

Converts the Value into a Struct.

If the type does not match exactly a RuntimeException is thrown.

Returns:
a pointer to the converted Value.

Definition at line 172 of file ulxr_value.cpp.

References ulxr::RpcStruct, and ULXR_ASSERT_RPCTYPE.

const Struct * ulxr::Value::getStruct (  )  const

Converts the Value into a Struct.

If the type does not match exactly a RuntimeException is thrown.

Returns:
a pointer to the converted Value.

Definition at line 179 of file ulxr_value.cpp.

References ulxr::RpcStruct, and ULXR_ASSERT_RPCTYPE.

Array * ulxr::Value::getArray (  ) 

Converts the Value into an Array.

If the type does not match exactly a RuntimeException is thrown.

Returns:
the converted Value.

Definition at line 186 of file ulxr_value.cpp.

References ulxr::RpcArray, and ULXR_ASSERT_RPCTYPE.

const Array * ulxr::Value::getArray (  )  const

Converts the Value into an Array.

If the type does not match exactly a RuntimeException is thrown.

Returns:
the converted Value.

Definition at line 193 of file ulxr_value.cpp.

References ulxr::RpcArray, and ULXR_ASSERT_RPCTYPE.

bool ulxr::Value::isBoolean (  )  const

Determines if the Value is of type Boolean.

Returns:
true if the type is correct.

Definition at line 85 of file ulxr_value.cpp.

bool ulxr::Value::isVoid (  )  const

Determines if the Value is of type Void.

Returns:
true if the type is correct.

Definition at line 79 of file ulxr_value.cpp.

bool ulxr::Value::isInteger (  )  const

Determines if the Value is of type Integer.

Returns:
true if the type is correct.

Definition at line 91 of file ulxr_value.cpp.

bool ulxr::Value::isDouble (  )  const

Determines if the Value is of type Double.

Returns:
true if the type is correct.

Definition at line 97 of file ulxr_value.cpp.

bool ulxr::Value::isArray (  )  const

Determines if the Value is of type Array.

Returns:
true if the type is correct.

Definition at line 103 of file ulxr_value.cpp.

bool ulxr::Value::isStruct (  )  const

Determines if the Value is of type Struct.

Returns:
true if the type is correct.

Definition at line 109 of file ulxr_value.cpp.

bool ulxr::Value::isString (  )  const

Determines if the Value is of type RpcString.

Returns:
true if the type is correct.

Definition at line 115 of file ulxr_value.cpp.

bool ulxr::Value::isBase64 (  )  const

Determines if the Value is of type Base64.

Returns:
true if the type is correct.

Definition at line 121 of file ulxr_value.cpp.

bool ulxr::Value::isDateTime (  )  const

Determines if the Value is of type DateTime.

Returns:
true if the type is correct.

Definition at line 127 of file ulxr_value.cpp.

ValueType ulxr::Value::getType (  )  const

Returns the type of the Value.

Returns:
value type

Definition at line 133 of file ulxr_value.cpp.

CppString ulxr::Value::getTypeName (  )  const

Returns the C++-name of the ValueType.

Returns:
type name

Definition at line 139 of file ulxr_value.cpp.


Member Data Documentation

ValueBase* ulxr::Value::baseVal [private]

Definition at line 375 of file ulxr_value.h.

Referenced by Value(), and ~Value().

Void* ulxr::Value::voidVal [private]

Definition at line 376 of file ulxr_value.h.

Referenced by Value().

Boolean* ulxr::Value::boolVal [private]

Definition at line 378 of file ulxr_value.h.

Referenced by operator Boolean &(), operator const Boolean &(), and Value().

Integer* ulxr::Value::intVal [private]

Definition at line 379 of file ulxr_value.h.

Referenced by operator const Integer &(), operator Integer &(), and Value().

Double* ulxr::Value::doubleVal [private]

Definition at line 380 of file ulxr_value.h.

Referenced by operator const Double &(), operator Double &(), and Value().

Array* ulxr::Value::arrayVal [private]

Definition at line 381 of file ulxr_value.h.

Referenced by operator Array &(), operator const Array &(), and Value().

Struct* ulxr::Value::structVal [private]

Definition at line 382 of file ulxr_value.h.

Referenced by operator const Struct &(), operator Struct &(), and Value().

RpcString* ulxr::Value::stringVal [private]

Definition at line 383 of file ulxr_value.h.

Referenced by operator const RpcString &(), operator RpcString &(), and Value().

Base64* ulxr::Value::base64Val [private]

Definition at line 384 of file ulxr_value.h.

Referenced by operator Base64 &(), operator const Base64 &(), and Value().

DateTime* ulxr::Value::dateVal [private]

Definition at line 385 of file ulxr_value.h.

Referenced by operator const DateTime &(), operator DateTime &(), and Value().

union { ... } [private]


The documentation for this class was generated from the following files:
Generated on Sun Aug 19 20:09:10 2007 for ulxmlrpcpp by  doxygen 1.5.1