Qt-based BB10 API Examples Documentation

Contents

QtSoapStruct Class Reference

The QtSoapStruct class is an implementation of the SOAP struct type. More...

    #include <QtSoapStruct>

Inherits: QtSoapType.

Public Functions

QtSoapStruct ()
QtSoapStruct ( const QtSoapQName & name )
QtSoapStruct ( const QtSoapStruct & copy )
~QtSoapStruct ()
QtSoapType & at ( const QtSoapQName & key )
const QtSoapType & at ( const QtSoapQName & key ) const
void insert ( QtSoapType * item )
QtSoapStruct & operator= ( const QtSoapStruct & copy )

Reimplemented Public Functions

virtual void clear ()
virtual int count () const
virtual bool isValid () const
virtual bool parse ( QDomNode node )
virtual QDomElement toDomElement ( QDomDocument doc ) const
virtual QtSoapType & operator[] ( const QtSoapQName & key )
virtual const QtSoapType & operator[] ( const QtSoapQName & key ) const
virtual QtSoapType & operator[] ( const QString & key )
virtual const QtSoapType & operator[] ( const QString & key ) const
virtual QtSoapType & operator[] ( int i )
virtual const QtSoapType & operator[] ( int i ) const

Additional Inherited Members

Detailed Description

The QtSoapStruct class is an implementation of the SOAP struct type.

A SOAP struct is a dictionary of QtSoapTypes where entries are looked up by name. Entries in a struct can be of any QtSoapType type, such as QtSoapArray, QtSoapStruct or QtSoapSimpleType.

The struct can be created in several ways. parse() generates a struct by analyzing a QDomNode. insert() is used to add items manually.

    QtSoapStruct myStruct(QtSoapQName("myStruct"));

    myStruct.insert(new QtSoapSimpleType(QtSoapQName("item1"), 5));
    myStruct.insert(new QtSoapSimpleType(QtSoapQName("item2"), "hello"));
    myStruct.insert(new QtSoapSimpleType(QtSoapQName("item3"), true));

Use the operator[]() or at() when looking up entries in a struct by name. If the names are unknown, QtSoapStructIterator lets you iterate through all the items.

    QtSoapType &helloItem = myStruct["Hello"];

toDomElement() converts the QtSoapStruct to a DomElement.

See also QtSoapStructIterator, QtSoapType, QtSoapArray, and QtSoapSimpleType.

Member Function Documentation

QtSoapStruct::QtSoapStruct ()

Constructs an empty QtSoapStruct.

QtSoapStruct::QtSoapStruct ( const QtSoapQName & name )

Constructs an empty QtSoapStruct and sets its QName (qualified name) to name.

QtSoapStruct::QtSoapStruct ( const QtSoapStruct & copy )

Constructs a QtSoapStruct that is a copy of copy.

QtSoapStruct::~QtSoapStruct ()

Destructs the QtSoapStruct.

QtSoapType & QtSoapStruct::at ( const QtSoapQName & key )

Returns a reference to the item in this struct whose QName (qualified name) is key. If no such item exists, an empty QtSoapType is returned.

const QtSoapType & QtSoapStruct::at ( const QtSoapQName & key ) const

This is an overloaded function.

Returns a reference to the item in this struct whose QName (qualified name) is key. If no such item exists, an empty QtSoapType is returned.

void QtSoapStruct::clear () [virtual]

Reimplemented from QtSoapType::clear().

Removes all items from the struct.

int QtSoapStruct::count () const [virtual]

Reimplemented from QtSoapType::count().

Returns the number of items in this struct.

void QtSoapStruct::insert ( QtSoapType * item )

Inserts the QtSoapType item into this struct. Any existing item with the same QName (qualified name) will be erased.

bool QtSoapStruct::isValid () const [virtual]

Reimplemented from QtSoapType::isValid().

bool QtSoapStruct::parse ( QDomNode node ) [virtual]

Reimplemented from QtSoapType::parse().

Inspects node and constructs the equivalent QtSoapStruct if node qualifies as a SOAP struct. Returns true if it does; otherwise returns false.

QDomElement QtSoapStruct::toDomElement ( QDomDocument doc ) const [virtual]

Reimplemented from QtSoapType::toDomElement().

Generates the QDomElement representation of this struct. The returned QDomElement is created using doc.

QtSoapStruct & QtSoapStruct::operator= ( const QtSoapStruct & copy )

Makes this struct a copy of copy.

QtSoapType & QtSoapStruct::operator[] ( const QtSoapQName & key ) [virtual]

Reimplemented from QtSoapType::operator[]().

Returns a reference to the item in this struct whose QName (qualified name) is key. If no such item exists, an empty QtSoapType is returned.

const QtSoapType & QtSoapStruct::operator[] ( const QtSoapQName & key ) const [virtual]

Reimplemented from QtSoapType::operator[]().

This is an overloaded function.

Returns a reference to the item in this struct whose QName (qualified name) is key. If no such item exists, an empty QtSoapType is returned.

QtSoapType & QtSoapStruct::operator[] ( const QString & key ) [virtual]

Reimplemented from QtSoapType::operator[]().

This is an overloaded function.

Returns a reference to the item in this struct whose QName (qualified name) is key. If no such item exists, an empty QtSoapType is returned.

const QtSoapType & QtSoapStruct::operator[] ( const QString & key ) const [virtual]

Reimplemented from QtSoapType::operator[]().

This is an overloaded function.

Returns a reference to the item in this struct whose QName (qualified name) is key. If no such item exists, an empty QtSoapType is returned.

QtSoapType & QtSoapStruct::operator[] ( int i ) [virtual]

Reimplemented from QtSoapType::operator[]().

This is an overloaded function.

Returns a reference to item number i in this struct. If no such item exists, an empty QtSoapType is returned.

The items are ordered in the sequence in which they were inserted, starting from 0.

const QtSoapType & QtSoapStruct::operator[] ( int i ) const [virtual]

Reimplemented from QtSoapType::operator[]().

This is an overloaded function.

Returns a reference to item number i in this struct. If no such item exists, an empty QtSoapType is returned.

The items are ordered in the sequence in which they were inserted, starting from 0.