Home

QtSoapStruct Class Reference

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

#include <qtsoap.h>

Inherits QtSoapType.

List of all member functions.

Public 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.

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 member function, provided for convenience. It behaves essentially like the above 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.

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.

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

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Returns a reference to an empty QtSoapType. There is no ordinal ordering of items in a QtSoapStruct; the argument i is ignored.

Reimplemented from QtSoapType.

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

This is an overloaded member function, provided for convenience. It behaves essentially like the above 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[] ( int i ) const [virtual]

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Returns a reference to an empty QtSoapType. There is no ordinal ordering of items in a QtSoapStruct; the argument i is ignored.

Reimplemented from QtSoapType.

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

This is an overloaded member function, provided for convenience. It behaves essentially like the above 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 member function, provided for convenience. It behaves essentially like the above 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.

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.


This file is part of the Qt Solutions. Copyright © 2003-2006 Trolltech. All Rights Reserved.

Copyright © 2003-2006 TrolltechTrademarks
Qt Solutions