From 0a81597e3d66676a5491cdebcbe93016b57bb0bb Mon Sep 17 00:00:00 2001 From: tastytea Date: Mon, 5 Feb 2018 14:56:16 +0100 Subject: [PATCH] started work on app registering --- CMakeLists.txt | 5 ++++- src/mastodon-cpp.cpp | 19 +++++++++++++++++++ src/mastodon-cpp.hpp | 6 ++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1cbf579..f4e132d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,9 +5,12 @@ project (mastodon-cpp VERSION 0.2.1 LANGUAGES CXX ) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -fPIC") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall") +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + include_directories(${MY_SOURCE_DIR}/src) include_directories(${PROJECT_BINARY_DIR}) diff --git a/src/mastodon-cpp.cpp b/src/mastodon-cpp.cpp index a4c15ea..09b0006 100644 --- a/src/mastodon-cpp.cpp +++ b/src/mastodon-cpp.cpp @@ -157,3 +157,22 @@ const string API::maptoformdata(const parametermap &map) ttdebug << "Form data: \n" << header << body; return header + body; } + +// const string API::register_app(const std::string &instance, +// const std::string &client_name, +// const std::string &redirect_uris, +// const std::string &scopes, +// const std::string &website) +// { +// API::parametermap parameters = +// { +// { "client_name", { client_name } }, +// { "redirect_uris", { redirect_uris } }, +// { "scopes", { scopes } }, +// { "website", { website } } +// }; + +// string answer; +// std::uint16_t ret = post(API::v1::apps, parameters, answer); + +// } diff --git a/src/mastodon-cpp.hpp b/src/mastodon-cpp.hpp index dd9f2c3..c87a934 100644 --- a/src/mastodon-cpp.hpp +++ b/src/mastodon-cpp.hpp @@ -169,6 +169,12 @@ public: */ const std::string urlencode(const std::string &str) const; + // const std::string register_app(const std::string &instance, + // const std::string &client_name, + // const std::string &redirect_uris, + // const std::string &scopes, + // const std::string &website = ""); + /*! * @brief Make a GET request which doesn't require an argument. *