xmlrpc::Variant Class Reference

The xmlrpc::Variant class acts like a union for XML-RPC variables types. More...

`#include <variant.h>`

List of all members.

## Public Member Functions

| Variant (const Variant &)
| Variant (const QDomElement &)
| Variant (uint val)
| Variant (int val)
| Variant (bool val)
| Variant (double val)
| Variant (const QByteArray &val)
| Variant (const QString &val)
| Variant (const QStringList &val)
| Variant (const QDateTime &val)
| Variant (const QList< Variant > &val)
| Variant (const QMap< QString, Variant > &val)
| Variant (const QChar &c)
| this variable is casted to string XML-RPC type
QDomElement | toDomElement (QDomDocument &) const
| serialize Variant data to the QDomDocument, according to XML-RPC specification.
QString | pprint ()

## Detailed Description

The xmlrpc::Variant class acts like a union for XML-RPC variables types.

The xmlrpc::Variant class is the version of QVariant with set of types restricted to types supported by XML-RPC specification. For this purpose, the Variant( const QVariant& ) constructor is declared as private, and xmlrpc::Variant construcors defined for all the XML-RPC supported types. This allows to perform the compile time XML-RPC types checks.

The xmlrpc::Variant class also provides deserialization and serialization from/to QDomElement, according to XML-RPC specification, with

top DOM element.

## Constructor & Destructor Documentation

xmlrpc::Variant::Variant | ( | const Variant & | val | ) |

Constructs a copy of the variant, p, passed as the argument to this constructor.

xmlrpc::Variant::Variant | ( | const QDomElement & | node | ) |

Constructs a new variant from XmlRPC xml element node. note name must be "value"

xmlrpc::Variant::Variant | ( | uint | val | ) |

Next constructors should be used to build xmlrpc::Variant values from users data, to be passed to the xmlrpc::Client::request call

Constructs a new variant with an integer value, val.

xmlrpc::Variant::Variant | ( | int | val | ) |

Constructs a new variant with an integer value, val.

xmlrpc::Variant::Variant | ( | bool | val | ) |

Constructs a new variant with a boolean value, val.

xmlrpc::Variant::Variant | ( | double | val | ) |

Constructs a new variant with a double value, val.

xmlrpc::Variant::Variant | ( | const QByteArray & | val | ) |

Constructs a new variant with an QByteArray value, val.

xmlrpc::Variant::Variant | ( | const QString & | val | ) |

Constructs a new variant with a string value, val.

xmlrpc::Variant::Variant | ( | const QStringList & | val | ) |

Constructs a new variant with a strings list value, val.

xmlrpc::Variant::Variant | ( | const QDateTime & | val | ) |

Constructs a new variant with a date time value, val.

xmlrpc::Variant::Variant | ( | const QList< Variant > & | listVal | ) |

Constructs a new variant with a list value, val.

xmlrpc::Variant::Variant | ( | const QMap< QString, Variant > & | mapVal | ) |

Constructs a new variant with a map value, val.

xmlrpc::Variant::Variant | ( | const QChar & | c | ) |

this variable is casted to string XML-RPC type

Constructs a new variant with a char value, val. XmlRPC string type will be used.

## Member Function Documentation

QString xmlrpc::Variant::pprint | ( |  | ) |

Return human readable presentation of xmlrpc::Variant value in JSON like format.

Referenced by xmlrpc::Client::request().

QDomElement xmlrpc::Variant::toDomElement | ( | QDomDocument & | doc | ) | const

serialize Variant data to the QDomDocument, according to XML-RPC specification.

Generate QDomElement with XmlRPC presentation of variant value.

References toDomElement().

Referenced by xmlrpc::Request::composeRequest(), and toDomElement().

The documentation for this class was generated from the following files:

- xmlrpc/variant.h
- xmlrpc/variant.cpp