mastodonpp/docs/connection_8hpp_source.html

235 lines
37 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.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>mastodonpp: include/connection.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.5.7</span>
</div>
<div id="projectbrief">C++ wrapper for the Mastodon and Pleroma APIs.</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<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','.html');
/* @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">connection.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_CONNECTION_HPP</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="preprocessor">#define MASTODONPP_CONNECTION_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;api.hpp&quot;</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;<span class="preprocessor">#include &quot;curl_wrapper.hpp&quot;</span></div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#include &quot;instance.hpp&quot;</span></div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#include &quot;types.hpp&quot;</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160; </div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="preprocessor">#include &lt;string_view&gt;</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &lt;variant&gt;</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160; </div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacemastodonpp.html">mastodonpp</a></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; </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::variant;</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="l00043"></a><span class="lineno"><a class="line" href="namespacemastodonpp.html#ad5d7bf6713e986f130ec200963e0f208"> 43</a></span>&#160;<span class="keyword">using</span> <a class="code" href="namespacemastodonpp.html#ad5d7bf6713e986f130ec200963e0f208">endpoint_variant</a> = variant&lt;API::endpoint_type, string_view&gt;;</div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; </div>
<div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="structmastodonpp_1_1event__type.html"> 52</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structmastodonpp_1_1event__type.html">event_type</a></div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;{</div>
<div class="line"><a name="l00062"></a><span class="lineno"><a class="line" href="structmastodonpp_1_1event__type.html#a193361ac6ffafb474bbc493273a028ce"> 62</a></span>&#160; <span class="keywordtype">string</span> <a class="code" href="structmastodonpp_1_1event__type.html#a193361ac6ffafb474bbc493273a028ce">type</a>;</div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; </div>
<div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="structmastodonpp_1_1event__type.html#af72ad0a57a762c57f0d4e5d650c5d65c"> 65</a></span>&#160; <span class="keywordtype">string</span> <a class="code" href="structmastodonpp_1_1event__type.html#af72ad0a57a762c57f0d4e5d650c5d65c">data</a>;</div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160;};</div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; </div>
<div class="line"><a name="l00078"></a><span class="lineno"><a class="line" href="classmastodonpp_1_1Connection.html"> 78</a></span>&#160;<span class="keyword">class </span><a class="code" href="classmastodonpp_1_1Connection.html">Connection</a> : <span class="keyword">public</span> <a class="code" href="classmastodonpp_1_1CURLWrapper.html">CURLWrapper</a></div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160;{</div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00088"></a><span class="lineno"><a class="line" href="classmastodonpp_1_1Connection.html#ae6fc153679431f14ee98778bbc477cda"> 88</a></span>&#160; <span class="keyword">explicit</span> <a class="code" href="classmastodonpp_1_1Connection.html#ae6fc153679431f14ee98778bbc477cda">Connection</a>(<span class="keyword">const</span> <a class="code" href="classmastodonpp_1_1Instance.html">Instance</a> &amp;instance)</div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; : _instance{instance}</div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; , _baseuri{instance.get_baseuri()}</div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; {</div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; _instance.<a class="code" href="classmastodonpp_1_1Instance.html#a921c4b83815c0d98dea983a9409c00ac">copy_connection_properties</a>(*<span class="keyword">this</span>);</div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; }</div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; </div>
<div class="line"><a name="l00100"></a><span class="lineno"><a class="line" href="classmastodonpp_1_1Connection.html#aa1273c61748ddf364c1cdc28ac9b0a6f"> 100</a></span>&#160; <a class="code" href="classmastodonpp_1_1Connection.html#aa1273c61748ddf364c1cdc28ac9b0a6f">Connection</a>(<span class="keyword">const</span> <a class="code" href="classmastodonpp_1_1Connection.html">Connection</a> &amp;other) = <span class="keywordflow">default</span>;</div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; </div>
<div class="line"><a name="l00103"></a><span class="lineno"><a class="line" href="classmastodonpp_1_1Connection.html#af0d81640b36cdf6eee8897e1d9b31d52"> 103</a></span>&#160; <a class="code" href="classmastodonpp_1_1Connection.html#af0d81640b36cdf6eee8897e1d9b31d52">Connection</a>(<a class="code" href="classmastodonpp_1_1Connection.html">Connection</a> &amp;&amp;other) noexcept = <span class="keyword">delete</span>;</div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; </div>
<div class="line"><a name="l00106"></a><span class="lineno"><a class="line" href="classmastodonpp_1_1Connection.html#a3697f021a84f5cbdd62c9a6fba5eab6a"> 106</a></span>&#160; <a class="code" href="classmastodonpp_1_1Connection.html#a3697f021a84f5cbdd62c9a6fba5eab6a">~Connection</a>() noexcept override = default;</div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; </div>
<div class="line"><a name="l00109"></a><span class="lineno"><a class="line" href="classmastodonpp_1_1Connection.html#a9a3dc7a5015b05ffd5c8dc9be7bc2b5d"> 109</a></span>&#160; <a class="code" href="classmastodonpp_1_1Connection.html">Connection</a> &amp;operator=(const <a class="code" href="classmastodonpp_1_1Connection.html">Connection</a> &amp;other) = delete;</div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; </div>
<div class="line"><a name="l00112"></a><span class="lineno"><a class="line" href="classmastodonpp_1_1Connection.html#abcb013020202d0e37eaa2bd0c64f9558"> 112</a></span>&#160; <a class="code" href="classmastodonpp_1_1Connection.html">Connection</a> &amp;operator=(<a class="code" href="classmastodonpp_1_1Connection.html">Connection</a> &amp;&amp;other) noexcept = delete;</div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; </div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; [[nodiscard]] <a class="code" href="structmastodonpp_1_1answer__type.html">answer_type</a> <a class="code" href="classmastodonpp_1_1Connection.html#ade24a99769313ee15c406d97e9543cba">get</a>(const <a class="code" href="namespacemastodonpp.html#ad5d7bf6713e986f130ec200963e0f208">endpoint_variant</a> &amp;endpoint,</div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; const <a class="code" href="namespacemastodonpp.html#af8b3b89118adeccc71c54dfd36c987f6">parametermap</a> &amp;parameters);</div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; </div>
<div class="line"><a name="l00147"></a><span class="lineno"><a class="line" href="classmastodonpp_1_1Connection.html#a60034eabe75bd3afade110a171c66d05"> 147</a></span>&#160; [[nodiscard]] inline <a class="code" href="structmastodonpp_1_1answer__type.html">answer_type</a> <a class="code" href="classmastodonpp_1_1Connection.html#ade24a99769313ee15c406d97e9543cba">get</a>(const <a class="code" href="namespacemastodonpp.html#ad5d7bf6713e986f130ec200963e0f208">endpoint_variant</a> &amp;endpoint)</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; <span class="keywordflow">return</span> <a class="code" href="classmastodonpp_1_1Connection.html#ade24a99769313ee15c406d97e9543cba">get</a>(endpoint, {});</div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; }</div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; </div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; [[nodiscard]] <a class="code" href="structmastodonpp_1_1answer__type.html">answer_type</a> <a class="code" href="classmastodonpp_1_1Connection.html#ad7cebeeef7c285ff4666dc6850f20164">post</a>(<span class="keyword">const</span> <a class="code" href="namespacemastodonpp.html#ad5d7bf6713e986f130ec200963e0f208">endpoint_variant</a> &amp;endpoint,</div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; <span class="keyword">const</span> <a class="code" href="namespacemastodonpp.html#af8b3b89118adeccc71c54dfd36c987f6">parametermap</a> &amp;parameters);</div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; </div>
<div class="line"><a name="l00182"></a><span class="lineno"><a class="line" href="classmastodonpp_1_1Connection.html#af27eb5d94f5a0e39a703988fdcc54173"> 182</a></span>&#160; [[nodiscard]] <span class="keyword">inline</span> <a class="code" href="structmastodonpp_1_1answer__type.html">answer_type</a> <a class="code" href="classmastodonpp_1_1Connection.html#af27eb5d94f5a0e39a703988fdcc54173">post</a>(<span class="keyword">const</span> <a class="code" href="namespacemastodonpp.html#ad5d7bf6713e986f130ec200963e0f208">endpoint_variant</a> &amp;endpoint)</div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160; {</div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160; <span class="keywordflow">return</span> <a class="code" href="classmastodonpp_1_1Connection.html#ad7cebeeef7c285ff4666dc6850f20164">post</a>(endpoint, {});</div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; }</div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; </div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160; [[nodiscard]] <a class="code" href="structmastodonpp_1_1answer__type.html">answer_type</a> <a class="code" href="classmastodonpp_1_1Connection.html#a10f838c74d2ccc83f64f29e2aad2f157">patch</a>(<span class="keyword">const</span> <a class="code" href="namespacemastodonpp.html#ad5d7bf6713e986f130ec200963e0f208">endpoint_variant</a> &amp;endpoint,</div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160; <span class="keyword">const</span> <a class="code" href="namespacemastodonpp.html#af8b3b89118adeccc71c54dfd36c987f6">parametermap</a> &amp;parameters);</div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160; </div>
<div class="line"><a name="l00206"></a><span class="lineno"><a class="line" href="classmastodonpp_1_1Connection.html#a3f1e0440b68a44cf678bfdbe33295197"> 206</a></span>&#160; [[nodiscard]] <span class="keyword">inline</span> <a class="code" href="structmastodonpp_1_1answer__type.html">answer_type</a> <a class="code" href="classmastodonpp_1_1Connection.html#a3f1e0440b68a44cf678bfdbe33295197">patch</a>(<span class="keyword">const</span> <a class="code" href="namespacemastodonpp.html#ad5d7bf6713e986f130ec200963e0f208">endpoint_variant</a> &amp;endpoint)</div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160; {</div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160; <span class="keywordflow">return</span> <a class="code" href="classmastodonpp_1_1Connection.html#a10f838c74d2ccc83f64f29e2aad2f157">patch</a>(endpoint, {});</div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160; }</div>
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160; </div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160; [[nodiscard]] <a class="code" href="structmastodonpp_1_1answer__type.html">answer_type</a> <a class="code" href="classmastodonpp_1_1Connection.html#ac5afc2e5d419c8bee3a8994ce0a940aa">put</a>(<span class="keyword">const</span> <a class="code" href="namespacemastodonpp.html#ad5d7bf6713e986f130ec200963e0f208">endpoint_variant</a> &amp;endpoint,</div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160; <span class="keyword">const</span> <a class="code" href="namespacemastodonpp.html#af8b3b89118adeccc71c54dfd36c987f6">parametermap</a> &amp;parameters);</div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160; </div>
<div class="line"><a name="l00230"></a><span class="lineno"><a class="line" href="classmastodonpp_1_1Connection.html#ad05ff1b33460bfedf0b46f4e5e755399"> 230</a></span>&#160; [[nodiscard]] <span class="keyword">inline</span> <a class="code" href="structmastodonpp_1_1answer__type.html">answer_type</a> <a class="code" href="classmastodonpp_1_1Connection.html#ad05ff1b33460bfedf0b46f4e5e755399">put</a>(<span class="keyword">const</span> <a class="code" href="namespacemastodonpp.html#ad5d7bf6713e986f130ec200963e0f208">endpoint_variant</a> &amp;endpoint)</div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160; {</div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160; <span class="keywordflow">return</span> <a class="code" href="classmastodonpp_1_1Connection.html#ac5afc2e5d419c8bee3a8994ce0a940aa">put</a>(endpoint, {});</div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160; }</div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160; </div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160; [[nodiscard]] <a class="code" href="structmastodonpp_1_1answer__type.html">answer_type</a> <a class="code" href="classmastodonpp_1_1Connection.html#a095f752558410fab3dee6782e03a0fdb">del</a>(<span class="keyword">const</span> <a class="code" href="namespacemastodonpp.html#ad5d7bf6713e986f130ec200963e0f208">endpoint_variant</a> &amp;endpoint,</div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160; <span class="keyword">const</span> <a class="code" href="namespacemastodonpp.html#af8b3b89118adeccc71c54dfd36c987f6">parametermap</a> &amp;parameters);</div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160; </div>
<div class="line"><a name="l00254"></a><span class="lineno"><a class="line" href="classmastodonpp_1_1Connection.html#a2e89f60fdf4096ff8c8251e61ab59d13"> 254</a></span>&#160; [[nodiscard]] <span class="keyword">inline</span> <a class="code" href="structmastodonpp_1_1answer__type.html">answer_type</a> <a class="code" href="classmastodonpp_1_1Connection.html#a2e89f60fdf4096ff8c8251e61ab59d13">del</a>(<span class="keyword">const</span> <a class="code" href="namespacemastodonpp.html#ad5d7bf6713e986f130ec200963e0f208">endpoint_variant</a> &amp;endpoint)</div>
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span>&#160; {</div>
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>&#160; <span class="keywordflow">return</span> <a class="code" href="classmastodonpp_1_1Connection.html#a095f752558410fab3dee6782e03a0fdb">del</a>(endpoint, {});</div>
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>&#160; }</div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>&#160; </div>
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>&#160; <span class="keywordtype">string</span> <a class="code" href="classmastodonpp_1_1Connection.html#a06f537c75c7fe9a7510e11af1008e028">get_new_stream_contents</a>();</div>
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span>&#160; </div>
<div class="line"><a name="l00277"></a><span class="lineno"> 277</span>&#160; vector&lt;event_type&gt; <a class="code" href="classmastodonpp_1_1Connection.html#a7e4a50fb73aa50b027d9a0822cfde318">get_new_events</a>();</div>
<div class="line"><a name="l00278"></a><span class="lineno"> 278</span>&#160; </div>
<div class="line"><a name="l00280"></a><span class="lineno"><a class="line" href="classmastodonpp_1_1Connection.html#a8cf6ab350bb359650925d1c582fe9f60"> 280</a></span>&#160; <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmastodonpp_1_1Connection.html#a8cf6ab350bb359650925d1c582fe9f60">cancel_stream</a>()</div>
<div class="line"><a name="l00281"></a><span class="lineno"> 281</span>&#160; {</div>
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span>&#160; <a class="code" href="classmastodonpp_1_1CURLWrapper.html#a892a4fc3d048798fa8e2584545b91861">CURLWrapper::cancel_stream</a>();</div>
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span>&#160; }</div>
<div class="line"><a name="l00284"></a><span class="lineno"> 284</span>&#160; </div>
<div class="line"><a name="l00285"></a><span class="lineno"> 285</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00286"></a><span class="lineno"> 286</span>&#160; <span class="keyword">const</span> <a class="code" href="classmastodonpp_1_1Instance.html">Instance</a> &amp;_instance;</div>
<div class="line"><a name="l00287"></a><span class="lineno"> 287</span>&#160; <span class="keyword">const</span> string_view _baseuri;</div>
<div class="line"><a name="l00288"></a><span class="lineno"> 288</span>&#160; </div>
<div class="line"><a name="l00289"></a><span class="lineno"> 289</span>&#160; [[nodiscard]] <span class="keywordtype">string</span></div>
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span>&#160; endpoint_to_uri(<span class="keyword">const</span> <a class="code" href="namespacemastodonpp.html#ad5d7bf6713e986f130ec200963e0f208">endpoint_variant</a> &amp;endpoint) <span class="keyword">const</span>;</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; </div>
<div class="line"><a name="l00293"></a><span class="lineno"> 293</span>&#160;} <span class="comment">// namespace mastodonpp</span></div>
<div class="line"><a name="l00294"></a><span class="lineno"> 294</span>&#160; </div>
<div class="line"><a name="l00295"></a><span class="lineno"> 295</span>&#160;<span class="preprocessor">#endif </span><span class="comment">// MASTODONPP_CONNECTION_HPP</span></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_1CURLWrapper_html_a892a4fc3d048798fa8e2584545b91861"><div class="ttname"><a href="classmastodonpp_1_1CURLWrapper.html#a892a4fc3d048798fa8e2584545b91861">mastodonpp::CURLWrapper::cancel_stream</a></div><div class="ttdeci">void cancel_stream()</div><div class="ttdoc">Cancel the stream.</div><div class="ttdef"><b>Definition:</b> curl_wrapper.hpp:209</div></div>
<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:79</div></div>
<div class="ttc" id="aclassmastodonpp_1_1Connection_html_a06f537c75c7fe9a7510e11af1008e028"><div class="ttname"><a href="classmastodonpp_1_1Connection.html#a06f537c75c7fe9a7510e11af1008e028">mastodonpp::Connection::get_new_stream_contents</a></div><div class="ttdeci">string get_new_stream_contents()</div><div class="ttdoc">Copy new stream contents and delete the “original”.</div><div class="ttdef"><b>Definition:</b> connection.cpp:69</div></div>
<div class="ttc" id="aclassmastodonpp_1_1Connection_html_a095f752558410fab3dee6782e03a0fdb"><div class="ttname"><a href="classmastodonpp_1_1Connection.html#a095f752558410fab3dee6782e03a0fdb">mastodonpp::Connection::del</a></div><div class="ttdeci">answer_type del(const endpoint_variant &amp;endpoint, const parametermap &amp;parameters)</div><div class="ttdoc">Make a HTTP DELETE call with parameters.</div><div class="ttdef"><b>Definition:</b> connection.cpp:62</div></div>
<div class="ttc" id="aclassmastodonpp_1_1Connection_html_a10f838c74d2ccc83f64f29e2aad2f157"><div class="ttname"><a href="classmastodonpp_1_1Connection.html#a10f838c74d2ccc83f64f29e2aad2f157">mastodonpp::Connection::patch</a></div><div class="ttdeci">answer_type patch(const endpoint_variant &amp;endpoint, const parametermap &amp;parameters)</div><div class="ttdoc">Make a HTTP PATCH call with parameters.</div><div class="ttdef"><b>Definition:</b> connection.cpp:48</div></div>
<div class="ttc" id="aclassmastodonpp_1_1Connection_html_a2e89f60fdf4096ff8c8251e61ab59d13"><div class="ttname"><a href="classmastodonpp_1_1Connection.html#a2e89f60fdf4096ff8c8251e61ab59d13">mastodonpp::Connection::del</a></div><div class="ttdeci">answer_type del(const endpoint_variant &amp;endpoint)</div><div class="ttdoc">Make a HTTP DELETE call.</div><div class="ttdef"><b>Definition:</b> connection.hpp:254</div></div>
<div class="ttc" id="aclassmastodonpp_1_1Connection_html_a3697f021a84f5cbdd62c9a6fba5eab6a"><div class="ttname"><a href="classmastodonpp_1_1Connection.html#a3697f021a84f5cbdd62c9a6fba5eab6a">mastodonpp::Connection::~Connection</a></div><div class="ttdeci">~Connection() noexcept override=default</div><div class="ttdoc">Destructor.</div></div>
<div class="ttc" id="aclassmastodonpp_1_1Connection_html_a3f1e0440b68a44cf678bfdbe33295197"><div class="ttname"><a href="classmastodonpp_1_1Connection.html#a3f1e0440b68a44cf678bfdbe33295197">mastodonpp::Connection::patch</a></div><div class="ttdeci">answer_type patch(const endpoint_variant &amp;endpoint)</div><div class="ttdoc">Make a HTTP PATCH call.</div><div class="ttdef"><b>Definition:</b> connection.hpp:206</div></div>
<div class="ttc" id="aclassmastodonpp_1_1Connection_html_a7e4a50fb73aa50b027d9a0822cfde318"><div class="ttname"><a href="classmastodonpp_1_1Connection.html#a7e4a50fb73aa50b027d9a0822cfde318">mastodonpp::Connection::get_new_events</a></div><div class="ttdeci">vector&lt; event_type &gt; get_new_events()</div><div class="ttdoc">Get new stream events.</div><div class="ttdef"><b>Definition:</b> connection.cpp:79</div></div>
<div class="ttc" id="aclassmastodonpp_1_1Connection_html_a8cf6ab350bb359650925d1c582fe9f60"><div class="ttname"><a href="classmastodonpp_1_1Connection.html#a8cf6ab350bb359650925d1c582fe9f60">mastodonpp::Connection::cancel_stream</a></div><div class="ttdeci">void cancel_stream()</div><div class="ttdoc">Cancel the stream.</div><div class="ttdef"><b>Definition:</b> connection.hpp:280</div></div>
<div class="ttc" id="aclassmastodonpp_1_1Connection_html_aa1273c61748ddf364c1cdc28ac9b0a6f"><div class="ttname"><a href="classmastodonpp_1_1Connection.html#aa1273c61748ddf364c1cdc28ac9b0a6f">mastodonpp::Connection::Connection</a></div><div class="ttdeci">Connection(const Connection &amp;other)=default</div><div class="ttdoc">Copy constructor. A new CURLWrapper is constructed.</div></div>
<div class="ttc" id="aclassmastodonpp_1_1Connection_html_ac5afc2e5d419c8bee3a8994ce0a940aa"><div class="ttname"><a href="classmastodonpp_1_1Connection.html#ac5afc2e5d419c8bee3a8994ce0a940aa">mastodonpp::Connection::put</a></div><div class="ttdeci">answer_type put(const endpoint_variant &amp;endpoint, const parametermap &amp;parameters)</div><div class="ttdoc">Make a HTTP PUT call with parameters.</div><div class="ttdef"><b>Definition:</b> connection.cpp:55</div></div>
<div class="ttc" id="aclassmastodonpp_1_1Connection_html_ad05ff1b33460bfedf0b46f4e5e755399"><div class="ttname"><a href="classmastodonpp_1_1Connection.html#ad05ff1b33460bfedf0b46f4e5e755399">mastodonpp::Connection::put</a></div><div class="ttdeci">answer_type put(const endpoint_variant &amp;endpoint)</div><div class="ttdoc">Make a HTTP PUT call.</div><div class="ttdef"><b>Definition:</b> connection.hpp:230</div></div>
<div class="ttc" id="aclassmastodonpp_1_1Connection_html_ad7cebeeef7c285ff4666dc6850f20164"><div class="ttname"><a href="classmastodonpp_1_1Connection.html#ad7cebeeef7c285ff4666dc6850f20164">mastodonpp::Connection::post</a></div><div class="ttdeci">answer_type post(const endpoint_variant &amp;endpoint, const parametermap &amp;parameters)</div><div class="ttdoc">Make a HTTP POST call with parameters.</div><div class="ttdef"><b>Definition:</b> connection.cpp:41</div></div>
<div class="ttc" id="aclassmastodonpp_1_1Connection_html_ade24a99769313ee15c406d97e9543cba"><div class="ttname"><a href="classmastodonpp_1_1Connection.html#ade24a99769313ee15c406d97e9543cba">mastodonpp::Connection::get</a></div><div class="ttdeci">answer_type get(const endpoint_variant &amp;endpoint, const parametermap &amp;parameters)</div><div class="ttdoc">Make a HTTP GET call with parameters.</div><div class="ttdef"><b>Definition:</b> connection.cpp:34</div></div>
<div class="ttc" id="aclassmastodonpp_1_1Connection_html_ae6fc153679431f14ee98778bbc477cda"><div class="ttname"><a href="classmastodonpp_1_1Connection.html#ae6fc153679431f14ee98778bbc477cda">mastodonpp::Connection::Connection</a></div><div class="ttdeci">Connection(const Instance &amp;instance)</div><div class="ttdoc">Construct a new Connection object.</div><div class="ttdef"><b>Definition:</b> connection.hpp:88</div></div>
<div class="ttc" id="aclassmastodonpp_1_1Connection_html_af0d81640b36cdf6eee8897e1d9b31d52"><div class="ttname"><a href="classmastodonpp_1_1Connection.html#af0d81640b36cdf6eee8897e1d9b31d52">mastodonpp::Connection::Connection</a></div><div class="ttdeci">Connection(Connection &amp;&amp;other) noexcept=delete</div><div class="ttdoc">Move constructor.</div></div>
<div class="ttc" id="aclassmastodonpp_1_1Connection_html_af27eb5d94f5a0e39a703988fdcc54173"><div class="ttname"><a href="classmastodonpp_1_1Connection.html#af27eb5d94f5a0e39a703988fdcc54173">mastodonpp::Connection::post</a></div><div class="ttdeci">answer_type post(const endpoint_variant &amp;endpoint)</div><div class="ttdoc">Make a HTTP POST call.</div><div class="ttdef"><b>Definition:</b> connection.hpp:182</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:49</div></div>
<div class="ttc" id="aclassmastodonpp_1_1Instance_html_a921c4b83815c0d98dea983a9409c00ac"><div class="ttname"><a href="classmastodonpp_1_1Instance.html#a921c4b83815c0d98dea983a9409c00ac">mastodonpp::Instance::copy_connection_properties</a></div><div class="ttdeci">void copy_connection_properties(CURLWrapper &amp;curlwrapper) const</div><div class="ttdoc">Set the properties of the connection of the calling class up.</div><div class="ttdef"><b>Definition:</b> instance.hpp:90</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.hpp:25</div></div>
<div class="ttc" id="anamespacemastodonpp_html_ad5d7bf6713e986f130ec200963e0f208"><div class="ttname"><a href="namespacemastodonpp.html#ad5d7bf6713e986f130ec200963e0f208">mastodonpp::endpoint_variant</a></div><div class="ttdeci">variant&lt; API::endpoint_type, string_view &gt; endpoint_variant</div><div class="ttdoc">An endpoint. Either API::endpoint_type or std::string_view.</div><div class="ttdef"><b>Definition:</b> connection.hpp:43</div></div>
<div class="ttc" id="anamespacemastodonpp_html_af8b3b89118adeccc71c54dfd36c987f6"><div class="ttname"><a href="namespacemastodonpp.html#af8b3b89118adeccc71c54dfd36c987f6">mastodonpp::parametermap</a></div><div class="ttdeci">map&lt; string_view, variant&lt; string_view, vector&lt; string_view &gt; &gt;&gt; parametermap</div><div class="ttdoc">std::map of parameters for API calls.</div><div class="ttdef"><b>Definition:</b> types.hpp:64</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:80</div></div>
<div class="ttc" id="astructmastodonpp_1_1event__type_html"><div class="ttname"><a href="structmastodonpp_1_1event__type.html">mastodonpp::event_type</a></div><div class="ttdoc">A stream event.</div><div class="ttdef"><b>Definition:</b> connection.hpp:53</div></div>
<div class="ttc" id="astructmastodonpp_1_1event__type_html_a193361ac6ffafb474bbc493273a028ce"><div class="ttname"><a href="structmastodonpp_1_1event__type.html#a193361ac6ffafb474bbc493273a028ce">mastodonpp::event_type::type</a></div><div class="ttdeci">string type</div><div class="ttdoc">The type of the event.</div><div class="ttdef"><b>Definition:</b> connection.hpp:62</div></div>
<div class="ttc" id="astructmastodonpp_1_1event__type_html_af72ad0a57a762c57f0d4e5d650c5d65c"><div class="ttname"><a href="structmastodonpp_1_1event__type.html#af72ad0a57a762c57f0d4e5d650c5d65c">mastodonpp::event_type::data</a></div><div class="ttdeci">string data</div><div class="ttdoc">The payload.</div><div class="ttdef"><b>Definition:</b> connection.hpp:65</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
</small></address>
</body>
</html>