QtRestClient  3.0.0
A library for generic JSON-based REST-APIs, with a mechanism to map JSON to Qt objects
Public Member Functions | List of all members
QtRestClient::IPagingFactory Class Referenceabstract

A factory interface to create IPaging instances from raw data. More...

#include <ipaging.h>

Public Member Functions

virtual IPagingcreatePaging (QtJsonSerializer::SerializerBase *serializer, const std::variant< QCborValue, QJsonValue > &data) const =0
 Creates a new paging object of the given data. More...
 

Detailed Description

A factory interface to create IPaging instances from raw data.

In order to use paging, you need a factory to create those. A default IPagingFactory is used to do so. However, if you need to reimplement IPaging, you need to create a factory as well.

See also
IPaging, Paging, RestClient::pagingFactory

Definition at line 77 of file ipaging.h.

Member Function Documentation

◆ createPaging()

QtRestClient::IPagingFactory::createPaging ( QtJsonSerializer::SerializerBase serializer,
const std::variant< QCborValue, QJsonValue > &  data 
) const
pure virtual

Creates a new paging object of the given data.

Parameters
serializerA json serializer, if you want to use it for deserialization
dataThe paging CBOR/JSON data to be loaded into a IPaging interface
Returns
A new paging interface instance
Exceptions
QJsonSerializer::DeserializationExceptionWill be thrown if the passed json data is not a valid paging object

When reimplementing this function, make shure to not return nullptr, if the creation failed. throw an exception instead, as specified by this documenation


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