Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes
QtSoapType Class Reference

The QtSoapType class is the base class for all SOAP types in QtSoap. More...

#include <QtSoap.h>

Inheritance diagram for QtSoapType:
Inheritance graph
[legend]
Collaboration diagram for QtSoapType:
Collaboration graph
[legend]

List of all members.

Public Types

enum  Type {
  Duration, DateTime, Time, Date,
  GYearMonth, GYear, GMonthDay, GDay,
  GMonth, Boolean, Base64Binary, HexBinary,
  Float, Double, AnyURI, QName,
  NOTATION, String, NormalizedString, Token,
  Language, Name, NMTOKEN, NCName,
  ID, IDREF, ENTITY, Decimal,
  Integer, NonPositiveInteger, NegativeInteger, Long,
  Int, Short, Byte, NonNegativeInteger,
  UnsignedLong, PositiveInteger, UnsignedInt, UnsignedShort,
  UnsignedByte, Array, Struct, Other
}

Public Member Functions

 QtSoapType ()
 QtSoapType (const QtSoapQName &name, Type t=Other)
 QtSoapType (const QtSoapType &copy)
QtSoapTypeoperator= (const QtSoapType &copy)
virtual ~QtSoapType ()
virtual void clear ()
virtual bool parse (QDomNode)
virtual bool isValid () const
virtual int count () const
virtual QVariant value () const
virtual QtSoapTypeoperator[] (int)
virtual QtSoapTypeoperator[] (const QtSoapQName &s)
virtual QtSoapTypeoperator[] (const QString &name)
virtual const QtSoapTypeoperator[] (int) const
virtual const QtSoapTypeoperator[] (const QtSoapQName &s) const
virtual const QtSoapTypeoperator[] (const QString &name) const
virtual QDomElement toDomElement (QDomDocument) const
virtual Type type () const
virtual QString id () const
virtual QString href () const
virtual QString typeName () const
virtual QtSoapQName name () const
virtual QString toString () const
virtual int toInt () const
virtual bool toBool () const
void setName (const QtSoapQName &)
void setId (const QString &)
void setHref (const QString &)
QString errorString () const

Static Public Member Functions

static QString typeToName (QtSoapType::Type t)
static Type nameToType (const QString &)

Protected Attributes

Type t
QString errorStr
QString i
QtSoapQName n
QString u
QString h

Detailed Description

The QtSoapType class is the base class for all SOAP types in QtSoap.

Although it is not used to create data types, a QtSoapType reference can be conveniently used to inspect a tree of QtSoapType subclasses. Accessors from this base class, such as operator[](), allow safe navigation.

    const QtSoapType &root = message.returnValue();
    if (root["fault"].isValid()) {
        qWarning("Warning: %s", root["fault"]["faultstring"].toString().toLatin1().constData());
    }

This class holds the name(), type(), id() and href() of all its derived types.

If a QtSoapType reference or pointer points to a QtSoapStruct, a QtSoapArray or a QtSoapSimpleType, isValid() returns true.

See also:
QtSoapStruct, QtSoapArray, QtSoapSimpleType

Definition at line 184 of file QtSoap.h.


Member Enumeration Documentation

SOAP supports the types described in XML Schema Part 2: Datatypes listed at http://www.w3.org/TR/xmlschema-2/. The following values are represented using QtSoapSimpleType, except where noted.

AnyURI Array Represented by QtSoapArray Base64Binary Boolean Byte Date DateTime Decimal Double Duration ENTITY Float GDay GMonth GMonthDay GYear GYearMonth HexBinary ID IDREF Int Integer Language Long NCName NMTOKEN NOTATION Name NegativeInteger NonNegativeInteger NonPositiveInteger NormalizedString Other PositiveInteger QName Short String Struct Represented by QtSoapStruct Time Token UnsignedByte UnsignedInt UnsignedLong UnsignedShort

Enumerator:
Duration 
DateTime 
Time 
Date 
GYearMonth 
GYear 
GMonthDay 
GDay 
GMonth 
Boolean 
Base64Binary 
HexBinary 
Float 
Double 
AnyURI 
QName 
NOTATION 
String 
NormalizedString 
Token 
Language 
Name 
NMTOKEN 
NCName 
ID 
IDREF 
ENTITY 
Decimal 
Integer 
NonPositiveInteger 
NegativeInteger 
Long 
Int 
Short 
Byte 
NonNegativeInteger 
UnsignedLong 
PositiveInteger 
UnsignedInt 
UnsignedShort 
UnsignedByte 
Array 
Struct 
Other 

Definition at line 187 of file QtSoap.h.


Constructor & Destructor Documentation

QtSoapType::QtSoapType ( )

Constructs a QtSoapType.

Definition at line 482 of file QtSoap.cpp.

QtSoapType::QtSoapType ( const QtSoapQName name,
Type  type = Other 
)

Constructs a QtSoapType whose name is name and type is type. This contructor is usually only called by constructors in subclasses.

Definition at line 493 of file QtSoap.cpp.

QtSoapType::QtSoapType ( const QtSoapType copy)

Creates a QtSoapType copy of copy.

Definition at line 502 of file QtSoap.cpp.

QtSoapType::~QtSoapType ( ) [virtual]

Destructs a QtSoapType.

Definition at line 511 of file QtSoap.cpp.


Member Function Documentation

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

Makes this QtSoapType equal to copy.

Definition at line 526 of file QtSoap.cpp.

void QtSoapType::clear ( ) [virtual]

Clears any contents. In this base implementation, clear() does nothing.

Reimplemented in QtSoapArray, QtSoapStruct, and QtSoapSimpleType.

Definition at line 519 of file QtSoap.cpp.

bool QtSoapType::parse ( QDomNode  ) [virtual]

Attempts to interpret node as a QtSoapType, and returns true if successful. This base implementation always returns false.

Reimplemented in QtSoapArray, QtSoapStruct, and QtSoapSimpleType.

Definition at line 894 of file QtSoap.cpp.

bool QtSoapType::isValid ( ) const [virtual]

Returns true if this object is of type QtSoapStruct, QtSoapArray or QtSoapSimpletype; otherwise returns false.

Reimplemented in QtSoapArray, QtSoapStruct, and QtSoapSimpleType.

Definition at line 541 of file QtSoap.cpp.

int QtSoapType::count ( ) const [virtual]

Returns the number of child items in this QtSoapType. In the base implementation, this returns 0.

Reimplemented in QtSoapArray, and QtSoapStruct.

Definition at line 811 of file QtSoap.cpp.

QVariant QtSoapType::value ( ) const [virtual]

Returns the value of this QtSoapType. In the base implementation, an invalid QVariant() is returned.

Reimplemented in QtSoapSimpleType.

Definition at line 794 of file QtSoap.cpp.

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

Returns a reference to the child item at ordinal position pos. If no item exists at this position, returns an empty QtSoapType.

Reimplemented in QtSoapArray, and QtSoapStruct.

Definition at line 820 of file QtSoap.cpp.

QtSoapType & QtSoapType::operator[] ( const QtSoapQName s) [virtual]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Returns a reference to the child item whose QName (qualified name) is key. If no item exists with this key an empty QtSoapType is returned.

Reimplemented in QtSoapArray, and QtSoapStruct.

Definition at line 833 of file QtSoap.cpp.

QtSoapType & QtSoapType::operator[] ( const QString &  name) [virtual]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Returns a reference to the child item whose QName (qualified name) is key, regardless of the qualified name's URI. If no item exists with this key, an empty QtSoapType is returned.

Reimplemented in QtSoapArray, and QtSoapStruct.

Definition at line 846 of file QtSoap.cpp.

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

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Returns a reference to the child item at ordinal position pos. If no item exists at this position, returns an empty QtSoapType.

Reimplemented in QtSoapArray, and QtSoapStruct.

Definition at line 858 of file QtSoap.cpp.

const QtSoapType & QtSoapType::operator[] ( const QtSoapQName s) const [virtual]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Returns a reference to the child item whose QName (qualified name) is key. If no item exists with this key, returns an empty QtSoapType.

Reimplemented in QtSoapArray, and QtSoapStruct.

Definition at line 871 of file QtSoap.cpp.

const QtSoapType & QtSoapType::operator[] ( const QString &  name) const [virtual]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Returns a reference to the child item whose QName (qualified name) is key, regardless of the qualified name's URI. If no item exists with this key, returns an empty QtSoapType.

Reimplemented in QtSoapArray, and QtSoapStruct.

Definition at line 884 of file QtSoap.cpp.

QDomElement QtSoapType::toDomElement ( QDomDocument  document) const [virtual]

Returns the QDomElement representation of this QtSoapType as a child of document.

Reimplemented in QtSoapArray, QtSoapStruct, and QtSoapSimpleType.

Definition at line 720 of file QtSoap.cpp.

QtSoapType::Type QtSoapType::type ( ) const [virtual]

Returns the type as a QtSoapType::Type.

Definition at line 737 of file QtSoap.cpp.

QString QtSoapType::id ( ) const [virtual]

Returns the ID of this QtSoapType.

Definition at line 753 of file QtSoap.cpp.

QString QtSoapType::href ( ) const [virtual]

Returns the href attribute of this QtSoapType.

Definition at line 761 of file QtSoap.cpp.

QString QtSoapType::typeName ( ) const [virtual]

Returns the QString representation of this QtSoapType's type.

Definition at line 729 of file QtSoap.cpp.

QtSoapQName QtSoapType::name ( ) const [virtual]

Returns the QName (qualified name) of this QtSoapType.

Definition at line 745 of file QtSoap.cpp.

QString QtSoapType::toString ( ) const [virtual]

Returns QString::null.

Reimplemented in QtSoapSimpleType.

Definition at line 695 of file QtSoap.cpp.

int QtSoapType::toInt ( ) const [virtual]

Returns 0.

Reimplemented in QtSoapSimpleType.

Definition at line 703 of file QtSoap.cpp.

bool QtSoapType::toBool ( ) const [virtual]

Returns false.

Reimplemented in QtSoapSimpleType.

Definition at line 711 of file QtSoap.cpp.

void QtSoapType::setName ( const QtSoapQName name)

Sets the QName (qualified name) of this QtSoapType to name.

Definition at line 769 of file QtSoap.cpp.

void QtSoapType::setId ( const QString &  i)

Sets the ID of this QtSoapType to i.

Definition at line 777 of file QtSoap.cpp.

void QtSoapType::setHref ( const QString &  h)

Sets the href attribute of this QtSoapType to h.

Definition at line 785 of file QtSoap.cpp.

QString QtSoapType::errorString ( ) const

Returns a human readable explanation of the most recent error.

Definition at line 802 of file QtSoap.cpp.

QString QtSoapType::typeToName ( QtSoapType::Type  t) [static]

Returns the QString equivalent of type t.

Definition at line 549 of file QtSoap.cpp.

QtSoapType::Type QtSoapType::nameToType ( const QString &  name) [static]

Returns the QtSoapType::Type called name.

Definition at line 602 of file QtSoap.cpp.


Member Data Documentation

Type QtSoapType::t [protected]

Definition at line 242 of file QtSoap.h.

QString QtSoapType::errorStr [protected]

Definition at line 243 of file QtSoap.h.

QString QtSoapType::i [protected]

Definition at line 244 of file QtSoap.h.

Definition at line 245 of file QtSoap.h.

QString QtSoapType::u [protected]

Definition at line 246 of file QtSoap.h.

QString QtSoapType::h [protected]

Definition at line 247 of file QtSoap.h.


The documentation for this class was generated from the following files:
Copyright INRIA, 2011