mastodonpp  0.3.0
Classes | Typedefs | Enumerations | Functions
mastodonpp Namespace Reference

C++ wrapper for the Mastodon API. More...

Classes

struct  answer_type
 Return type for Requests. More...
 
class  API
 Holds API endpoints. More...
 
class  Connection
 Represents a connection to an instance. Used for requests. More...
 
class  CURLException
 Exception for libcurl errors. More...
 
class  CURLWrapper
 Handles the details of network connections. More...
 
struct  event_type
 A stream event. More...
 
class  Instance
 Holds the access data of an instance. More...
 

Typedefs

using endpoint_variant = variant< API::endpoint_type, string_view >
 An endpoint. Either API::endpoint_type or std::string_view. More...
 
using parametermap = map< string_view, variant< string_view, vector< string_view > >>
 std::map of parameters for API calls. More...
 
using parameterpair = pair< string_view, variant< string_view, vector< string_view > >>
 A single parameter of a parametermap. More...
 

Enumerations

enum  http_method {
  GET, POST, PATCH, PUT,
  DELETE
}
 The HTTP method. More...
 

Functions

std::ostream & operator<< (std::ostream &out, const answer_type &answer)
 

Detailed Description

C++ wrapper for the Mastodon API.

Since
0.1.0

Typedef Documentation

◆ endpoint_variant

using mastodonpp::endpoint_variant = typedef variant<API::endpoint_type,string_view>

An endpoint. Either API::endpoint_type or std::string_view.

Since
0.1.0

◆ parametermap

using mastodonpp::parametermap = typedef map<string_view, variant<string_view, vector<string_view> >>

std::map of parameters for API calls.

Note that arrays always have to be specified as vectors, even if they have only 1 element. To send a file, use “@file:” followed by the file name as value.

Example:

parametermap parameters
{
{"poll[expires_in]", "86400"},
{"poll[options]", vector<string_view>{"Yes", "No", "Maybe"}},
{"status", "How is the weather?"}
};
Since
0.1.0

◆ parameterpair

using mastodonpp::parameterpair = typedef pair<string_view, variant<string_view, vector<string_view> >>

A single parameter of a parametermap.

Since
0.1.0

Enumeration Type Documentation

◆ http_method

The HTTP method.

Since
0.1.0
41 {
42  GET,
43  POST,
44  PATCH,
45  PUT,
46  DELETE
47 };

Function Documentation

◆ operator<<()

std::ostream& mastodonpp::operator<< ( std::ostream &  out,
const answer_type answer 
)
Since
0.1.0
40 {
41  out << answer.body;
42  return out;
43 }
mastodonpp::parametermap
map< string_view, variant< string_view, vector< string_view > >> parametermap
std::map of parameters for API calls.
Definition: types.hpp:64