QXmpp Version: 1.5.6
|
Public Member Functions | |
QList< QXmppDataForm::Field > | unknownFields () const |
void | setUnknownFields (const QList< QXmppDataForm::Field > &unknownFields) |
Public Member Functions inherited from QXmppDataFormBase | |
virtual QXmppDataForm | toDataForm () const |
Protected Member Functions | |
void | parseForm (const QXmppDataForm &) override |
void | serializeForm (QXmppDataForm &) const override |
virtual bool | parseField (const QXmppDataForm::Field &) |
Protected Member Functions inherited from QXmppDataFormBase | |
virtual QString | formType () const =0 |
std::optional< quint32 > | parseUInt (const QVariant &variant) |
std::optional< quint64 > | parseULongLong (const QVariant &variant) |
std::optional< bool > | parseBool (const QVariant &variant) |
Additional Inherited Members | |
Static Protected Member Functions inherited from QXmppDataFormBase | |
static bool | fromDataForm (const QXmppDataForm &form, QXmppDataFormBase &parent) |
template<typename T > | |
static void | serializeValue (QXmppDataForm &form, QXmppDataForm::Field::Type type, const QString &name, const T &value) |
template<typename T > | |
static void | serializeNullable (QXmppDataForm &form, QXmppDataForm::Field::Type type, const QString &name, const T &value) |
template<typename T > | |
static void | serializeEmptyable (QXmppDataForm &form, QXmppDataForm::Field::Type type, const QString &name, const T &value) |
template<typename T , typename ValueConverter = T (*)(T)> | |
static void | serializeOptional (QXmppDataForm &form, QXmppDataForm::Field::Type type, const QString &name, const std::optional< T > &optional, ValueConverter convert=[](T a) { return a;}) |
template<typename T > | |
static void | serializeOptionalNumber (QXmppDataForm &form, QXmppDataForm::Field::Type type, const QString &name, std::optional< T > optional) |
static void | serializeDatetime (QXmppDataForm &form, const QString &name, const QDateTime &datetime, QXmppDataForm::Field::Type type=QXmppDataForm::Field::TextSingleField) |
This class is used for parsing a QXmppDataForm in an extensible way with inheritance and keeping additional unknown fields.
When inheriting you need to reimplement parseField(), serializeForm() and formType(). Also you should add a static parsing function (e.g. QXmppPubSubMetadata::fromDataForm()).
|
protectedvirtual |
Returns true if a field has been parsed.
Should be reimplemented to do actual parsing. All fields that can't be parsed end up as unknownFields().
Reimplemented in QXmppPubSubSubAuthorization.
|
overrideprotectedvirtual |
This is called when a QXmppDataForm is parsed. You can parse all values from the given form and its fields.
Implements QXmppDataFormBase.
|
overrideprotectedvirtual |
This is called the object is serialized to a QXmppDataForm. You need to create a new QXmppDataForm and serialize all fields and values.
Implements QXmppDataFormBase.
Reimplemented in QXmppPubSubSubAuthorization.
void QXmppExtensibleDataFormBase::setUnknownFields | ( | const QList< QXmppDataForm::Field > & | unknownFields | ) |
Sets all additional fields to be serialized.
QList< QXmppDataForm::Field > QXmppExtensibleDataFormBase::unknownFields | ( | ) | const |
Returns all fields that couldn't be parsed.