mastodon-cpp
0.110.0
|
Collection of things to interface with server software that implements the Mastodon API. More...
Namespaces | |
Easy | |
Collection of things that make it easier to interface with server software that implements the Mastodon API. | |
Classes | |
class | API |
Interface to the Mastodon API. More... | |
struct | param |
A single parameter. More... | |
struct | parameters |
Vector of Mastodon::param, used for passing parameters in calls. More... | |
struct | return_base |
Basis for return types. More... | |
struct | return_call |
Return type for API calls. More... | |
Typedefs | |
typedef struct Mastodon::return_base | return_base |
Basis for return types. More... | |
typedef Mastodon::return_call | return_call |
Return type for API calls. More... | |
typedef struct Mastodon::param | param |
A single parameter. More... | |
typedef Mastodon::parameters | parameters |
Vector of Mastodon::param, used for passing parameters in calls. More... | |
Enumerations | |
enum | http_method { GET, PATCH, POST, PUT, DELETE, GET_STREAM } |
HTTP methods. Used in API calls. More... | |
enum | error { OK = 0, INVALID_ARGUMENT = 1, URL_CHANGED = 10, CONNECTION_TIMEOUT = 11, CONNECTION_REFUSED = 12, DNS = 13, ENCRYPTION = 14, UNKNOWN = 127 } |
Functions | |
const string | urlencode (const string &str) |
Percent-encodes a string. More... | |
const string | urldecode (const string &str) |
Decodes a percent-encoded string. More... | |
const string | unescape_html (const string &html) |
Replaces HTML entities with UTF-8 characters. More... | |
std::ostream & | operator<< (std::ostream &out, const return_call &ret) |
typedef struct Mastodon::param Mastodon::param |
A single parameter.
key | The key as a string. |
values | The values as a vector of strings. |
Vector of Mastodon::param, used for passing parameters in calls.
The only difference to a std::vector<param> is the added member find.
Example:
typedef struct Mastodon::return_base Mastodon::return_base |
Basis for return types.
Return type for API calls.
Example:
|
strong |
HTTP methods. Used in API calls.
std::ostream& Mastodon::operator<< | ( | std::ostream & | out, |
const return_call & | ret | ||
) |
const string Mastodon::unescape_html | ( | const string & | html | ) |
Replaces HTML entities with UTF-8 characters.
Supports named and numbered entities, decimal and hexadecimal.
html | The html to unescape. |
const string Mastodon::urldecode | ( | const string & | str | ) |
Decodes a percent-encoded string.
See RFC 3986 section 2.1 for more info.
str | The string to decode. |
const string Mastodon::urlencode | ( | const string & | str | ) |
Percent-encodes a string.
This is done automatically where necessary. The only time you should use this, is if you use get(const string &call, string &answer). See RFC 3986 section 2.1 for more info.
str | The string to encode. |