cpp Rest API master
C++ library for REST API access with Qt, Curl and cpp-httplib backends
 
Loading...
Searching...
No Matches
cpp_restapi::IPaginationStrategy Struct Referenceabstract

Interface for pagination strategies. More...

#include <ipagination_strategy.hpp>

Inheritance diagram for cpp_restapi::IPaginationStrategy:
cpp_restapi::LinkHeaderPaginationStrategy

Public Member Functions

virtual ~IPaginationStrategy ()=default
 
virtual std::string nextPageUrl (const std::string &responseHeaders)=0
 Extract next page URL from response headers.
 
virtual std::string merge (const std::vector< std::string > &pages)=0
 Merge all collected pages into a single result.
 

Detailed Description

Interface for pagination strategies.

Defines how to discover the next page URL from response headers and how to merge multiple pages into a single result.

Constructor & Destructor Documentation

◆ ~IPaginationStrategy()

virtual cpp_restapi::IPaginationStrategy::~IPaginationStrategy ( )
virtualdefault

Member Function Documentation

◆ merge()

virtual std::string cpp_restapi::IPaginationStrategy::merge ( const std::vector< std::string > & pages)
pure virtual

Merge all collected pages into a single result.

Parameters
pagesresponse bodies from all pages
Returns
merged result

Implemented in cpp_restapi::LinkHeaderPaginationStrategy.

◆ nextPageUrl()

virtual std::string cpp_restapi::IPaginationStrategy::nextPageUrl ( const std::string & responseHeaders)
pure virtual

Extract next page URL from response headers.

Parameters
responseHeadersraw HTTP headers from the response
Returns
URL of the next page, or empty string if no more pages

Implemented in cpp_restapi::LinkHeaderPaginationStrategy.


The documentation for this struct was generated from the following file: