Home

QtSoapStruct Class Reference

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

 #include <QtSoapStruct>

Inherits QtSoapType.

Public Functions

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]

Removes all items from the struct.

Reimplemented from QtSoapType.

int QtSoapStruct::count () const   [virtual]

Returns the number of items in this struct.

Reimplemented from QtSoapType.

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::parse ( QDomNode node )   [virtual]

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

Reimplemented from QtSoapType.

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

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

Reimplemented from QtSoapType.

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

Makes this struct a copy of copy.

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

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.

Reimplemented from QtSoapType.

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

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.

Reimplemented from QtSoapType.

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

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.

Reimplemented from QtSoapType.

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

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.

Reimplemented from QtSoapType.

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

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.

Reimplemented from QtSoapType.

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

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.

Reimplemented from QtSoapType.


Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies) Trademarks
Qt Solutions