mastodonpp/docs/instance_8hpp_source.html
2020-01-14 23:20:02 +01:00

245 lines
32 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: include/instance.hpp Source File</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
&#160;<span id="projectnumber">0.3.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&amp;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&amp;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>
<!-- 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 id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">instance.hpp</div> </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/* This file is part of mastodonpp.</span></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * Copyright © 2020 tastytea &lt;tastytea@tastytea.de&gt;</span></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * This program is free software: you can redistribute it and/or modify</span></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> * it under the terms of the GNU Affero General Public License as published by</span></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * the Free Software Foundation, version 3.</span></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> * This program is distributed in the hope that it will be useful,</span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span></div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> * GNU Affero General Public License for more details.</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> * You should have received a copy of the GNU Affero General Public License</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160; </div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="preprocessor">#ifndef MASTODONPP_INSTANCE_HPP</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="preprocessor">#define MASTODONPP_INSTANCE_HPP</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160; </div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#include &quot;curl_wrapper.hpp&quot;</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;<span class="preprocessor">#include &quot;types.hpp&quot;</span></div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160; </div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#include &lt;cstdint&gt;</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &lt;string_view&gt;</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="preprocessor">#include &lt;utility&gt;</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160; </div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacemastodonpp.html">mastodonpp</a></div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;{</div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160; </div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;<span class="keyword">using</span> std::uint64_t;</div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="keyword">using</span> std::string;</div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;<span class="keyword">using</span> std::string_view;</div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;<span class="keyword">using</span> std::move;</div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;<span class="keyword">using</span> std::vector;</div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160; </div>
<div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="classmastodonpp_1_1Instance.html"> 45</a></span>&#160;<span class="keyword">class </span><a class="code" href="classmastodonpp_1_1Instance.html">Instance</a> : <span class="keyword">public</span> <a class="code" href="classmastodonpp_1_1CURLWrapper.html">CURLWrapper</a></div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160;{</div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="classmastodonpp_1_1Instance.html#a04dc593589b69f9f71c4acecb39d995a"> 56</a></span>&#160; <span class="keyword">explicit</span> <a class="code" href="classmastodonpp_1_1Instance.html#a04dc593589b69f9f71c4acecb39d995a">Instance</a>(<span class="keyword">const</span> string_view hostname,</div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; <span class="keyword">const</span> string_view access_token)</div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; : _hostname{hostname}</div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; , _baseuri{<span class="stringliteral">&quot;https://&quot;</span> + _hostname}</div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; , _access_token{access_token}</div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; , _max_chars{0}</div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; {}</div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; </div>
<div class="line"><a name="l00074"></a><span class="lineno"><a class="line" href="classmastodonpp_1_1Instance.html#aa486bc453907439e33f8402f270ef384"> 74</a></span>&#160; <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmastodonpp_1_1Instance.html#aa486bc453907439e33f8402f270ef384">copy_connection_properties</a>(<a class="code" href="classmastodonpp_1_1CURLWrapper.html">CURLWrapper</a> &amp;curlwrapper)</div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; {</div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; curlwrapper.<a class="code" href="classmastodonpp_1_1CURLWrapper.html#a0059ecb78b53c4b3c941b19f8dc897f7">setup_connection_properties</a>(_proxy, _access_token, _cainfo,</div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; _useragent);</div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; }</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; </div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; [[nodiscard]]</div>
<div class="line"><a name="l00086"></a><span class="lineno"><a class="line" href="classmastodonpp_1_1Instance.html#a868aae1fae3ad4060759c1325acb3b62"> 86</a></span>&#160; <span class="keyword">inline</span> string_view <a class="code" href="classmastodonpp_1_1Instance.html#a868aae1fae3ad4060759c1325acb3b62">get_hostname</a>() const noexcept</div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; {</div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; <span class="keywordflow">return</span> _hostname;</div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; }</div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; </div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; [[nodiscard]]</div>
<div class="line"><a name="l00099"></a><span class="lineno"><a class="line" href="classmastodonpp_1_1Instance.html#a859540ec79ea97c0f76185d9036127bb"> 99</a></span>&#160; <span class="keyword">inline</span> string_view <a class="code" href="classmastodonpp_1_1Instance.html#a859540ec79ea97c0f76185d9036127bb">get_baseuri</a>() const noexcept</div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; {</div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; <span class="keywordflow">return</span> _baseuri;</div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; }</div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; </div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; [[nodiscard]]</div>
<div class="line"><a name="l00110"></a><span class="lineno"><a class="line" href="classmastodonpp_1_1Instance.html#a3fcd68515b1d07a4003bc09180fff904"> 110</a></span>&#160; <span class="keyword">inline</span> string_view <a class="code" href="classmastodonpp_1_1Instance.html#a3fcd68515b1d07a4003bc09180fff904">get_access_token</a>() const noexcept</div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; {</div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; <span class="keywordflow">return</span> _access_token;</div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; }</div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; </div>
<div class="line"><a name="l00123"></a><span class="lineno"><a class="line" href="classmastodonpp_1_1Instance.html#a1e606235a69d150b59bd90c78069de22"> 123</a></span>&#160; <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmastodonpp_1_1Instance.html#a1e606235a69d150b59bd90c78069de22">set_access_token</a>(<span class="keywordtype">string</span> access_token)</div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; {</div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; _access_token = move(access_token);</div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; }</div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; </div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160; [[nodiscard]]</div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; uint64_t <a class="code" href="classmastodonpp_1_1Instance.html#a3d9f535570e6083b7f37b3c5e42c08dd">get_max_chars</a>() noexcept;</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; </div>
<div class="line"><a name="l00147"></a><span class="lineno"><a class="line" href="classmastodonpp_1_1Instance.html#a4aa276f156e3a770e5fd9cbf5c7c0cd5"> 147</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="classmastodonpp_1_1Instance.html#a4aa276f156e3a770e5fd9cbf5c7c0cd5">set_proxy</a>(const string_view proxy)</div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; {</div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; _proxy = proxy;</div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; <a class="code" href="classmastodonpp_1_1CURLWrapper.html#a1564a42794ef7a9d170b725063ef504d">CURLWrapper::set_proxy</a>(proxy);</div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; }</div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; </div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160; [[nodiscard]]</div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; <a class="code" href="structmastodonpp_1_1answer__type.html">answer_type</a> <a class="code" href="classmastodonpp_1_1Instance.html#a4d594e1365584a05e5a16fc8aea76e9d">get_nodeinfo</a>();</div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160; </div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; vector&lt;string&gt; <a class="code" href="classmastodonpp_1_1Instance.html#a84b7e4ef6e05f7f7208b557c38b5ad1e">get_post_formats</a>() noexcept;</div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160; </div>
<div class="line"><a name="l00186"></a><span class="lineno"><a class="line" href="classmastodonpp_1_1Instance.html#af75272092047c8af95cef8dfb3969dfa"> 186</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="classmastodonpp_1_1Instance.html#af75272092047c8af95cef8dfb3969dfa">set_cainfo</a>(string_view path)</div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160; {</div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; _cainfo = path;</div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; <a class="code" href="classmastodonpp_1_1CURLWrapper.html#af3f2bd4dea7c289d590fe19889360444">CURLWrapper::set_cainfo</a>(path);</div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160; }</div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160; </div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160; <span class="keywordtype">void</span> set_useragent(<span class="keyword">const</span> string_view useragent)</div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160; {</div>
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160; _useragent = useragent;</div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160; CURLWrapper::set_useragent(useragent);</div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160; }</div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160; </div>
<div class="line"><a name="l00226"></a><span class="lineno"><a class="line" href="classmastodonpp_1_1Instance_1_1ObtainToken.html"> 226</a></span>&#160; <span class="keyword">class </span><a class="code" href="classmastodonpp_1_1Instance_1_1ObtainToken.html">ObtainToken</a> : <span class="keyword">public</span> <a class="code" href="classmastodonpp_1_1CURLWrapper.html">CURLWrapper</a></div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160; {</div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160; <span class="keyword">public</span>:</div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160; <a class="code" href="classmastodonpp_1_1Instance_1_1ObtainToken.html">ObtainToken</a>(<a class="code" href="classmastodonpp_1_1Instance.html">Instance</a> &amp;instance)</div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160; : _instance{instance}</div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160; , _baseuri{instance.<a class="code" href="classmastodonpp_1_1Instance.html#a859540ec79ea97c0f76185d9036127bb">get_baseuri</a>()}</div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160; {</div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160; _instance.<a class="code" href="classmastodonpp_1_1Instance.html#aa486bc453907439e33f8402f270ef384">copy_connection_properties</a>(*<span class="keyword">this</span>);</div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160; }</div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160; </div>
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>&#160; [[nodiscard]]</div>
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160; <a class="code" href="structmastodonpp_1_1answer__type.html">answer_type</a> <a class="code" href="classmastodonpp_1_1Instance_1_1ObtainToken.html#a5bd5d631e2fbb186a9df66d2ac3f5402">step_1</a>(string_view client_name, string_view scopes,</div>
<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>&#160; string_view website);</div>
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span>&#160; </div>
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>&#160; [[nodiscard]]</div>
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span>&#160; <a class="code" href="structmastodonpp_1_1answer__type.html">answer_type</a> <a class="code" href="classmastodonpp_1_1Instance_1_1ObtainToken.html#addda7f4e1ca4200235764707478f6d51">step_2</a>(string_view code);</div>
<div class="line"><a name="l00272"></a><span class="lineno"> 272</span>&#160; </div>
<div class="line"><a name="l00273"></a><span class="lineno"> 273</span>&#160; <span class="keyword">private</span>:</div>
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span>&#160; <a class="code" href="classmastodonpp_1_1Instance.html">Instance</a> &amp;_instance;</div>
<div class="line"><a name="l00275"></a><span class="lineno"> 275</span>&#160; <span class="keyword">const</span> <span class="keywordtype">string</span> _baseuri;</div>
<div class="line"><a name="l00276"></a><span class="lineno"> 276</span>&#160; <span class="keywordtype">string</span> _scopes;</div>
<div class="line"><a name="l00277"></a><span class="lineno"> 277</span>&#160; <span class="keywordtype">string</span> _client_id;</div>
<div class="line"><a name="l00278"></a><span class="lineno"> 278</span>&#160; <span class="keywordtype">string</span> _client_secret;</div>
<div class="line"><a name="l00279"></a><span class="lineno"> 279</span>&#160; };</div>
<div class="line"><a name="l00280"></a><span class="lineno"> 280</span>&#160; </div>
<div class="line"><a name="l00281"></a><span class="lineno"> 281</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span>&#160; <span class="keyword">const</span> <span class="keywordtype">string</span> _hostname;</div>
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span>&#160; <span class="keyword">const</span> <span class="keywordtype">string</span> _baseuri;</div>
<div class="line"><a name="l00284"></a><span class="lineno"> 284</span>&#160; <span class="keywordtype">string</span> _access_token;</div>
<div class="line"><a name="l00285"></a><span class="lineno"> 285</span>&#160; uint64_t _max_chars;</div>
<div class="line"><a name="l00286"></a><span class="lineno"> 286</span>&#160; <span class="keywordtype">string</span> _proxy;</div>
<div class="line"><a name="l00287"></a><span class="lineno"> 287</span>&#160; vector&lt;string&gt; _post_formats;</div>
<div class="line"><a name="l00288"></a><span class="lineno"> 288</span>&#160; <span class="keywordtype">string</span> _cainfo;</div>
<div class="line"><a name="l00289"></a><span class="lineno"> 289</span>&#160; <span class="keywordtype">string</span> _useragent;</div>
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span>&#160;};</div>
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>&#160; </div>
<div class="line"><a name="l00292"></a><span class="lineno"> 292</span>&#160;} <span class="comment">// namespace mastodonpp</span></div>
<div class="line"><a name="l00293"></a><span class="lineno"> 293</span>&#160; </div>
<div class="line"><a name="l00294"></a><span class="lineno"> 294</span>&#160;<span class="preprocessor">#endif // MASTODONPP_INSTANCE_HPP</span></div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="aclassmastodonpp_1_1Instance_1_1ObtainToken_html"><div class="ttname"><a href="classmastodonpp_1_1Instance_1_1ObtainToken.html">mastodonpp::Instance::ObtainToken</a></div><div class="ttdoc">Simplifies obtaining an OAuth 2.0 Bearer Access Token.</div><div class="ttdef"><b>Definition:</b> instance.hpp:226</div></div>
<div class="ttc" id="aclassmastodonpp_1_1Instance_html_a4d594e1365584a05e5a16fc8aea76e9d"><div class="ttname"><a href="classmastodonpp_1_1Instance.html#a4d594e1365584a05e5a16fc8aea76e9d">mastodonpp::Instance::get_nodeinfo</a></div><div class="ttdeci">answer_type get_nodeinfo()</div><div class="ttdoc">Returns the NodeInfo of the instance.</div></div>
<div class="ttc" id="aclassmastodonpp_1_1Instance_html_a868aae1fae3ad4060759c1325acb3b62"><div class="ttname"><a href="classmastodonpp_1_1Instance.html#a868aae1fae3ad4060759c1325acb3b62">mastodonpp::Instance::get_hostname</a></div><div class="ttdeci">string_view get_hostname() const noexcept</div><div class="ttdoc">Returns the hostname.</div><div class="ttdef"><b>Definition:</b> instance.hpp:86</div></div>
<div class="ttc" id="aclassmastodonpp_1_1Instance_1_1ObtainToken_html_a5bd5d631e2fbb186a9df66d2ac3f5402"><div class="ttname"><a href="classmastodonpp_1_1Instance_1_1ObtainToken.html#a5bd5d631e2fbb186a9df66d2ac3f5402">mastodonpp::Instance::ObtainToken::step_1</a></div><div class="ttdeci">answer_type step_1(string_view client_name, string_view scopes, string_view website)</div><div class="ttdoc">Creates an application via /api/v1/apps.</div></div>
<div class="ttc" id="aclassmastodonpp_1_1Instance_html_a859540ec79ea97c0f76185d9036127bb"><div class="ttname"><a href="classmastodonpp_1_1Instance.html#a859540ec79ea97c0f76185d9036127bb">mastodonpp::Instance::get_baseuri</a></div><div class="ttdeci">string_view get_baseuri() const noexcept</div><div class="ttdoc">Returns the base URI.</div><div class="ttdef"><b>Definition:</b> instance.hpp:99</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:19</div></div>
<div class="ttc" id="aclassmastodonpp_1_1Instance_html_a04dc593589b69f9f71c4acecb39d995a"><div class="ttname"><a href="classmastodonpp_1_1Instance.html#a04dc593589b69f9f71c4acecb39d995a">mastodonpp::Instance::Instance</a></div><div class="ttdeci">Instance(const string_view hostname, const string_view access_token)</div><div class="ttdoc">Construct a new Instance object.</div><div class="ttdef"><b>Definition:</b> instance.hpp:56</div></div>
<div class="ttc" id="aclassmastodonpp_1_1Instance_html_a1e606235a69d150b59bd90c78069de22"><div class="ttname"><a href="classmastodonpp_1_1Instance.html#a1e606235a69d150b59bd90c78069de22">mastodonpp::Instance::set_access_token</a></div><div class="ttdeci">void set_access_token(string access_token)</div><div class="ttdoc">Set OAuth 2.0 Bearer Access Token.</div><div class="ttdef"><b>Definition:</b> instance.hpp:123</div></div>
<div class="ttc" id="aclassmastodonpp_1_1Instance_1_1ObtainToken_html_addda7f4e1ca4200235764707478f6d51"><div class="ttname"><a href="classmastodonpp_1_1Instance_1_1ObtainToken.html#addda7f4e1ca4200235764707478f6d51">mastodonpp::Instance::ObtainToken::step_2</a></div><div class="ttdeci">answer_type step_2(string_view code)</div><div class="ttdoc">Creates a token via /oauth/token.</div></div>
<div class="ttc" id="aclassmastodonpp_1_1CURLWrapper_html_a1564a42794ef7a9d170b725063ef504d"><div class="ttname"><a href="classmastodonpp_1_1CURLWrapper.html#a1564a42794ef7a9d170b725063ef504d">mastodonpp::CURLWrapper::set_proxy</a></div><div class="ttdeci">void set_proxy(string_view proxy)</div><div class="ttdoc">Set the proxy to use.</div><div class="ttdef"><b>Definition:</b> curl_wrapper.cpp:216</div></div>
<div class="ttc" id="aclassmastodonpp_1_1Instance_html_a84b7e4ef6e05f7f7208b557c38b5ad1e"><div class="ttname"><a href="classmastodonpp_1_1Instance.html#a84b7e4ef6e05f7f7208b557c38b5ad1e">mastodonpp::Instance::get_post_formats</a></div><div class="ttdeci">vector&lt; string &gt; get_post_formats() noexcept</div><div class="ttdoc">Returns the allowed mime types for statuses.</div></div>
<div class="ttc" id="aclassmastodonpp_1_1Instance_html_a3d9f535570e6083b7f37b3c5e42c08dd"><div class="ttname"><a href="classmastodonpp_1_1Instance.html#a3d9f535570e6083b7f37b3c5e42c08dd">mastodonpp::Instance::get_max_chars</a></div><div class="ttdeci">uint64_t get_max_chars() noexcept</div><div class="ttdoc">Returns the maximum number of characters per post.</div></div>
<div class="ttc" id="astructmastodonpp_1_1answer__type_html"><div class="ttname"><a href="structmastodonpp_1_1answer__type.html">mastodonpp::answer_type</a></div><div class="ttdoc">Return type for Requests.</div><div class="ttdef"><b>Definition:</b> types.hpp:82</div></div>
<div class="ttc" id="aclassmastodonpp_1_1Instance_html_a4aa276f156e3a770e5fd9cbf5c7c0cd5"><div class="ttname"><a href="classmastodonpp_1_1Instance.html#a4aa276f156e3a770e5fd9cbf5c7c0cd5">mastodonpp::Instance::set_proxy</a></div><div class="ttdeci">void set_proxy(const string_view proxy)</div><div class="ttdoc">Set the proxy to use.</div><div class="ttdef"><b>Definition:</b> instance.hpp:147</div></div>
<div class="ttc" id="aclassmastodonpp_1_1CURLWrapper_html_af3f2bd4dea7c289d590fe19889360444"><div class="ttname"><a href="classmastodonpp_1_1CURLWrapper.html#af3f2bd4dea7c289d590fe19889360444">mastodonpp::CURLWrapper::set_cainfo</a></div><div class="ttdeci">void set_cainfo(string_view path)</div><div class="ttdoc">Set path to Certificate Authority (CA) bundle.</div><div class="ttdef"><b>Definition:</b> curl_wrapper.cpp:252</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 access data of an instance.</div><div class="ttdef"><b>Definition:</b> instance.hpp:45</div></div>
<div class="ttc" id="aclassmastodonpp_1_1Instance_html_af75272092047c8af95cef8dfb3969dfa"><div class="ttname"><a href="classmastodonpp_1_1Instance.html#af75272092047c8af95cef8dfb3969dfa">mastodonpp::Instance::set_cainfo</a></div><div class="ttdeci">void set_cainfo(string_view path)</div><div class="ttdoc">Set path to Certificate Authority (CA) bundle.</div><div class="ttdef"><b>Definition:</b> instance.hpp:186</div></div>
<div class="ttc" id="aclassmastodonpp_1_1CURLWrapper_html"><div class="ttname"><a href="classmastodonpp_1_1CURLWrapper.html">mastodonpp::CURLWrapper</a></div><div class="ttdoc">Handles the details of network connections.</div><div class="ttdef"><b>Definition:</b> curl_wrapper.hpp:58</div></div>
<div class="ttc" id="aclassmastodonpp_1_1Instance_html_aa486bc453907439e33f8402f270ef384"><div class="ttname"><a href="classmastodonpp_1_1Instance.html#aa486bc453907439e33f8402f270ef384">mastodonpp::Instance::copy_connection_properties</a></div><div class="ttdeci">void copy_connection_properties(CURLWrapper &amp;curlwrapper)</div><div class="ttdoc">Set the properties of the connection of the calling class up.</div><div class="ttdef"><b>Definition:</b> instance.hpp:74</div></div>
<div class="ttc" id="aclassmastodonpp_1_1Instance_html_a3fcd68515b1d07a4003bc09180fff904"><div class="ttname"><a href="classmastodonpp_1_1Instance.html#a3fcd68515b1d07a4003bc09180fff904">mastodonpp::Instance::get_access_token</a></div><div class="ttdeci">string_view get_access_token() const noexcept</div><div class="ttdoc">Returns the access token.</div><div class="ttdef"><b>Definition:</b> instance.hpp:110</div></div>
<div class="ttc" id="aclassmastodonpp_1_1CURLWrapper_html_a0059ecb78b53c4b3c941b19f8dc897f7"><div class="ttname"><a href="classmastodonpp_1_1CURLWrapper.html#a0059ecb78b53c4b3c941b19f8dc897f7">mastodonpp::CURLWrapper::setup_connection_properties</a></div><div class="ttdeci">void setup_connection_properties(string_view proxy, string_view access_token, string_view cainfo, string_view useragent)</div><div class="ttdoc">Set some properties of the connection.</div><div class="ttdef"><b>Definition:</b> curl_wrapper.cpp:190</div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.16
</small></address>
</body>
</html>