lib/curl/Handler: add API documentation

This commit is contained in:
Max Kellermann 2018-01-19 11:12:41 +01:00
parent 8bd95a4eb1
commit c3b8568560
1 changed files with 22 additions and 0 deletions

View File

@ -36,12 +36,34 @@
#include <string>
#include <map>
/**
* Asynchronous response handler for a #CurlRequest.
*
* Its methods must be thread-safe.
*/
class CurlResponseHandler {
public:
/**
* Status line and headers have been received.
*/
virtual void OnHeaders(unsigned status,
std::multimap<std::string, std::string> &&headers) = 0;
/**
* Response body data has been received.
*/
virtual void OnData(ConstBuffer<void> data) = 0;
/**
* The response has ended. The method is allowed delete the
* #CurlRequest here.
*/
virtual void OnEnd() = 0;
/**
* An error has occurred. The method is allowed delete the
* #CurlRequest here.
*/
virtual void OnError(std::exception_ptr e) noexcept = 0;
};