mastodonpp  0.4.0
mastodonpp Reference

Using the library

Include mastodonpp.hpp, which then includes all other headers.

#include <mastodonpp/mastodonpp.hpp>

Use it in your CMake project like this:

find_package(mastodonpp REQUIRED CONFIG)
target_link_libraries(MyProject mastodonpp::mastodonpp)

Or compile your code with g++ $(pkg-config --cflags --libs mastodonpp).

Example

#include <mastodonpp/mastodonpp.hpp>
#include <iostream>
int main()
{
mastodonpp::Instance instance{"example.com", {}};
std::cout << "Maximum characters per post: "
<< instance.get_max_chars() << std::endl;
mastodonpp::Connection connection{instance};
auto answer{connection.get(mastodonpp::API::v1::instance)};
if (answer)
{
std::cout << answer << std::endl;
}
}
mastodonpp::Connection::get
answer_type get(const endpoint_variant &endpoint, const parametermap &parameters)
Make a HTTP GET call with parameters.
Definition: connection.cpp:34
mastodonpp
C++ wrapper for the Mastodon API.
Definition: api.cpp:19
mastodonpp::Instance::get_max_chars
uint64_t get_max_chars() noexcept
Returns the maximum number of characters per post.
mastodonpp::Instance
Holds the access data of an instance.
Definition: instance.hpp:45
mastodonpp::Connection
Represents a connection to an instance. Used for requests.
Definition: connection.hpp:75