QtRestClient
3.0.0
A library for generic JSON-based REST-APIs, with a mechanism to map JSON to Qt objects
|
A base class to create a simply type version for a normal one. Q_GADGET version. More...
#include <simple.h>
Public Member Functions | |
Simple () | |
Constructor. | |
virtual QUrl | extensionHref () const =0 |
Returns the link to the extended version of this object. More... | |
bool | hasExtension () const |
Returns true, if the object has an extension. | |
bool | isExtended () const |
Returns true, if the object has already been extended. | |
T | currentExtended () const |
Returns the current extension. More... | |
template<typename ET = QObject*> | |
GenericRestReply< T, ET > * | extend (RestClient *client) |
Performs an extension request and returns the reply to the request. More... | |
template<typename ET = QObject*> | |
void | extend (RestClient *client, std::function< void(T, bool)> extensionHandler, const std::function< void(QString, int, RestReply::Error)> &errorHandler={}, std::function< QString(ET, int)> failureTransformer={}) |
Extends the object by using a handler. More... | |
template<typename ET = QObject*> | |
void | extend (RestClient *client, QObject *scope, std::function< void(T, bool)> extensionHandler, const std::function< void(QString, int, RestReply::Error)> &errorHandler={}, std::function< QString(ET, int)> failureTransformer={}) |
Extends the object by using a handler. More... | |
A base class to create a simply type version for a normal one. Q_GADGET version.
T QtRestClient::Simple< T, std::enable_if_t< std::is_void_v< typename T::QtGadgetHelper > > >::currentExtended | ( | ) | const |
GenericRestReply< T, ET > * QtRestClient::Simple< T, std::enable_if_t< std::is_void_v< typename T::QtGadgetHelper > > >::extend | ( | RestClient * | client | ) |
void QtRestClient::Simple< T, std::enable_if_t< std::is_void_v< typename T::QtGadgetHelper > > >::extend | ( | RestClient * | client, |
QObject * | scope, | ||
std::function< void(T, bool)> | extensionHandler, | ||
const std::function< void(QString, int, RestReply::Error)> & | errorHandler = {} , |
||
std::function< QString(ET, int)> | failureTransformer = {} |
||
) |
Extends the object by using a handler.
client | The rest client to be used to create the network request |
scope | (optional) A scope to limit the callback to |
extensionHandler | The handler to be called with the extended object |
errorHandler | Will be passed to GenericRestReply::onAllErrors |
failureTransformer | Will be passed to GenericRestReply::onAllErrors |
If the object is already extended it will simply be passed to the handler. If not, an internal extension is performed, and the handler called for the result.
The handlers parameters are:
true
) or already available (false
) (bool) void QtRestClient::Simple< T, std::enable_if_t< std::is_void_v< typename T::QtGadgetHelper > > >::extend | ( | RestClient * | client, |
std::function< void(T, bool)> | extensionHandler, | ||
const std::function< void(QString, int, RestReply::Error)> & | errorHandler = {} , |
||
std::function< QString(ET, int)> | failureTransformer = {} |
||
) |
Extends the object by using a handler.
client | The rest client to be used to create the network request |
extensionHandler | The handler to be called with the extended object |
errorHandler | Will be passed to GenericRestReply::onAllErrors |
failureTransformer | Will be passed to GenericRestReply::onAllErrors |
If the object is already extended it will simply be passed to the handler. If not, an internal extension is performed, and the handler called for the result.
The handlers parameters are:
true
) or already available (false
) (bool)
|
pure virtual |
Returns the link to the extended version of this object.