ulxr::Array Class Reference
[Value types in an XML-RPC call]

Implementation of a parameter collection. More...

#include <ulxr_value.h>

Inheritance diagram for ulxr::Array:

Inheritance graph
[legend]
Collaboration diagram for ulxr::Array:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Array ()
 Default constructor for an empty Array.
virtual ~Array ()
 Destroys the Value.
void addItem (const Value &item)
 Appends a new array member.
void setItem (unsigned idx, const Value &item)
 Sets a new content of an array member.
Value getItem (unsigned idx)
 Returns a the content of an array member.
unsigned size () const
 Returns the number of array members.
virtual ValueBasecloneValue () const
 Creates a copy of the actual object.
virtual CppString getSignature (bool deep=false) const
 Returns the signature of value.
virtual std::string getWbXml () const
 Returns the call as binary xml string.
virtual CppString getXml (int indent=0) const
 Returns the value as xml string.
void clear ()
 Removes all elements of the Array.

Static Public Member Functions

static CppString getValueName ()
 Returns the xml name of the Value.

Private Attributes

std::vector< Valuevalues

Detailed Description

Implementation of a parameter collection.

An Array can contain an arbitrary amount of values of any type here mentioned, even nested arrays. You access the elements by their index.

Definition at line 828 of file ulxr_value.h.


Constructor & Destructor Documentation

ulxr::Array::Array (  ) 

Default constructor for an empty Array.

Definition at line 1277 of file ulxr_value.cpp.

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

Destroys the Value.

Definition at line 1283 of file ulxr_value.cpp.


Member Function Documentation

void ulxr::Array::addItem ( const Value item  ) 

Appends a new array member.

Parameters:
item the new Value

Definition at line 1382 of file ulxr_value.cpp.

Referenced by ulxr::operator<<(), ulxr::Dispatcher::system_listMethods(), and ulxr::Dispatcher::system_methodSignature().

void ulxr::Array::setItem ( unsigned  idx,
const Value item 
)

Sets a new content of an array member.

Counting starts with "0".

Parameters:
idx index of the desired Value
item the new Value

Definition at line 1388 of file ulxr_value.cpp.

Value ulxr::Array::getItem ( unsigned  idx  ) 

Returns a the content of an array member.

Counting starts with "0".

Parameters:
idx index of the desired Value

Definition at line 1395 of file ulxr_value.cpp.

unsigned ulxr::Array::size (  )  const

Returns the number of array members.

Returns:
the array size

Definition at line 1288 of file ulxr_value.cpp.

Referenced by ulxr::Dispatcher::system_methodSignature().

ValueBase * ulxr::Array::cloneValue (  )  const [virtual]

Creates a copy of the actual object.

Returns:
pointer to the copy

Implements ulxr::ValueBase.

Definition at line 1300 of file ulxr_value.cpp.

References ulxr::RpcArray, and ULXR_ASSERT_RPCTYPE.

CppString ulxr::Array::getSignature ( bool  deep = false  )  const [virtual]

Returns the signature of value.

The signature may consist of the concatenated type names of all elements sourrounded by brackets.

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

Implements ulxr::ValueBase.

Definition at line 1307 of file ulxr_value.cpp.

References ulxr::RpcArray, ULXR_ASSERT_RPCTYPE, ULXR_CHAR, and ULXR_PCHAR.

CppString ulxr::Array::getValueName (  )  [static]

Returns the xml name of the Value.

Returns:
value name

Definition at line 1332 of file ulxr_value.cpp.

References ULXR_PCHAR.

std::string ulxr::Array::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

Implements ulxr::ValueBase.

Definition at line 1338 of file ulxr_value.cpp.

References ulxr::RpcArray, ULXR_ASSERT_RPCTYPE, ulxr::ValueParserWb::wbToken_Array, ulxr::ValueParserWb::wbToken_Data, ulxr::ValueParserWb::wbToken_Value, and ulxr::WbXmlParser::wbxml_END.

CppString ulxr::Array::getXml ( int  indent = 0  )  const [virtual]

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

Implements ulxr::ValueBase.

Definition at line 1359 of file ulxr_value.cpp.

References ulxr::getXmlIndent(), ulxr::getXmlLinefeed(), ulxr::RpcArray, ULXR_ASSERT_RPCTYPE, and ULXR_PCHAR.

void ulxr::Array::clear (  ) 

Removes all elements of the Array.

Definition at line 1294 of file ulxr_value.cpp.


Member Data Documentation

std::vector<Value> ulxr::Array::values [private]

Definition at line 904 of file ulxr_value.h.


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