QtJsonSerializer  4.0.0
A library to perform generic seralization and deserialization of QObjects
Public Member Functions | List of all members
QtJsonSerializer::TypeConverter::SerializationHelper Class Referenceabstract

Helper class passed to the type converter by the serializer. Do not implement yourself. More...

#include <typeconverter.h>

+ Inheritance diagram for QtJsonSerializer::TypeConverter::SerializationHelper:

Public Member Functions

virtual bool jsonMode () const =0
 Returns true, if de/serializing to JSON, and false for CBOR.
 
virtual QVariant getProperty (const char *name) const =0
 Returns a property from the serializer.
 
virtual QCborTag typeTag (int metaTypeId) const =0
 Returns a tag registered for the given metaTypeId.
 
virtual QSharedPointer< const TypeExtractorextractor (int metaTypeId) const =0
 Returns a reference to an extractor for the given type, or nullptr.
 
virtual QCborValue serializeSubtype (const QMetaProperty &property, const QVariant &value) const =0
 Serialize a subvalue, represented by a meta property.
 
virtual QCborValue serializeSubtype (int propertyType, const QVariant &value, const QByteArray &traceHint={}) const =0
 Serialize a subvalue, represented by a type id.
 
virtual QVariant deserializeSubtype (const QMetaProperty &property, const QCborValue &value, QObject *parent) const =0
 Deserialize a subvalue, represented by a meta property.
 
virtual QVariant deserializeSubtype (int propertyType, const QCborValue &value, QObject *parent, const QByteArray &traceHint={}) const =0
 Deserialize a subvalue, represented by a type id.
 

Detailed Description

Helper class passed to the type converter by the serializer. Do not implement yourself.

Warning
Do not implement this class yourself. It is created internally, and only passed to your custom converter implementations

For the de/serializeSubtype methods, always prefer the overload with the QMetaProperty parameter, in case you have one. If not, it is recommended to pass a "naming" string as last parameter, to help identifying errors.

See also
TypeConverter, TypeConverter::serialize, TypeConverter::deserialize

Definition at line 66 of file typeconverter.h.


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