QtRestClient
3.0.0
A library for generic JSON-based REST-APIs, with a mechanism to map JSON to Qt objects
|
1 #ifndef QTRESTCLIENT_PAGING_FWD_H
2 #define QTRESTCLIENT_PAGING_FWD_H
4 #include "QtRestClient/qtrestclient_global.h"
6 #include "QtRestClient/ipaging.h"
7 #include "QtRestClient/restclient.h"
8 #include "QtRestClient/restreply.h"
9 #include "QtRestClient/metacomponent.h"
13 #include <QtCore/qshareddata.h>
14 #include <QtCore/qloggingcategory.h>
16 #include <QtJsonSerializer/exception.h>
20 template<
typename DO,
typename EO>
21 class GenericRestReply;
62 template<
typename EO = QObject*>
70 template<
typename EO = QObject*>
76 void iterate(
const std::function<
bool(T, qint64)> &iterator,
78 qint64 from = 0)
const;
81 const std::function<
bool(T, qint64)> &iterator,
83 qint64 from = 0)
const;
85 template<
typename EO = QObject*>
86 void iterate(
const std::function<
bool(T, qint64)> &iterator,
88 const std::function<
QString(EO,
int)> &failureTransformer = {},
90 qint64 from = 0)
const;
92 template<
typename EO = QObject*>
94 const std::function<
bool(T, qint64)> &iterator,
96 const std::function<
QString(EO,
int)> &failureTransformer = {},
98 qint64 from = 0)
const;
100 template<
typename EO = QObject*>
101 void iterate(
const std::function<
bool(T, qint64)> &iterator,
102 const std::function<
void(
int, EO)> &failureHandler,
106 qint64 from = 0)
const;
108 template<
typename EO = QObject*>
110 const std::function<
bool(T, qint64)> &iterator,
111 const std::function<
void(
int, EO)> &failureHandler,
115 qint64 from = 0)
const;
126 qint64 internalIterate(
const std::function<
bool(T, qint64)> &iterator, qint64 to, qint64 from)
const;
127 qint64 calcMax(qint64 to)
const;
130 Q_RESTCLIENT_EXPORT Q_DECLARE_LOGGING_CATEGORY(logPaging)
134 #endif // QTRESTCLIENT_PAGING_FWD_H
Interface to parse generic paging objects and operate on them.
GenericRestReply< Paging< T >, EO > * previous() const
Performs a request for the previous paging object.
The Namespace containing all classes of the QtRestClient module.
Error
Defines the different possible error types.
void iterate(const std::function< bool(T, qint64)> &iterator, qint64 to=-1, qint64 from=0) const
Iterates over all paging objects.
bool isValid() const
Returns true, if the current paging object is a valid one.
bool hasPrevious() const
Returns true, if there is a previous paging object.
QUrl nextUrl() const
Returns the link to the next paging object.
qint64 total() const
Returns the total number of objects there are.
bool hasNext() const
Returns true, if there is a next paging object.
Paging()
Default Constructor.
QUrl previousUrl() const
Returns the link to the previous paging object.
A class to handle generic replies for generic requests.
QList< T > items() const
Returns the items of this paging object, i.e. it's data.
IPaging * iPaging() const
Returns the internally used IPaging instance.
A class to access generic paging objects.
void deleteAllItems() const
Deletes all items this paging object is holding (QObjects only)
GenericRestReply< Paging< T >, EO > * next() const
Performs a request for the next paging object.
qint64 offset() const
Returns the offset this paging begins at.
QVariantMap properties() const
Returns a hash containing all properties of the original JSON.
A class to define access to an API, with general settings.
Paging< T > & operator=(const Paging< T > &other)
Copy assignment operator.