QtRestClient  3.0.0
A library for generic JSON-based REST-APIs, with a mechanism to map JSON to Qt objects
qtrestclient_global.h
1 #ifndef QTRESTCLIENT_GLOBAL_H
2 #define QTRESTCLIENT_GLOBAL_H
3 
4 #include <QtCore/qglobal.h>
5 #include <QtCore/qhash.h>
6 #include <QtCore/qstring.h>
7 #include <QtCore/qobject.h>
8 #include <QtCore/qbytearray.h>
9 #include <QtCore/qloggingcategory.h>
10 
11 #ifndef QT_STATIC
12 # if defined(QT_BUILD_RESTCLIENT_LIB)
13 # define Q_RESTCLIENT_EXPORT Q_DECL_EXPORT
14 # else
15 # define Q_RESTCLIENT_EXPORT Q_DECL_IMPORT
16 # endif
17 #else
18 # define Q_RESTCLIENT_EXPORT
19 #endif
20 
21 #if QT_CONFIG(thread) && QT_CONFIG(future)
22 #define QT_RESTCLIENT_USE_ASYNC
23 #endif
24 
26 namespace QtRestClient {
27 
28 class RestClient;
29 class RestClass;
30 
33 
35 Q_RESTCLIENT_EXPORT bool addGlobalApi(const QString &name, RestClient *client);
37 Q_RESTCLIENT_EXPORT void removeGlobalApi(const QString &name, bool deleteClient = true);
39 Q_RESTCLIENT_EXPORT RestClient *apiClient(const QString &name);
41 Q_RESTCLIENT_EXPORT RestClass *apiRootClass(const QString &name);
43 Q_RESTCLIENT_EXPORT RestClass *createApiClass(const QString &name, const QString &path, QObject *parent = nullptr);
44 
45 Q_RESTCLIENT_EXPORT Q_DECLARE_LOGGING_CATEGORY(logGlobal)
46 
47 }
48 
49 #endif // QTRESTCLIENT_GLOBAL_H
QtRestClient::apiClient
Q_RESTCLIENT_EXPORT RestClient * apiClient(const QString &name)
Returns the client for given API name.
Definition: restclient.cpp:479
QtRestClient
The Namespace containing all classes of the QtRestClient module.
Definition: genericrestreply.h:14
QtRestClient::RestClass
A class to perform requests to an API.
Definition: restclass.h:19
QtRestClient::addGlobalApi
Q_RESTCLIENT_EXPORT bool addGlobalApi(const QString &name, RestClient *client)
Makes the given API available under the given name.
Definition: restclient.cpp:436
QString
QtRestClient::removeGlobalApi
Q_RESTCLIENT_EXPORT void removeGlobalApi(const QString &name, bool deleteClient=true)
Removes a previously added API from the global list.
Definition: restclient.cpp:462
QtRestClient::createApiClass
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.
Definition: restclient.cpp:509
QtRestClient::apiRootClass
Q_RESTCLIENT_EXPORT RestClass * apiRootClass(const QString &name)
Returns the clients root class for the given API name.
Definition: restclient.cpp:491
QObject
QtRestClient::RestClient
A class to define access to an API, with general settings.
Definition: restclient.h:30
QHash