109 lines
7.0 KiB
HTML
109 lines
7.0 KiB
HTML
<!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>
|
|
<div class="fragment"><div class="line">find_package(<a class="code" href="namespacemastodonpp.html">mastodonpp</a> REQUIRED CONFIG)</div>
|
|
<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>
|
|
<h2><a class="anchor" id="Example"></a>
|
|
Example</h2>
|
|
<div class="fragment"><div class="line"><span class="keywordflow">try</span></div>
|
|
<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>
|
|
<div class="line"> <a class="code" href="classmastodonpp_1_1Request.html">mastodonpp::Request</a> request{instance};</div>
|
|
<div class="line"> <span class="keyword">auto</span> answer{request.<a class="code" href="classmastodonpp_1_1Request.html#abf980d36a6ccb5eadee1cd9ef80baf0d">get</a>(mastodonpp::API::v1::instance)};</div>
|
|
<div class="line"> std::cout << answer << std::endl;</div>
|
|
<div class="line">}</div>
|
|
<div class="line"><span class="keywordflow">catch</span> (<span class="keyword">const</span> <a class="code" href="classmastodonpp_1_1CURLException.html">mastodonpp::CURLException</a> &e)</div>
|
|
<div class="line">{</div>
|
|
<div class="line"> std::cerr << e.<a class="code" href="classmastodonpp_1_1CURLException.html#aa5d6aaec95758bc7db42ef1ee8831ecc">what</a>() << std::endl;</div>
|
|
<div class="line">}</div>
|
|
</div><!-- fragment --><h1><a class="anchor" id="exceptions"></a>
|
|
Exceptions</h1>
|
|
<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>. </p>
|
|
</div></div><!-- PageDoc -->
|
|
</div><!-- contents -->
|
|
<div class="ttc" id="aclassmastodonpp_1_1CURLException_html"><div class="ttname"><a href="classmastodonpp_1_1CURLException.html">mastodonpp::CURLException</a></div><div class="ttdoc">Exception for libcurl errors.</div><div class="ttdef"><b>Definition:</b> exceptions.hpp:38</div></div>
|
|
<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:23</div></div>
|
|
<div class="ttc" id="aclassmastodonpp_1_1Request_html"><div class="ttname"><a href="classmastodonpp_1_1Request.html">mastodonpp::Request</a></div><div class="ttdoc">Used to make a request to the Mastodon API.</div><div class="ttdef"><b>Definition:</b> request.hpp:36</div></div>
|
|
<div class="ttc" id="aclassmastodonpp_1_1Request_html_abf980d36a6ccb5eadee1cd9ef80baf0d"><div class="ttname"><a href="classmastodonpp_1_1Request.html#abf980d36a6ccb5eadee1cd9ef80baf0d">mastodonpp::Request::get</a></div><div class="ttdeci">answer_type get(API::endpoint_type endpoint) const</div><div class="ttdoc">Make a HTTP GET call.</div><div class="ttdef"><b>Definition:</b> request.cpp:26</div></div>
|
|
<div class="ttc" id="aclassmastodonpp_1_1CURLException_html_aa5d6aaec95758bc7db42ef1ee8831ecc"><div class="ttname"><a href="classmastodonpp_1_1CURLException.html#aa5d6aaec95758bc7db42ef1ee8831ecc">mastodonpp::CURLException::what</a></div><div class="ttdeci">const char * what() const noexcept override</div><div class="ttdoc">Returns the error code, message and error buffer.</div><div class="ttdef"><b>Definition:</b> exceptions.cpp:39</div></div>
|
|
<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 hostname and access token of an instance.</div><div class="ttdef"><b>Definition:</b> instance.hpp:34</div></div>
|
|
<!-- 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>
|