Main Page   Class Hierarchy   Compound List   File List   Compound Members  

XRVariant Class Reference

#include <xrvariant.h>

List of all members.

Public Methods

 XRVariant (const QVariant &aqv)
 XRVariant (QDomElement &a_xml_rpc_value)
void fromDomElement (QDomElement &qde)
QDomElement toDomElement (QDomDocument &doc) const

Static Public Methods

bool isXmlRpcType (const QVariant &qv)


Detailed Description

This subclass of QT's QVariant class represents the data types that are defined in XML-RPC. It handles serialization to and from XML using QDOM. Users of the library should probably NEVER use this class. It is used exclusively by XRMethodCall and XRMethodResponse.

See also:
http://www.xmlrpc.com/spec
The clean mapping between QT types is the following. A key feature is that is REVERSIBLE, i.e. it is one-to-one. All deserialization is done according to the clean mapping. The lossy mapping is the above plus the following: Note that the lossy mapping is NOT reversible. You will have to use QVariant::cast() to convert it back to it's original type, and you will not know what the original type was without extra information.

Use the static method XRVariant::isXmlRpcType() to check to see if you can cleanly map. If you do not check before hand, a lossy mapping may occur. The responsibility to make sure that data can be cleanly mapped is on users of the library. The library will always make a best-effort, which may be lossy.


Constructor & Destructor Documentation

XRVariant::XRVariant const QVariant &    aqv
 

Parameters:
aqv  QVariant from which to create a XRVariant
This is how we create XRVariants to do serialization

XRVariant::XRVariant QDomElement &    a_xml_rpc_value
 

read an XML-RPC value from this Dom node. Note, this is not const for the QDomNode


Member Function Documentation

void XRVariant::fromDomElement QDomElement &    qde
 

Reinitialize the XRVariant from this dom element

bool XRVariant::isXmlRpcType const QVariant &    qv [static]
 

If this is a map or list type, it recurses through all the elements and checks all of them.

Returns:
true if qv is not one of the lossy types

QDomElement XRVariant::toDomElement QDomDocument &    doc const
 

output the XRVariant into a dom element


The documentation for this class was generated from the following files:
Generated on Tue Feb 25 18:38:57 2003 for qutexr by doxygen1.2.15