tastytea
1a6dd5fae7
# # Previous commits: #d452daa
2020-11-13 # # Previous commits: #73648eb
2020-11-13 #a028edd
2020-03-21 #0cbf498
2020-03-21 #e6478b1
2020-03-12 #73648eb
2020-11-13 #a028edd
2020-03-21 #0cbf498
2020-03-21
326 lines
33 KiB
HTML
326 lines
33 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.17"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>mastodonpp: mastodonpp::Instance::ObtainToken Class 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.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.8.17 -->
|
|
<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>
|
|
<!-- 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="namespacemastodonpp.html">mastodonpp</a></li><li class="navelem"><a class="el" href="classmastodonpp_1_1Instance.html">Instance</a></li><li class="navelem"><a class="el" href="classmastodonpp_1_1Instance_1_1ObtainToken.html">ObtainToken</a></li> </ul>
|
|
</div>
|
|
</div><!-- top -->
|
|
<div class="header">
|
|
<div class="summary">
|
|
<a href="#pub-methods">Public Member Functions</a> |
|
|
<a href="classmastodonpp_1_1Instance_1_1ObtainToken-members.html">List of all members</a> </div>
|
|
<div class="headertitle">
|
|
<div class="title">mastodonpp::Instance::ObtainToken Class Reference</div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
|
|
<p>Simplifies obtaining an OAuth 2.0 Bearer Access Token.
|
|
<a href="classmastodonpp_1_1Instance_1_1ObtainToken.html#details">More...</a></p>
|
|
|
|
<p><code>#include <<a class="el" href="instance_8hpp_source.html">mastodonpp/instance.hpp</a>></code></p>
|
|
<div class="dynheader">
|
|
Inheritance diagram for mastodonpp::Instance::ObtainToken:</div>
|
|
<div class="dyncontent">
|
|
<div class="center"><img src="classmastodonpp_1_1Instance_1_1ObtainToken__inherit__graph.png" border="0" usemap="#mastodonpp_1_1Instance_1_1ObtainToken_inherit__map" alt="Inheritance graph"/></div>
|
|
<map name="mastodonpp_1_1Instance_1_1ObtainToken_inherit__map" id="mastodonpp_1_1Instance_1_1ObtainToken_inherit__map">
|
|
<area shape="rect" title="Simplifies obtaining an OAuth 2.0 Bearer Access Token." alt="" coords="23,80,174,121"/>
|
|
<area shape="rect" href="classmastodonpp_1_1CURLWrapper.html" title="Handles the details of network connections." alt="" coords="5,5,192,32"/>
|
|
</map>
|
|
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
|
|
<div class="dynheader">
|
|
Collaboration diagram for mastodonpp::Instance::ObtainToken:</div>
|
|
<div class="dyncontent">
|
|
<div class="center"><img src="classmastodonpp_1_1Instance_1_1ObtainToken__coll__graph.png" border="0" usemap="#mastodonpp_1_1Instance_1_1ObtainToken_coll__map" alt="Collaboration graph"/></div>
|
|
<map name="mastodonpp_1_1Instance_1_1ObtainToken_coll__map" id="mastodonpp_1_1Instance_1_1ObtainToken_coll__map">
|
|
<area shape="rect" title="Simplifies obtaining an OAuth 2.0 Bearer Access Token." alt="" coords="23,171,174,212"/>
|
|
<area shape="rect" href="classmastodonpp_1_1CURLWrapper.html" title="Handles the details of network connections." alt="" coords="5,95,192,121"/>
|
|
<area shape="rect" title="STL class." alt="" coords="57,5,141,32"/>
|
|
</map>
|
|
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
|
|
<table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
|
|
Public Member Functions</h2></td></tr>
|
|
<tr class="memitem:aa834d9be223856e5711b0e14d9b92eed"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmastodonpp_1_1Instance_1_1ObtainToken.html#aa834d9be223856e5711b0e14d9b92eed">ObtainToken</a> (<a class="el" href="classmastodonpp_1_1Instance.html">Instance</a> &instance)</td></tr>
|
|
<tr class="memdesc:aa834d9be223856e5711b0e14d9b92eed"><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <a href="classmastodonpp_1_1Instance_1_1ObtainToken.html#aa834d9be223856e5711b0e14d9b92eed">More...</a><br /></td></tr>
|
|
<tr class="separator:aa834d9be223856e5711b0e14d9b92eed"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a5bd5d631e2fbb186a9df66d2ac3f5402"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structmastodonpp_1_1answer__type.html">answer_type</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmastodonpp_1_1Instance_1_1ObtainToken.html#a5bd5d631e2fbb186a9df66d2ac3f5402">step_1</a> (string_view client_name, string_view scopes, string_view website)</td></tr>
|
|
<tr class="memdesc:a5bd5d631e2fbb186a9df66d2ac3f5402"><td class="mdescLeft"> </td><td class="mdescRight">Creates an application via <code>/api/v1/apps</code>. <a href="classmastodonpp_1_1Instance_1_1ObtainToken.html#a5bd5d631e2fbb186a9df66d2ac3f5402">More...</a><br /></td></tr>
|
|
<tr class="separator:a5bd5d631e2fbb186a9df66d2ac3f5402"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:addda7f4e1ca4200235764707478f6d51"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structmastodonpp_1_1answer__type.html">answer_type</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmastodonpp_1_1Instance_1_1ObtainToken.html#addda7f4e1ca4200235764707478f6d51">step_2</a> (string_view code)</td></tr>
|
|
<tr class="memdesc:addda7f4e1ca4200235764707478f6d51"><td class="mdescLeft"> </td><td class="mdescRight">Creates a token via <code>/oauth/token</code>. <a href="classmastodonpp_1_1Instance_1_1ObtainToken.html#addda7f4e1ca4200235764707478f6d51">More...</a><br /></td></tr>
|
|
<tr class="separator:addda7f4e1ca4200235764707478f6d51"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="inherit_header pub_methods_classmastodonpp_1_1CURLWrapper"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classmastodonpp_1_1CURLWrapper')"><img src="closed.png" alt="-"/> Public Member Functions inherited from <a class="el" href="classmastodonpp_1_1CURLWrapper.html">mastodonpp::CURLWrapper</a></td></tr>
|
|
<tr class="memitem:a736572303fbec7a307514e611e6a468c inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmastodonpp_1_1CURLWrapper.html#a736572303fbec7a307514e611e6a468c">CURLWrapper</a> ()</td></tr>
|
|
<tr class="memdesc:a736572303fbec7a307514e611e6a468c inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="mdescLeft"> </td><td class="mdescRight">Initializes curl and sets up connection. <a href="classmastodonpp_1_1CURLWrapper.html#a736572303fbec7a307514e611e6a468c">More...</a><br /></td></tr>
|
|
<tr class="separator:a736572303fbec7a307514e611e6a468c inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a6885296f3807f446963b2f32b298f051 inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmastodonpp_1_1CURLWrapper.html#a6885296f3807f446963b2f32b298f051">CURLWrapper</a> (const <a class="el" href="classmastodonpp_1_1CURLWrapper.html">CURLWrapper</a> &)</td></tr>
|
|
<tr class="memdesc:a6885296f3807f446963b2f32b298f051 inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="mdescLeft"> </td><td class="mdescRight">Copy constructor. Does the same as the Constructor. <a href="classmastodonpp_1_1CURLWrapper.html#a6885296f3807f446963b2f32b298f051">More...</a><br /></td></tr>
|
|
<tr class="separator:a6885296f3807f446963b2f32b298f051 inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a4d79b9a4525ac4b4b8954ccc794af0f9 inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmastodonpp_1_1CURLWrapper.html#a4d79b9a4525ac4b4b8954ccc794af0f9">CURLWrapper</a> (<a class="el" href="classmastodonpp_1_1CURLWrapper.html">CURLWrapper</a> &&other) noexcept=delete</td></tr>
|
|
<tr class="memdesc:a4d79b9a4525ac4b4b8954ccc794af0f9 inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="mdescLeft"> </td><td class="mdescRight">Move constructor. <a href="classmastodonpp_1_1CURLWrapper.html#a4d79b9a4525ac4b4b8954ccc794af0f9">More...</a><br /></td></tr>
|
|
<tr class="separator:a4d79b9a4525ac4b4b8954ccc794af0f9 inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a350f7061c9cb54cb5992ae983db3fc19 inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classmastodonpp_1_1CURLWrapper.html#a350f7061c9cb54cb5992ae983db3fc19">~CURLWrapper</a> () noexcept</td></tr>
|
|
<tr class="memdesc:a350f7061c9cb54cb5992ae983db3fc19 inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="mdescLeft"> </td><td class="mdescRight">Cleans up curl and connection. <a href="classmastodonpp_1_1CURLWrapper.html#a350f7061c9cb54cb5992ae983db3fc19">More...</a><br /></td></tr>
|
|
<tr class="separator:a350f7061c9cb54cb5992ae983db3fc19 inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a5f29b7f4d0b58f70bc96f362cdaa4d0a inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmastodonpp_1_1CURLWrapper.html">CURLWrapper</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classmastodonpp_1_1CURLWrapper.html#a5f29b7f4d0b58f70bc96f362cdaa4d0a">operator=</a> (const <a class="el" href="classmastodonpp_1_1CURLWrapper.html">CURLWrapper</a> &other)=delete</td></tr>
|
|
<tr class="memdesc:a5f29b7f4d0b58f70bc96f362cdaa4d0a inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="mdescLeft"> </td><td class="mdescRight">Copy assignment operator. <a href="classmastodonpp_1_1CURLWrapper.html#a5f29b7f4d0b58f70bc96f362cdaa4d0a">More...</a><br /></td></tr>
|
|
<tr class="separator:a5f29b7f4d0b58f70bc96f362cdaa4d0a inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a506cb49c00a63ef4b9d51d0d52c203dc inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmastodonpp_1_1CURLWrapper.html">CURLWrapper</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classmastodonpp_1_1CURLWrapper.html#a506cb49c00a63ef4b9d51d0d52c203dc">operator=</a> (<a class="el" href="classmastodonpp_1_1CURLWrapper.html">CURLWrapper</a> &&other) noexcept=delete</td></tr>
|
|
<tr class="memdesc:a506cb49c00a63ef4b9d51d0d52c203dc inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="mdescLeft"> </td><td class="mdescRight">Move assignment operator. <a href="classmastodonpp_1_1CURLWrapper.html#a506cb49c00a63ef4b9d51d0d52c203dc">More...</a><br /></td></tr>
|
|
<tr class="separator:a506cb49c00a63ef4b9d51d0d52c203dc inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a2b7aaf03245a0730eeb464802168aded inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="memItemLeft" align="right" valign="top">CURL * </td><td class="memItemRight" valign="bottom"><a class="el" href="classmastodonpp_1_1CURLWrapper.html#a2b7aaf03245a0730eeb464802168aded">get_curl_easy_handle</a> ()</td></tr>
|
|
<tr class="memdesc:a2b7aaf03245a0730eeb464802168aded inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="mdescLeft"> </td><td class="mdescRight">Returns pointer to the CURL easy handle. <a href="classmastodonpp_1_1CURLWrapper.html#a2b7aaf03245a0730eeb464802168aded">More...</a><br /></td></tr>
|
|
<tr class="separator:a2b7aaf03245a0730eeb464802168aded inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a11a543a0821a275dfce1ad7a0e68b17f inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="memItemLeft" align="right" valign="top">string </td><td class="memItemRight" valign="bottom"><a class="el" href="classmastodonpp_1_1CURLWrapper.html#a11a543a0821a275dfce1ad7a0e68b17f">escape_url</a> (const string_view url) const</td></tr>
|
|
<tr class="memdesc:a11a543a0821a275dfce1ad7a0e68b17f inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="mdescLeft"> </td><td class="mdescRight">URL encodes the given string. <a href="classmastodonpp_1_1CURLWrapper.html#a11a543a0821a275dfce1ad7a0e68b17f">More...</a><br /></td></tr>
|
|
<tr class="separator:a11a543a0821a275dfce1ad7a0e68b17f inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aed6d09b5c32d71276a851ddf321b5891 inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="memItemLeft" align="right" valign="top">string </td><td class="memItemRight" valign="bottom"><a class="el" href="classmastodonpp_1_1CURLWrapper.html#aed6d09b5c32d71276a851ddf321b5891">unescape_url</a> (const string_view url) const</td></tr>
|
|
<tr class="memdesc:aed6d09b5c32d71276a851ddf321b5891 inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="mdescLeft"> </td><td class="mdescRight">URL decodes the given string. <a href="classmastodonpp_1_1CURLWrapper.html#aed6d09b5c32d71276a851ddf321b5891">More...</a><br /></td></tr>
|
|
<tr class="separator:aed6d09b5c32d71276a851ddf321b5891 inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a0059ecb78b53c4b3c941b19f8dc897f7 inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmastodonpp_1_1CURLWrapper.html#a0059ecb78b53c4b3c941b19f8dc897f7">setup_connection_properties</a> (string_view proxy, string_view access_token, string_view cainfo, string_view useragent)</td></tr>
|
|
<tr class="memdesc:a0059ecb78b53c4b3c941b19f8dc897f7 inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="mdescLeft"> </td><td class="mdescRight">Set some properties of the connection. <a href="classmastodonpp_1_1CURLWrapper.html#a0059ecb78b53c4b3c941b19f8dc897f7">More...</a><br /></td></tr>
|
|
<tr class="separator:a0059ecb78b53c4b3c941b19f8dc897f7 inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="inherited"></a>
|
|
Additional Inherited Members</h2></td></tr>
|
|
<tr class="inherit_header pro_methods_classmastodonpp_1_1CURLWrapper"><td colspan="2" onclick="javascript:toggleInherit('pro_methods_classmastodonpp_1_1CURLWrapper')"><img src="closed.png" alt="-"/> Protected Member Functions inherited from <a class="el" href="classmastodonpp_1_1CURLWrapper.html">mastodonpp::CURLWrapper</a></td></tr>
|
|
<tr class="memitem:adc8808c3fad5397176f6755b09ee0be6 inherit pro_methods_classmastodonpp_1_1CURLWrapper"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structmastodonpp_1_1answer__type.html">answer_type</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmastodonpp_1_1CURLWrapper.html#adc8808c3fad5397176f6755b09ee0be6">make_request</a> (const <a class="el" href="namespacemastodonpp.html#a7d60fc71ad0fb1fbd467b37fe1f1f100">http_method</a> &method, string uri, const <a class="el" href="namespacemastodonpp.html#af8b3b89118adeccc71c54dfd36c987f6">parametermap</a> &parameters)</td></tr>
|
|
<tr class="memdesc:adc8808c3fad5397176f6755b09ee0be6 inherit pro_methods_classmastodonpp_1_1CURLWrapper"><td class="mdescLeft"> </td><td class="mdescRight">Make a HTTP request. <a href="classmastodonpp_1_1CURLWrapper.html#adc8808c3fad5397176f6755b09ee0be6">More...</a><br /></td></tr>
|
|
<tr class="separator:adc8808c3fad5397176f6755b09ee0be6 inherit pro_methods_classmastodonpp_1_1CURLWrapper"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a04b3919cfb38716c5a032337e442db95 inherit pro_methods_classmastodonpp_1_1CURLWrapper"><td class="memItemLeft" align="right" valign="top">string & </td><td class="memItemRight" valign="bottom"><a class="el" href="classmastodonpp_1_1CURLWrapper.html#a04b3919cfb38716c5a032337e442db95">get_buffer</a> ()</td></tr>
|
|
<tr class="memdesc:a04b3919cfb38716c5a032337e442db95 inherit pro_methods_classmastodonpp_1_1CURLWrapper"><td class="mdescLeft"> </td><td class="mdescRight">Returns a reference to the buffer libcurl writes into. <a href="classmastodonpp_1_1CURLWrapper.html#a04b3919cfb38716c5a032337e442db95">More...</a><br /></td></tr>
|
|
<tr class="separator:a04b3919cfb38716c5a032337e442db95 inherit pro_methods_classmastodonpp_1_1CURLWrapper"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a892a4fc3d048798fa8e2584545b91861 inherit pro_methods_classmastodonpp_1_1CURLWrapper"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmastodonpp_1_1CURLWrapper.html#a892a4fc3d048798fa8e2584545b91861">cancel_stream</a> ()</td></tr>
|
|
<tr class="memdesc:a892a4fc3d048798fa8e2584545b91861 inherit pro_methods_classmastodonpp_1_1CURLWrapper"><td class="mdescLeft"> </td><td class="mdescRight">Cancel the stream. <a href="classmastodonpp_1_1CURLWrapper.html#a892a4fc3d048798fa8e2584545b91861">More...</a><br /></td></tr>
|
|
<tr class="separator:a892a4fc3d048798fa8e2584545b91861 inherit pro_methods_classmastodonpp_1_1CURLWrapper"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a1564a42794ef7a9d170b725063ef504d inherit pro_methods_classmastodonpp_1_1CURLWrapper"><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmastodonpp_1_1CURLWrapper.html#a1564a42794ef7a9d170b725063ef504d">set_proxy</a> (string_view proxy)</td></tr>
|
|
<tr class="memdesc:a1564a42794ef7a9d170b725063ef504d inherit pro_methods_classmastodonpp_1_1CURLWrapper"><td class="mdescLeft"> </td><td class="mdescRight">Set the proxy to use. <a href="classmastodonpp_1_1CURLWrapper.html#a1564a42794ef7a9d170b725063ef504d">More...</a><br /></td></tr>
|
|
<tr class="separator:a1564a42794ef7a9d170b725063ef504d inherit pro_methods_classmastodonpp_1_1CURLWrapper"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a94aba6daedea376ccc20e5c983bd3358 inherit pro_methods_classmastodonpp_1_1CURLWrapper"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmastodonpp_1_1CURLWrapper.html#a94aba6daedea376ccc20e5c983bd3358">set_access_token</a> (string_view access_token)</td></tr>
|
|
<tr class="memdesc:a94aba6daedea376ccc20e5c983bd3358 inherit pro_methods_classmastodonpp_1_1CURLWrapper"><td class="mdescLeft"> </td><td class="mdescRight">Set OAuth 2.0 Bearer Access Token. <a href="classmastodonpp_1_1CURLWrapper.html#a94aba6daedea376ccc20e5c983bd3358">More...</a><br /></td></tr>
|
|
<tr class="separator:a94aba6daedea376ccc20e5c983bd3358 inherit pro_methods_classmastodonpp_1_1CURLWrapper"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:af3f2bd4dea7c289d590fe19889360444 inherit pro_methods_classmastodonpp_1_1CURLWrapper"><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmastodonpp_1_1CURLWrapper.html#af3f2bd4dea7c289d590fe19889360444">set_cainfo</a> (string_view path)</td></tr>
|
|
<tr class="memdesc:af3f2bd4dea7c289d590fe19889360444 inherit pro_methods_classmastodonpp_1_1CURLWrapper"><td class="mdescLeft"> </td><td class="mdescRight">Set path to Certificate Authority (CA) bundle. <a href="classmastodonpp_1_1CURLWrapper.html#af3f2bd4dea7c289d590fe19889360444">More...</a><br /></td></tr>
|
|
<tr class="separator:af3f2bd4dea7c289d590fe19889360444 inherit pro_methods_classmastodonpp_1_1CURLWrapper"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ae3b1445f9b94b1f7677d3cac6d538612 inherit pro_methods_classmastodonpp_1_1CURLWrapper"><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmastodonpp_1_1CURLWrapper.html#ae3b1445f9b94b1f7677d3cac6d538612">set_useragent</a> (string_view useragent)</td></tr>
|
|
<tr class="memdesc:ae3b1445f9b94b1f7677d3cac6d538612 inherit pro_methods_classmastodonpp_1_1CURLWrapper"><td class="mdescLeft"> </td><td class="mdescRight">Sets the User-Agent. <a href="classmastodonpp_1_1CURLWrapper.html#ae3b1445f9b94b1f7677d3cac6d538612">More...</a><br /></td></tr>
|
|
<tr class="separator:ae3b1445f9b94b1f7677d3cac6d538612 inherit pro_methods_classmastodonpp_1_1CURLWrapper"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="inherit_header pro_attribs_classmastodonpp_1_1CURLWrapper"><td colspan="2" onclick="javascript:toggleInherit('pro_attribs_classmastodonpp_1_1CURLWrapper')"><img src="closed.png" alt="-"/> Protected Attributes inherited from <a class="el" href="classmastodonpp_1_1CURLWrapper.html">mastodonpp::CURLWrapper</a></td></tr>
|
|
<tr class="memitem:af7e18dc7c3bdc1c58bc93a46bf00866a inherit pro_attribs_classmastodonpp_1_1CURLWrapper"><td class="memItemLeft" align="right" valign="top">mutex </td><td class="memItemRight" valign="bottom"><a class="el" href="classmastodonpp_1_1CURLWrapper.html#af7e18dc7c3bdc1c58bc93a46bf00866a">_buffer_mutex</a></td></tr>
|
|
<tr class="memdesc:af7e18dc7c3bdc1c58bc93a46bf00866a inherit pro_attribs_classmastodonpp_1_1CURLWrapper"><td class="mdescLeft"> </td><td class="mdescRight">Mutex for <a class="el" href="classmastodonpp_1_1CURLWrapper.html#a04b3919cfb38716c5a032337e442db95" title="Returns a reference to the buffer libcurl writes into.">get_buffer</a> a.k.a. _curl_buffer_body. <a href="classmastodonpp_1_1CURLWrapper.html#af7e18dc7c3bdc1c58bc93a46bf00866a">More...</a><br /></td></tr>
|
|
<tr class="separator:af7e18dc7c3bdc1c58bc93a46bf00866a inherit pro_attribs_classmastodonpp_1_1CURLWrapper"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
|
<div class="textblock"><p>Simplifies obtaining an OAuth 2.0 Bearer Access Token. </p>
|
|
<ul>
|
|
<li>Create an <a class="el" href="classmastodonpp_1_1Instance.html" title="Holds the access data of an instance.">Instance</a> and initialize this class with it.</li>
|
|
<li>Call <a class="el" href="classmastodonpp_1_1Instance_1_1ObtainToken.html#a5bd5d631e2fbb186a9df66d2ac3f5402" title="Creates an application via /api/v1/apps.">step_1()</a> to get the URI your user has to visit.</li>
|
|
<li>Get the authorization code from your user.</li>
|
|
<li>Call <a class="el" href="classmastodonpp_1_1Instance_1_1ObtainToken.html#addda7f4e1ca4200235764707478f6d51" title="Creates a token via /oauth/token.">step_2()</a> with the code.</li>
|
|
</ul>
|
|
<p>Example: </p><div class="fragment"><div class="line"><a class="code" href="classmastodonpp_1_1Instance.html">mastodonpp::Instance</a> instance{<span class="stringliteral">"example.com"</span>, {}};</div>
|
|
<div class="line"><a class="code" href="classmastodonpp_1_1Instance_1_1ObtainToken.html">mastodonpp::Instance::ObtainToken</a> token{instance};</div>
|
|
<div class="line"><span class="keyword">auto</span> answer{token.step1(<span class="stringliteral">"Good program"</span>, <span class="stringliteral">"read:blocks read:mutes"</span>, <span class="stringliteral">""</span>)};</div>
|
|
<div class="line"><span class="keywordflow">if</span> (answer)</div>
|
|
<div class="line">{</div>
|
|
<div class="line"> std::cout << <span class="stringliteral">"Please visit "</span> << answer << <span class="stringliteral">"\nand paste the code: "</span>;</div>
|
|
<div class="line"> std::string code;</div>
|
|
<div class="line"> std::cin >> code;</div>
|
|
<div class="line"> answer = access_token{token.step2(code)};</div>
|
|
<div class="line"> <span class="keywordflow">if</span> (answer)</div>
|
|
<div class="line"> {</div>
|
|
<div class="line"> std::cout << <span class="stringliteral">"Success!\n"</span>;</div>
|
|
<div class="line"> }</div>
|
|
<div class="line">}</div>
|
|
</div><!-- fragment --><dl class="section since"><dt>Since</dt><dd>0.3.0 </dd></dl>
|
|
</div><h2 class="groupheader">Constructor & Destructor Documentation</h2>
|
|
<a id="aa834d9be223856e5711b0e14d9b92eed"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#aa834d9be223856e5711b0e14d9b92eed">◆ </a></span>ObtainToken()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">mastodonpp::Instance::ObtainToken::ObtainToken </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="classmastodonpp_1_1Instance.html">Instance</a> & </td>
|
|
<td class="paramname"><em>instance</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">explicit</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Constructor. </p>
|
|
<dl class="section since"><dt>Since</dt><dd>0.3.0 </dd></dl>
|
|
<div class="fragment"><div class="line"><a name="l00257"></a><span class="lineno"> 257</span>  : _instance{instance}</div>
|
|
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>  , _baseuri{instance.get_baseuri()}</div>
|
|
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>  {</div>
|
|
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>  _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="l00261"></a><span class="lineno"> 261</span>  }</div>
|
|
</div><!-- fragment -->
|
|
</div>
|
|
</div>
|
|
<h2 class="groupheader">Member Function Documentation</h2>
|
|
<a id="a5bd5d631e2fbb186a9df66d2ac3f5402"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a5bd5d631e2fbb186a9df66d2ac3f5402">◆ </a></span>step_1()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="structmastodonpp_1_1answer__type.html">answer_type</a> mastodonpp::Instance::ObtainToken::step_1 </td>
|
|
<td>(</td>
|
|
<td class="paramtype">string_view </td>
|
|
<td class="paramname"><em>client_name</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">string_view </td>
|
|
<td class="paramname"><em>scopes</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">string_view </td>
|
|
<td class="paramname"><em>website</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Creates an application via <code>/api/v1/apps</code>. </p>
|
|
<p>The <code>body</code> of the returned <a class="el" href="structmastodonpp_1_1answer__type.html">answer </a> contains only the URI, not the whole JSON response.</p>
|
|
<p>Note that the required scopes may be different between Mastodon and other implementations, like Pleroma.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">client_name</td><td>The name of your application. </td></tr>
|
|
<tr><td class="paramname">scopes</td><td>Space separated list of scopes. Defaults to “read” if empty. </td></tr>
|
|
<tr><td class="paramname">website</td><td>The URI to the homepage of your application. Can be an empty string.</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>The URI your user has to visit.</dd></dl>
|
|
<dl class="section since"><dt>Since</dt><dd>0.3.0 </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="addda7f4e1ca4200235764707478f6d51"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#addda7f4e1ca4200235764707478f6d51">◆ </a></span>step_2()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="structmastodonpp_1_1answer__type.html">answer_type</a> mastodonpp::Instance::ObtainToken::step_2 </td>
|
|
<td>(</td>
|
|
<td class="paramtype">string_view </td>
|
|
<td class="paramname"><em>code</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Creates a token via <code>/oauth/token</code>. </p>
|
|
<p>The <code>body</code> of the returned <a class="el" href="structmastodonpp_1_1answer__type.html">answer </a> contains only the access token, not the whole JSON response.</p>
|
|
<p>The access token will be set in the <a class="el" href="classmastodonpp_1_1Instance.html" title="Holds the access data of an instance.">Instance</a> you initialized this <a class="el" href="classmastodonpp_1_1Instance_1_1ObtainToken.html" title="Simplifies obtaining an OAuth 2.0 Bearer Access Token.">ObtainToken</a> with.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">code</td><td>The authorization code you got from the user.</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>The access token.</dd></dl>
|
|
<dl class="section since"><dt>Since</dt><dd>0.3.0 </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<hr/>The documentation for this class was generated from the following file:<ul>
|
|
<li>include/<a class="el" href="instance_8hpp_source.html">instance.hpp</a></li>
|
|
</ul>
|
|
</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:248</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 &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="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:48</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.17
|
|
</small></address>
|
|
</body>
|
|
</html>
|