From 1a6dd5fae7eccc8d4594a0692c43cf6c0f9fe394 Mon Sep 17 00:00:00 2001 From: tastytea Date: Fri, 27 Nov 2020 15:05:17 +0100 Subject: [PATCH] 2020-11-27 # # 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 --- docs/annotated.html | 2 +- docs/api_8hpp_source.html | 2 +- docs/classes.html | 2 +- docs/classmastodonpp_1_1API-members.html | 2 +- docs/classmastodonpp_1_1API.html | 2 +- ...ssmastodonpp_1_1CURLException-members.html | 2 +- docs/classmastodonpp_1_1CURLException.html | 2 +- ...lassmastodonpp_1_1CURLWrapper-members.html | 2 +- docs/classmastodonpp_1_1CURLWrapper.html | 2 +- ...classmastodonpp_1_1Connection-members.html | 2 +- docs/classmastodonpp_1_1Connection.html | 2 +- docs/classmastodonpp_1_1Instance-members.html | 2 +- docs/classmastodonpp_1_1Instance.html | 2 +- ...pp_1_1Instance_1_1ObtainToken-members.html | 2 +- ...mastodonpp_1_1Instance_1_1ObtainToken.html | 2 +- docs/connection_8hpp_source.html | 2 +- docs/curl__wrapper_8hpp_source.html | 2 +- .../dir_68267d1309a1af8e8297ef4c3efbcdba.html | 2 +- .../dir_d44c64559bbebec7f509842c48db8b23.html | 2 +- .../example01_instance_info_8cpp-example.html | 92 +---------- docs/example02_streaming_8cpp-example.html | 116 +------------- docs/example03_post_status_8cpp-example.html | 95 +---------- ...e04_post_with_attachment_8cpp-example.html | 105 +----------- ...te_notification_settings_8cpp-example.html | 93 +---------- docs/example06_update_name_8cpp-example.html | 90 +---------- .../example07_delete_status_8cpp-example.html | 107 +------------ docs/example08_obtain_token_8cpp-example.html | 122 +------------- .../example09_nlohmann_json_8cpp-example.html | 150 +----------------- docs/examples.html | 2 +- docs/exceptions_8hpp_source.html | 2 +- docs/files.html | 2 +- docs/functions.html | 2 +- docs/functions_enum.html | 2 +- docs/functions_func.html | 2 +- docs/functions_rela.html | 2 +- docs/functions_type.html | 2 +- docs/functions_vars.html | 2 +- docs/graph_legend.html | 2 +- docs/helpers_8hpp_source.html | 2 +- docs/hierarchy.html | 2 +- docs/index.html | 2 +- docs/inherits.html | 2 +- docs/instance_8hpp_source.html | 2 +- docs/log_8hpp_source.html | 2 +- docs/mastodonpp_8hpp_source.html | 2 +- docs/namespacemastodonpp.html | 2 +- docs/namespacemembers.html | 2 +- docs/namespacemembers_enum.html | 2 +- docs/namespacemembers_func.html | 2 +- docs/namespacemembers_type.html | 2 +- docs/namespaces.html | 2 +- ...uctmastodonpp_1_1answer__type-members.html | 2 +- docs/structmastodonpp_1_1answer__type.html | 2 +- ...ructmastodonpp_1_1event__type-members.html | 2 +- docs/structmastodonpp_1_1event__type.html | 2 +- docs/types_8hpp_source.html | 2 +- 56 files changed, 65 insertions(+), 999 deletions(-) diff --git a/docs/annotated.html b/docs/annotated.html index c0ef01a..dc096d1 100644 --- a/docs/annotated.html +++ b/docs/annotated.html @@ -22,7 +22,7 @@
mastodonpp -  0.5.5 +  0.5.7
C++ wrapper for the Mastodon and Pleroma APIs.
diff --git a/docs/api_8hpp_source.html b/docs/api_8hpp_source.html index 78d3bec..5a5a5cf 100644 --- a/docs/api_8hpp_source.html +++ b/docs/api_8hpp_source.html @@ -22,7 +22,7 @@
mastodonpp -  0.5.5 +  0.5.7
C++ wrapper for the Mastodon and Pleroma APIs.
diff --git a/docs/classes.html b/docs/classes.html index 3bf1977..9ec305f 100644 --- a/docs/classes.html +++ b/docs/classes.html @@ -22,7 +22,7 @@
mastodonpp -  0.5.5 +  0.5.7
C++ wrapper for the Mastodon and Pleroma APIs.
diff --git a/docs/classmastodonpp_1_1API-members.html b/docs/classmastodonpp_1_1API-members.html index ad8a7bf..5e57b7e 100644 --- a/docs/classmastodonpp_1_1API-members.html +++ b/docs/classmastodonpp_1_1API-members.html @@ -22,7 +22,7 @@
mastodonpp -  0.5.5 +  0.5.7
C++ wrapper for the Mastodon and Pleroma APIs.
diff --git a/docs/classmastodonpp_1_1API.html b/docs/classmastodonpp_1_1API.html index e6239ab..2e50e95 100644 --- a/docs/classmastodonpp_1_1API.html +++ b/docs/classmastodonpp_1_1API.html @@ -22,7 +22,7 @@
mastodonpp -  0.5.5 +  0.5.7
C++ wrapper for the Mastodon and Pleroma APIs.
diff --git a/docs/classmastodonpp_1_1CURLException-members.html b/docs/classmastodonpp_1_1CURLException-members.html index 7df8678..ce5609b 100644 --- a/docs/classmastodonpp_1_1CURLException-members.html +++ b/docs/classmastodonpp_1_1CURLException-members.html @@ -22,7 +22,7 @@
mastodonpp -  0.5.5 +  0.5.7
C++ wrapper for the Mastodon and Pleroma APIs.
diff --git a/docs/classmastodonpp_1_1CURLException.html b/docs/classmastodonpp_1_1CURLException.html index d648b5e..20e415f 100644 --- a/docs/classmastodonpp_1_1CURLException.html +++ b/docs/classmastodonpp_1_1CURLException.html @@ -22,7 +22,7 @@
mastodonpp -  0.5.5 +  0.5.7
C++ wrapper for the Mastodon and Pleroma APIs.
diff --git a/docs/classmastodonpp_1_1CURLWrapper-members.html b/docs/classmastodonpp_1_1CURLWrapper-members.html index f26eed6..cf5e9a1 100644 --- a/docs/classmastodonpp_1_1CURLWrapper-members.html +++ b/docs/classmastodonpp_1_1CURLWrapper-members.html @@ -22,7 +22,7 @@
mastodonpp -  0.5.5 +  0.5.7
C++ wrapper for the Mastodon and Pleroma APIs.
diff --git a/docs/classmastodonpp_1_1CURLWrapper.html b/docs/classmastodonpp_1_1CURLWrapper.html index e8fae9a..8f39743 100644 --- a/docs/classmastodonpp_1_1CURLWrapper.html +++ b/docs/classmastodonpp_1_1CURLWrapper.html @@ -22,7 +22,7 @@
mastodonpp -  0.5.5 +  0.5.7
C++ wrapper for the Mastodon and Pleroma APIs.
diff --git a/docs/classmastodonpp_1_1Connection-members.html b/docs/classmastodonpp_1_1Connection-members.html index e4e0e5c..1cd29b9 100644 --- a/docs/classmastodonpp_1_1Connection-members.html +++ b/docs/classmastodonpp_1_1Connection-members.html @@ -22,7 +22,7 @@
mastodonpp -  0.5.5 +  0.5.7
C++ wrapper for the Mastodon and Pleroma APIs.
diff --git a/docs/classmastodonpp_1_1Connection.html b/docs/classmastodonpp_1_1Connection.html index 8a82b91..3f50495 100644 --- a/docs/classmastodonpp_1_1Connection.html +++ b/docs/classmastodonpp_1_1Connection.html @@ -22,7 +22,7 @@
mastodonpp -  0.5.5 +  0.5.7
C++ wrapper for the Mastodon and Pleroma APIs.
diff --git a/docs/classmastodonpp_1_1Instance-members.html b/docs/classmastodonpp_1_1Instance-members.html index 35d6fe0..48c9293 100644 --- a/docs/classmastodonpp_1_1Instance-members.html +++ b/docs/classmastodonpp_1_1Instance-members.html @@ -22,7 +22,7 @@
mastodonpp -  0.5.5 +  0.5.7
C++ wrapper for the Mastodon and Pleroma APIs.
diff --git a/docs/classmastodonpp_1_1Instance.html b/docs/classmastodonpp_1_1Instance.html index 3e74200..fbc9336 100644 --- a/docs/classmastodonpp_1_1Instance.html +++ b/docs/classmastodonpp_1_1Instance.html @@ -22,7 +22,7 @@
mastodonpp -  0.5.5 +  0.5.7
C++ wrapper for the Mastodon and Pleroma APIs.
diff --git a/docs/classmastodonpp_1_1Instance_1_1ObtainToken-members.html b/docs/classmastodonpp_1_1Instance_1_1ObtainToken-members.html index 9fe5582..2030eac 100644 --- a/docs/classmastodonpp_1_1Instance_1_1ObtainToken-members.html +++ b/docs/classmastodonpp_1_1Instance_1_1ObtainToken-members.html @@ -22,7 +22,7 @@
mastodonpp -  0.5.5 +  0.5.7
C++ wrapper for the Mastodon and Pleroma APIs.
diff --git a/docs/classmastodonpp_1_1Instance_1_1ObtainToken.html b/docs/classmastodonpp_1_1Instance_1_1ObtainToken.html index c5d2a3e..5741acc 100644 --- a/docs/classmastodonpp_1_1Instance_1_1ObtainToken.html +++ b/docs/classmastodonpp_1_1Instance_1_1ObtainToken.html @@ -22,7 +22,7 @@
mastodonpp -  0.5.5 +  0.5.7
C++ wrapper for the Mastodon and Pleroma APIs.
diff --git a/docs/connection_8hpp_source.html b/docs/connection_8hpp_source.html index 4ffa9d6..32409c5 100644 --- a/docs/connection_8hpp_source.html +++ b/docs/connection_8hpp_source.html @@ -22,7 +22,7 @@
mastodonpp -  0.5.5 +  0.5.7
C++ wrapper for the Mastodon and Pleroma APIs.
diff --git a/docs/curl__wrapper_8hpp_source.html b/docs/curl__wrapper_8hpp_source.html index 37232e3..f8f1989 100644 --- a/docs/curl__wrapper_8hpp_source.html +++ b/docs/curl__wrapper_8hpp_source.html @@ -22,7 +22,7 @@
mastodonpp -  0.5.5 +  0.5.7
C++ wrapper for the Mastodon and Pleroma APIs.
diff --git a/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.html b/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.html index 63a6b62..983fd12 100644 --- a/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.html +++ b/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.html @@ -22,7 +22,7 @@
mastodonpp -  0.5.5 +  0.5.7
C++ wrapper for the Mastodon and Pleroma APIs.
diff --git a/docs/dir_d44c64559bbebec7f509842c48db8b23.html b/docs/dir_d44c64559bbebec7f509842c48db8b23.html index a666532..b077267 100644 --- a/docs/dir_d44c64559bbebec7f509842c48db8b23.html +++ b/docs/dir_d44c64559bbebec7f509842c48db8b23.html @@ -22,7 +22,7 @@
mastodonpp -  0.5.5 +  0.5.7
C++ wrapper for the Mastodon and Pleroma APIs.
diff --git a/docs/example01_instance_info_8cpp-example.html b/docs/example01_instance_info_8cpp-example.html index 692ecdc..feb5c3e 100644 --- a/docs/example01_instance_info_8cpp-example.html +++ b/docs/example01_instance_info_8cpp-example.html @@ -22,7 +22,7 @@
mastodonpp -  0.5.5 +  0.5.7
C++ wrapper for the Mastodon and Pleroma APIs.
@@ -67,95 +67,7 @@ $(function() {
example01_instance_info.cpp
-
/* This file is part of mastodonpp.
-
* Copyright © 2020 tastytea <tastytea@tastytea.de>
-
*
-
* Permission to use, copy, modify, and/or distribute this software for any
-
* purpose with or without fee is hereby granted.
-
*
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
-
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
-
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
-
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
*/
-
-
// Print information about an instance (/api/v1/instance).
-
-
#if __has_include("mastodonpp.hpp")
-
# include "mastodonpp.hpp" // We're building mastodonpp.
-
#else
-
# include <mastodonpp/mastodonpp.hpp> // We're building outside mastodonpp.
-
#endif
-
-
#include <iostream>
-
#include <string>
-
#include <string_view>
-
#include <vector>
-
-
namespace masto = mastodonpp;
-
using std::cerr;
-
using std::cout;
-
using std::endl;
-
using std::string_view;
-
using std::to_string;
-
using std::vector;
-
-
int main(int argc, char *argv[])
-
{
-
const vector<string_view> args(argv, argv + argc);
-
if (args.size() <= 1)
-
{
-
cerr << "Usage: " << args[0] << " <instance hostname>\n";
-
return 1;
-
}
-
-
try
-
{
-
// Initialize an Instance.
-
masto::Instance instance{args[1], {}};
-
-
// Get maximum allowed characters per post.
-
const auto max_chars{instance.get_max_chars()};
-
cout << "Maximum characters per post: " << max_chars << "\n\n";
-
-
// Initialize a Connection.
-
masto::Connection connection{instance};
-
-
// Get information about the instance.
-
masto::answer_type answer{connection.get(masto::API::v1::instance)};
-
if (answer)
-
{
-
cout << answer << endl;
-
}
-
else
-
{
-
if (answer.curl_error_code == 0)
-
{
-
// If it is no libcurl error, it must be an HTTP error.
-
cerr << "HTTP status: " << answer.http_status << endl;
-
}
-
else
-
{
-
// Network errors like “Couldn't resolve host.”.
-
cerr << "libcurl error " << to_string(answer.curl_error_code)
-
<< ": " << answer.error_message << endl;
-
}
-
}
-
}
-
catch (const masto::CURLException &e)
-
{
-
// Only libcurl errors that are not network errors will be thrown.
-
// There went probably something wrong with the initialization.
-
cerr << e.what() << endl;
-
}
-
-
return 0;
-
}
-
-
C++ wrapper for the Mastodon API.
Definition: api.hpp:24
+