summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authortastytea2020-01-04 11:38:06 +0100
committertastytea2020-01-04 11:38:27 +0100
commite6690c85b44a98f759587cc70030e401ff16a0a8 (patch)
tree1eb27bc53de1d538609f1ca799410c19a748d828 /include
parent6d9096193ba9ef1dec13d5582a345bf89270d2c0 (diff)
downloadmastodonpp-e6690c85b44a98f759587cc70030e401ff16a0a8.tar
mastodonpp-e6690c85b44a98f759587cc70030e401ff16a0a8.tar.gz
mastodonpp-e6690c85b44a98f759587cc70030e401ff16a0a8.zip
Add curl initialization.
Diffstat (limited to 'include')
-rw-r--r--include/instance.hpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/instance.hpp b/include/instance.hpp
index 9afc423..6fdfc0d 100644
--- a/include/instance.hpp
+++ b/include/instance.hpp
@@ -17,6 +17,8 @@
#ifndef MASTODONPP_INSTANCE_HPP
#define MASTODONPP_INSTANCE_HPP
+#include <curl/curl.h>
+
#include <string>
namespace mastodonpp
@@ -41,10 +43,30 @@ public:
* @since 0.1.0
*/
explicit Instance(string instance, string access_token);
+ ~Instance();
private:
const string _instance;
string _access_token;
+ CURL *_connection;
+ char _curl_buffer_error[CURL_ERROR_SIZE];
+ string _curl_buffer;
+
+
+ /*!
+ * @brief libcurl write callback function.
+ *
+ * @since 0.1.0
+ */
+ static int writer(char *data, size_t size, size_t nmemb,
+ string *writerData);
+
+ /*!
+ * @brief Setup libcurl connection.
+ *
+ * @since 0.1.0
+ */
+ void setup_curl();
};
} // namespace mastodonpp