2020-01-03 11:14:21 +01:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
< html xmlns = "http://www.w3.org/1999/xhtml" >
< head >
< meta http-equiv = "Content-Type" content = "text/xhtml;charset=UTF-8" / >
< meta http-equiv = "X-UA-Compatible" content = "IE=9" / >
< meta name = "generator" content = "Doxygen 1.8.16" / >
< meta name = "viewport" content = "width=device-width, initial-scale=1" / >
< title > mastodonpp: mastodonpp Reference< / title >
< link href = "tabs.css" rel = "stylesheet" type = "text/css" / >
< script type = "text/javascript" src = "jquery.js" > < / script >
< script type = "text/javascript" src = "dynsections.js" > < / script >
< link href = "search/search.css" rel = "stylesheet" type = "text/css" / >
< script type = "text/javascript" src = "search/searchdata.js" > < / script >
< script type = "text/javascript" src = "search/search.js" > < / script >
< link href = "doxygen.css" rel = "stylesheet" type = "text/css" / >
< / head >
< body >
< div id = "top" > <!-- do not remove this div, it is closed by doxygen! -->
< div id = "titlearea" >
< table cellspacing = "0" cellpadding = "0" >
< tbody >
< tr style = "height: 56px;" >
< td id = "projectalign" style = "padding-left: 0.5em;" >
< div id = "projectname" > mastodonpp
  < span id = "projectnumber" > 0.0.0< / span >
< / div >
< / td >
< / tr >
< / tbody >
< / table >
< / div >
<!-- end header part -->
<!-- Generated by Doxygen 1.8.16 -->
< script type = "text/javascript" >
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3& dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
< / script >
< script type = "text/javascript" src = "menudata.js" > < / script >
< script type = "text/javascript" src = "menu.js" > < / script >
< script type = "text/javascript" >
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3& dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */< / script >
< div id = "main-nav" > < / div >
< / div > <!-- top -->
<!-- window showing the filter options -->
< div id = "MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
< / div >
<!-- iframe showing the search results (closed by default) -->
< div id = "MSearchResultsWindow" >
< iframe src = "javascript:void(0)" frameborder = "0"
name="MSearchResults" id="MSearchResults">
< / iframe >
< / div >
< div class = "PageDoc" > < div class = "header" >
< div class = "headertitle" >
< div class = "title" > mastodonpp Reference < / div > < / div >
< / div > <!-- header -->
< div class = "contents" >
< div class = "textblock" > < h1 > < a class = "anchor" id = "using" > < / a >
Using the library< / h1 >
< p > Include < a class = "el" href = "mastodonpp_8hpp_source.html" > mastodonpp.hpp< / a > , which then includes all other headers.< / p >
< div class = "fragment" > < div class = "line" > < span class = "preprocessor" > #include < mastodonpp/mastodonpp.hpp> < / span > < / div >
< / div > <!-- fragment --> < p > Use it in your CMake project like this:< / p >
2020-01-03 12:47:36 +01:00
< div class = "fragment" > < div class = "line" > find_package(< a class = "code" href = "namespacemastodonpp.html" > mastodonpp< / a > REQUIRED CONFIG)< / div >
2020-01-03 11:14:21 +01:00
< div class = "line" > target_link_libraries(MyProject mastodonpp::mastodonpp)< / div >
< / div > <!-- fragment --> < p > Or compile your code with < code > g++ $(pkg-config --cflags --libs mastodonpp)< / code > .< / p >
2020-01-04 11:40:17 +01:00
< h2 > < a class = "anchor" id = "Example" > < / a >
Example< / h2 >
2020-01-05 13:40:46 +01:00
< div class = "fragment" > < div class = "line" > < span class = "preprocessor" > #include < mastodonpp/mastodonpp.hpp> < / span > < / div >
< div class = "line" > < span class = "preprocessor" > #include < iostream> < / span > < / div >
< div class = "line" > < / div >
< div class = "line" > < span class = "keywordtype" > int< / span > main()< / div >
2020-01-04 11:40:17 +01:00
< div class = "line" > {< / div >
< div class = "line" > < a class = "code" href = "classmastodonpp_1_1Instance.html" > mastodonpp::Instance< / a > instance{< span class = "stringliteral" > " example.com" < / span > , < span class = "stringliteral" > " " < / span > };< / div >
2020-01-05 13:40:46 +01:00
< div class = "line" > std::cout < < < span class = "stringliteral" > " Maximum characters per post: " < / span > < / div >
2020-01-06 09:51:44 +01:00
< div class = "line" > < < instance.< a class = "code" href = "classmastodonpp_1_1Instance.html#a2f07b2e79fc7f128f26c88c2d954ecab" > get_max_chars< / a > () < < std::endl;< / div >
2020-01-05 13:40:46 +01:00
< div class = "line" > < / div >
< div class = "line" > < a class = "code" href = "classmastodonpp_1_1Connection.html" > mastodonpp::Connection< / a > connection{instance};< / div >
< div class = "line" > < / div >
< div class = "line" > < span class = "keyword" > auto< / span > answer{connection.< a class = "code" href = "classmastodonpp_1_1Connection.html#a048b38d07a5cd90ad939257bd554a860" > get< / a > (mastodonpp::API::v1::instance)};< / div >
< div class = "line" > < span class = "keywordflow" > if< / span > (answer)< / div >
< div class = "line" > {< / div >
< div class = "line" > std::cout < < answer < < std::endl;< / div >
< div class = "line" > }< / div >
2020-01-04 11:40:17 +01:00
< div class = "line" > }< / div >
< / div > <!-- fragment --> < h1 > < a class = "anchor" id = "exceptions" > < / a >
Exceptions< / h1 >
2020-01-06 09:51:44 +01:00
< p > Any unrecoverable libcurl error will be thrown as a < a class = "el" href = "classmastodonpp_1_1CURLException.html" title = "Exception for libcurl errors." > mastodonpp::CURLException< / a > . Network errors will < b > not< / b > be thrown, but reported via the return value. < / p >
2020-01-04 11:40:17 +01:00
< / div > < / div > <!-- PageDoc -->
2020-01-03 11:14:21 +01:00
< / div > <!-- contents -->
2020-01-06 09:51:44 +01:00
< div class = "ttc" id = "anamespacemastodonpp_html" > < div class = "ttname" > < a href = "namespacemastodonpp.html" > mastodonpp< / a > < / div > < div class = "ttdoc" > C++ wrapper for the Mastodon API.< / div > < div class = "ttdef" > < b > Definition:< / b > api.cpp:19< / div > < / div >
< div class = "ttc" id = "aclassmastodonpp_1_1Instance_html_a2f07b2e79fc7f128f26c88c2d954ecab" > < div class = "ttname" > < a href = "classmastodonpp_1_1Instance.html#a2f07b2e79fc7f128f26c88c2d954ecab" > mastodonpp::Instance::get_max_chars< / a > < / div > < div class = "ttdeci" > uint64_t get_max_chars()< / div > < div class = "ttdoc" > Returns the maximum number of characters per post.< / div > < div class = "ttdef" > < b > Definition:< / b > instance.cpp:33< / div > < / div >
2020-01-05 13:40:46 +01:00
< div class = "ttc" id = "aclassmastodonpp_1_1Connection_html_a048b38d07a5cd90ad939257bd554a860" > < div class = "ttname" > < a href = "classmastodonpp_1_1Connection.html#a048b38d07a5cd90ad939257bd554a860" > mastodonpp::Connection::get< / a > < / div > < div class = "ttdeci" > answer_type get(const API::endpoint_type & endpoint)< / div > < div class = "ttdoc" > Make a HTTP GET call.< / div > < div class = "ttdef" > < b > Definition:< / b > connection.cpp:27< / div > < / div >
2020-01-05 13:28:39 +01:00
< div class = "ttc" id = "aclassmastodonpp_1_1Instance_html" > < div class = "ttname" > < a href = "classmastodonpp_1_1Instance.html" > mastodonpp::Instance< / a > < / div > < div class = "ttdoc" > Holds the access data of an instance.< / div > < div class = "ttdef" > < b > Definition:< / b > instance.hpp:40< / div > < / div >
2020-01-05 13:40:46 +01:00
< div class = "ttc" id = "aclassmastodonpp_1_1Connection_html" > < div class = "ttname" > < a href = "classmastodonpp_1_1Connection.html" > mastodonpp::Connection< / a > < / div > < div class = "ttdoc" > Represents a connection to an instance. Used for requests.< / div > < div class = "ttdef" > < b > Definition:< / b > connection.hpp:41< / div > < / div >
2020-01-03 11:14:21 +01:00
<!-- start footer part -->
< hr class = "footer" / > < address class = "footer" > < small >
Generated by   < a href = "http://www.doxygen.org/index.html" >
< img class = "footer" src = "doxygen.png" alt = "doxygen" / >
< / a > 1.8.16
< / small > < / address >
< / body >
< / html >