diff --git a/CMakeLists.txt b/CMakeLists.txt index 0bc955e..fe449ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.7) project (mastodon-cpp - VERSION 0.17.1 + VERSION 0.18.0 LANGUAGES CXX ) diff --git a/src/mastodon-cpp.cpp b/src/mastodon-cpp.cpp index d8c206a..804a4ca 100644 --- a/src/mastodon-cpp.cpp +++ b/src/mastodon-cpp.cpp @@ -143,6 +143,11 @@ const std::string API::urlencode(const std::string &str) return curlpp::escape(str); } +const std::string API::urldecode(const std::string &str) +{ + return curlpp::unescape(str); +} + const uint_fast16_t API::register_app1(const string &instance, const string &client_name, const string &redirect_uri, diff --git a/src/mastodon-cpp.hpp b/src/mastodon-cpp.hpp index 2f9a134..023fede 100644 --- a/src/mastodon-cpp.hpp +++ b/src/mastodon-cpp.hpp @@ -335,6 +335,21 @@ public: */ static const string urlencode(const string &str); + /*! + * @brief Decodes a percent-encoded string. + * + * Calls curlpp::unescape(str) + * + * See RFC 3986 section 2.1 for more info. + * + * @param str The string + * + * @return The decoded string + * + * @since 0.18.0 + */ + static const string urldecode(const string &str); + /*! * @brief Register application, step 1/2 *