cpp Rest API master
C++ library for REST API access with Qt, Curl and cpp-httplib backends
 
Loading...
Searching...
No Matches
link_header_pagination_strategy.hpp
Go to the documentation of this file.
1#ifndef LINK_HEADER_PAGINATION_STRATEGY_HPP_INCLUDED
2#define LINK_HEADER_PAGINATION_STRATEGY_HPP_INCLUDED
3
4#include <cpp_restapi/version.hpp>
5
6#if !CPP_RESTAPI_HAS_JSON_PAGINATION
7#error "cpp_restapi was built without JSON pagination support. Rebuild with -DCppRestAPI_JsonPagination=ON to use LinkHeaderPaginationStrategy."
8#endif
9
11#include "cpp_restapi_export.h"
12
13namespace cpp_restapi
14{
15
26 class CPP_RESTAPI_EXPORT LinkHeaderPaginationStrategy: public IPaginationStrategy
27 {
28 public:
29 std::string nextPageUrl(const std::string& responseHeaders) override;
30 std::string merge(const std::vector<std::string>& pages) override;
31 };
32
33}
34
35#endif
Pagination strategy using RFC 5988 Link headers.
Definition link_header_pagination_strategy.hpp:27
std::string merge(const std::vector< std::string > &pages) override
Merge all collected pages into a single result.
std::string nextPageUrl(const std::string &responseHeaders) override
Extract next page URL from response headers.
Definition coroutine.hpp:14
Interface for pagination strategies.
Definition ipagination_strategy.hpp:17