QtJsonSerializer  4.0.0
A library to perform generic seralization and deserialization of QObjects
Namespaces | Classes | Typedefs | Functions
QtJsonSerializer Namespace Reference

The QtJsonSerializer namespace holds all classes of the module. More...

Namespaces

 MetaWriters
 Contains the writer classes required to support serialization of generic containers.
 

Classes

class  CborSerializer
 A class to serialize and deserialize c++ classes to and from CBOR. More...
 
class  DeserializationException
 Exception thrown by the serializers if something goes wrong while deserializing. More...
 
class  Exception
 Exception thrown by QJsonSerializer if something goes wrong. More...
 
class  JsonSerializer
 A class to serialize and deserialize c++ classes to and from JSON. More...
 
class  SerializationException
 Exception thrown by the serializers if something goes wrong while serializing. More...
 
class  SerializerBase
 A base class for the CBOR/JSON serializers. More...
 
class  TypeConverter
 An interface to create custom serializer type converters. More...
 
class  TypeConverterFactory
 A factory interface to create instances of QJsonTypeConverters. More...
 
class  TypeConverterStandardFactory
 A template implementation of TypeConverterFactory to generically create simply converters. More...
 
class  TypeExtractor
 Interface to extract data from any generic container. More...
 

Typedefs

using ExceptionBase = QException
 The exception base class to use for this module.
 

Functions

Q_JSONSERIALIZER_EXPORT void registerTypes ()
 Method to register all type converters for basic Qt types. More...
 

Detailed Description

The QtJsonSerializer namespace holds all classes of the module.

The primary two classes you are going to use are

Others are mostly helperclasses or only relevant when creating your own converters

Function Documentation

◆ registerTypes()

QtJsonSerializer::registerTypes ( )

Method to register all type converters for basic Qt types.

This method is called automatically by the library when loaded, to register converters for all types supported by default. When build the library as a static library, you have to call it yourself instead.

The types and converters that are registerd with this method are:

The following types are already registered by default:

Type List-Converters Map-Converters Set-Converters
bool yes yes yes
char yes yes yes
signed char yes yes yes
unsigned char yes yes yes
short yes yes yes
unsigned short yes yes yes
int yes yes yes
unsigned int yes yes yes
long yes yes yes
unsigned long yes yes yes
long long yes yes yes
unsigned long long yes yes yes
float yes yes yes
double yes yes yes
QObject * yes yes yes
QChar yes yes yes
QString yes yes yes
QDate yes yes yes
QTime yes yes yes
QDateTime yes yes yes
QUrl yes yes yes
QUuid yes yes yes
QCborValue yes yes yes
QCborMap yes yes yes
QCborArray yes yes yes
QJsonValue yes yes yes
QJsonObject yes yes yes
QJsonArray yes yes yes
QMimeType yes yes yes
QVersionNumber yes yes yes
QLocale yes yes yes5
QRegularExpression yes yes yes
QSize yes no no
QPoint yes no no
QLine yes no no
QRect yes no no
QSizeF yes no no
QPointF yes no no
QLineF yes no no
QRectF yes no no
QByteArray no yes yes
See also
SerializerBase::registerListConverters, SerializerBase::registerSetConverters, SerializerBase::registerMapConverters, SerializerBase::registerBasicConverters, SerializerBase::registerPointerConverters, SerializerBase::registerPairConverters, SerializerBase::registerTupleConverters, SerializerBase::registerOptionalConverters, SerializerBase::registerVariantConverters