From 87be978760e383a0bcd3b1b27096afc24f8347bb Mon Sep 17 00:00:00 2001 From: tastytea Date: Tue, 13 Mar 2018 15:07:14 +0100 Subject: [PATCH] Fixed inconsistencies in get(), made documentation more clear (hopefully) --- CMakeLists.txt | 2 +- src/api_get.cpp | 8 ++++++ src/mastodon-cpp.hpp | 61 ++++++++++++++++++++++---------------------- 3 files changed, 40 insertions(+), 31 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f5dfce1..7fc3e94 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.7) project (mastodon-cpp - VERSION 0.6.3 + VERSION 0.6.4 LANGUAGES CXX ) diff --git a/src/api_get.cpp b/src/api_get.cpp index c39d0f1..6394152 100644 --- a/src/api_get.cpp +++ b/src/api_get.cpp @@ -77,6 +77,14 @@ const std::uint16_t API::get(const Mastodon::API::v1 &call, case v1::timelines_public: strcall = "/api/v1/timelines/public"; break; + case v1::accounts_relationships: + strcall = "/api/v1/accounts/relationships"; + break; + case v1::accounts_search: + strcall = "/api/v1/accounts/search"; + break; + case v1::search: + strcall = "/api/v1/search"; default: ttdebug << "ERROR: Invalid call.\n"; return 11; diff --git a/src/mastodon-cpp.hpp b/src/mastodon-cpp.hpp index 422e51e..3b781f9 100644 --- a/src/mastodon-cpp.hpp +++ b/src/mastodon-cpp.hpp @@ -87,13 +87,11 @@ public: std::string &answer); /*! - * @brief Blocking request. - * - * + * @brief HTTP Request. * * @param meth The method defined in http::method * @param path The api call as string - * @param formdata The form data for PATCH and POST request. + * @param formdata The form data for PATCH and POST requests. * @param answer The answer from the server * * @return @ref error "Error code". If the URL has permanently changed, @@ -128,7 +126,7 @@ public: }; /*! - * @brief Used for passing (most of the time) optional parameters. + * @brief Used for passing parameters. * * Example: * @code @@ -325,7 +323,7 @@ public: std::string &access_token); /*! - * @brief Make a GET request which doesn't require an argument. + * @brief Make a GET request which doesn't require parameters. * * @param call A call defined in Mastodon::API::v1 * @param answer The answer from the server. Usually JSON. On error an @@ -336,10 +334,11 @@ public: const std::uint16_t get(const Mastodon::API::v1 &call, std::string &answer); /*! - * @brief Make a GET request which requires an argument + * @brief Make a GET request which requires a parameter as part of the + * call. * * @param call A call defined in Mastodon::API::v1 - * @param argument The non-optional argument + * @param argument The parameter that is part of the call * @param answer The answer from the server. Usually JSON. On error an * empty string. * @@ -351,8 +350,7 @@ public: std::string &answer); /*! - * @brief Make a GET request which doesn't require an argument, pass - * parameters. + * @brief Make a GET request which requires parameters. * * @param call A call defined in Mastodon::API::v1 * @param parameters A Mastodon::API::parametermap containing parameters @@ -367,10 +365,11 @@ public: std::string &answer); /*! - * @brief Make a GET request which requires an argument, pass parameters. + * @brief Make a GET request which requires a parameter as part of the + * call and parameters. * * @param call A call defined in Mastodon::API::v1 - * @param argument The non-optional argument + * @param argument The parameter that is part of the call * @param parameters A Mastodon::API::parametermap containing parameters * @param answer The answer from the server. Usually JSON. On error * an empty string. @@ -400,7 +399,7 @@ public: * @brief Make a streaming GET request. * * @param call A call defined in Mastodon::API::v1 - * @param argument The non-optional argument + * @param argument The parameter that is part of the call * @param answer The answer from the server. Events with JSON-payload. * @param ptr Pointer to the http object. Can be used to call * ptr->abort_stream() @@ -462,7 +461,7 @@ public: std::string &answer); /*! - * @brief Make a POST request which doesn't require an argument. + * @brief Make a POST request which doesn't require parameters. * * @param call A call defined in Mastodon::API::v1 * @param answer The answer from the server. Usually JSON. On error an @@ -475,10 +474,11 @@ public: std::string &answer); /*! - * @brief Make a POST request which requires an argument + * @brief Make a POST request which requires a parameter as part of the + * call. * * @param call A call defined in Mastodon::API::v1 - * @param argument The non-optional argument + * @param argument The parameter that is part of the call * @param answer The answer from the server. Usually JSON. On error an * empty string. * @@ -490,8 +490,7 @@ public: std::string &answer); /*! - * @brief Make a POST request which doesn't require an argument, pass - * parameters. + * @brief Make a POST request which requires parameters. * * Binary data must be base64-encoded or a filename. * @@ -508,12 +507,13 @@ public: std::string &answer); /*! - * @brief Make a POST request which requires an argument, pass parameters. + * @brief Make a POST request which requires a parameter as part of the + * call and parameters. * * Binary data must be base64-encoded or a filename. * * @param call A call defined in Mastodon::API::v1 - * @param argument The non-optional argument + * @param argument The parameter that is part of the call * @param parameters A Mastodon::API::parametermap containing parameters * @param answer The answer from the server. Usually JSON. On error * an empty string. @@ -544,10 +544,11 @@ public: std::string &answer); /*! - * @brief Make a PUT request which requires an argument, pass parameters. + * @brief Make a PUT request which requires a parameter as part of the + * call and parameters. * * @param call A call defined in Mastodon::API::v1 - * @param argument The non-optional argument + * @param argument The parameter that is part of the call * @param parameters A Mastodon::API::parametermap containing * parameters * @param answer The answer from the server. Usually JSON. On error @@ -578,10 +579,11 @@ public: std::string &answer); /*! - * @brief Make a DELETE request which requires an argument + * @brief Make a DELETE request which requires a parameter as part of the + * call. * * @param call A call defined in Mastodon::API::v1 - * @param argument The non-optional argument + * @param argument The parameter that is part of the call * * @return @ref error "Error code". */ @@ -589,8 +591,7 @@ public: const std::string &argument); /*! - * @brief Make a DELETE request which doesn't require an argument, pass - * parameters. + * @brief Make a DELETE request which requires parameters. * * @param call A call defined in Mastodon::API::v1 * @param parameters A Mastodon::API::parametermap containing parameters @@ -601,11 +602,11 @@ public: const parametermap ¶meters); /*! - * @brief Make a DELETE request which requires an argument, pass - * parameters. + * @brief Make a DELETE request which requires a parameter as part of the + * call and parameters. * * @param call A call defined in Mastodon::API::v1 - * @param argument The non-optional argument + * @param argument The parameter that is part of the call * @param parameters A Mastodon::API::parametermap containing parameters * * @return @ref error "Error code". @@ -632,7 +633,7 @@ public: /*! * @brief Gets the header from the last answer. * - * @param header The header to search + * @param header The header to get * * @return The header, or "" on error. */