19 #ifndef MASTODONPP_TYPES_HPP
20 #define MASTODONPP_TYPES_HPP
26 #include <string_view>
38 using std::string_view;
64 variant<string_view, vector<string_view>>>;
72 variant<string_view, vector<string_view>>>;
127 explicit operator bool()
const;
134 explicit operator string_view()
const;
152 [[nodiscard]] string_view
get_header(string_view field)
const;
163 return parse_pagination(
true);
176 return parse_pagination(
false);
C++ wrapper for the Mastodon API.
Definition: api.hpp:25
pair< string_view, variant< string_view, vector< string_view > >> parameterpair
A single parameter of a parametermap.
Definition: types.hpp:72
map< string_view, variant< string_view, vector< string_view > >> parametermap
std::map of parameters for API calls.
Definition: types.hpp:64
Return type for Requests.
Definition: types.hpp:80
friend ostream & operator<<(ostream &out, const answer_type &answer)
Returns body as std::ostream.
Definition: types.cpp:40
uint16_t http_status
HTTP status code.
Definition: types.hpp:105
parametermap next() const
Returns the parameters needed for the next entries.
Definition: types.hpp:161
parametermap prev() const
Returns the parameters needed for the previous entries.
Definition: types.hpp:174
string_view get_header(string_view field) const
Returns the value of a header field.
Definition: types.cpp:46
uint8_t curl_error_code
The error code returned by libcurl.
Definition: types.hpp:91
string body
The response from the server, usually JSON.
Definition: types.hpp:119
string headers
The headers of the response from the server.
Definition: types.hpp:112
string error_message
The error message.
Definition: types.hpp:98