#include <ulxr_value.h>
Inheritance diagram for ulxr::Array:
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 ValueBase * | cloneValue () 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< Value > | values |
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.
ulxr::Array::Array | ( | ) |
ulxr::Array::~Array | ( | ) | [virtual] |
void ulxr::Array::addItem | ( | const Value & | item | ) |
Appends a new array member.
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".
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".
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.
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.
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.
deep | if nested types exist, include them |
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.
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.
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.
indent | current indentation level |
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 | ( | ) |
std::vector<Value> ulxr::Array::values [private] |
Definition at line 904 of file ulxr_value.h.