|
QtRestClient
3.0.0
A library for generic JSON-based REST-APIs, with a mechanism to map JSON to Qt objects
|
The Namespace containing all classes of the QtRestClient module. More...
Namespaces | |
| Auth | |
| The namespace for the QNetworkAuth extensions. | |
Classes | |
| class | AwaitedException |
| An exception that is throw on errors when awaiting a RestReply. More... | |
| class | GenericAwaitedException |
| An exception that is throw on errors when awaiting a GenericRestReply. More... | |
| class | GenericRestReply |
| A class to handle generic replies for generic requests. More... | |
| class | GenericRestReply< Paging< DataClassType >, ErrorClassType > |
| A class to handle generic replies for generic requests. More... | |
| class | GenericRestReply< void, ErrorClassType > |
| A class to handle generic replies for generic requests. More... | |
| class | GenericRestReplyAwaitable |
| A helper class to be used with QtCoroutines to await a generic rest reply. More... | |
| class | GenericRestReplyAwaitable< void, ErrorClassType > |
| A helper class to be used with QtCoroutines to await a generic rest reply. More... | |
| class | GenericRestReplyBase |
| The base class for GenericRestReply specializations. More... | |
| class | ICborPaging |
| Interface to parse generic CBOR paging objects and operate on them. More... | |
| class | IJsonPaging |
| Interface to parse generic JSON paging objects and operate on them. More... | |
| class | IPaging |
| Interface to parse generic paging objects and operate on them. More... | |
| class | IPagingFactory |
| A factory interface to create IPaging instances from raw data. More... | |
| class | IPagingModelFetcher |
| Interface for a component that fetches entries for the PagingModel. More... | |
| class | Paging |
| A class to access generic paging objects. More... | |
| class | PagingModel |
| A Qt item model that fills itself from a Paging object obtained via the network. More... | |
| class | RequestBuilder |
| A helper class to build QUrl and QNetworkRequest objects. More... | |
| class | RestClass |
| A class to perform requests to an API. More... | |
| class | RestClassFetcher |
| A default implementation for a IPagingModelFetcher, using a RestClass to send the requests. More... | |
| class | RestClient |
| A class to define access to an API, with general settings. More... | |
| class | RestReply |
| A class to handle replies for JSON requests. More... | |
| class | RestReplyAwaitable |
| A helper class to be used with QtCoroutines to await a rest reply. More... | |
| class | Simple |
| A base class to create a simply type version for a normal one. Check The QObject* or Q_GADGET version. More... | |
| class | Simple< T *, std::enable_if_t< std::is_base_of_v< QObject, T > > > |
| A base class to create a simply type version for a normal one. QObject* version. More... | |
| class | Simple< T, std::enable_if_t< std::is_void_v< typename T::QtGadgetHelper > > > |
| A base class to create a simply type version for a normal one. Q_GADGET version. More... | |
Typedefs | |
| using | HeaderHash = QHash< QByteArray, QByteArray > |
| A typedef for a collection of HTTP request headers. More... | |
| using | ExceptionBase = QException |
| The base class for exceptions of the module. | |
Functions | |
| Q_RESTCLIENT_EXPORT bool | addGlobalApi (const QString &name, RestClient *client) |
| Makes the given API available under the given name. More... | |
| Q_RESTCLIENT_EXPORT void | removeGlobalApi (const QString &name, bool deleteClient=true) |
| Removes a previously added API from the global list. More... | |
| Q_RESTCLIENT_EXPORT RestClient * | apiClient (const QString &name) |
| Returns the client for given API name. More... | |
| Q_RESTCLIENT_EXPORT RestClass * | apiRootClass (const QString &name) |
| Returns the clients root class for the given API name. More... | |
| Q_RESTCLIENT_EXPORT RestClass * | createApiClass (const QString &name, const QString &path, QObject *parent=nullptr) |
| Creates a new API class based on the client for the given API name. More... | |
The Namespace containing all classes of the QtRestClient module.
| class QtRestClient::Simple |
A typedef for a collection of HTTP request headers.
Definition at line 32 of file qtrestclient_global.h.
| bool QtRestClient::addGlobalApi | ( | const QString & | name, |
| RestClient * | client | ||
| ) |
Makes the given API available under the given name.
| name | The name to identify the API with. Use to obtain a reference to the API later on |
| client | The RestClient to be registered |
true if added, false if the name is already takenclient, do not delete it after adding itDefinition at line 436 of file restclient.cpp.
| RestClient * QtRestClient::apiClient | ( | const QString & | name | ) |
Returns the client for given API name.
| name | The name of the root class to be returned |
RestClient for the given API name, or nullptr if no such API existsDefinition at line 479 of file restclient.cpp.
Returns the clients root class for the given API name.
| name | The name of the root class to be returned |
RestClass for the given API name, or nullptr if no such API existsDefinition at line 491 of file restclient.cpp.
| RestClass * QtRestClient::createApiClass | ( | const QString & | name, |
| const QString & | path, | ||
| QObject * | parent = nullptr |
||
| ) |
Creates a new API class based on the client for the given API name.
| name | The name of the root class to be returned |
| path | The path to be used for the RestClass |
| parent | The parent object for the created class |
RestClass for the given API name, or nullptr if no such API existsDefinition at line 509 of file restclient.cpp.
| void QtRestClient::removeGlobalApi | ( | const QString & | name, |
| bool | deleteClient = true |
||
| ) |
Removes a previously added API from the global list.
| name | The name of the API to be removed. |
| deleteClient | Specifies whether the removed client should be deleted |
If you don't delete the client, It will be automatically deleted together with the QCoreApplication. If you don't want this, simply retake ownership by yourself:
Definition at line 462 of file restclient.cpp.
1.8.16