code reformat

This commit is contained in:
max mustermann 2019-05-08 19:31:49 +02:00
parent 31819abcaf
commit c738a01ce4
9 changed files with 35 additions and 28 deletions

1
.gitignore vendored
View File

@ -20,6 +20,7 @@
.idea/**/dynamic.xml .idea/**/dynamic.xml
.idea/**/uiDesigner.xml .idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml .idea/**/dbnavigator.xml
.idea/**/*.xml
# Gradle # Gradle
.idea/**/gradle.xml .idea/**/gradle.xml

View File

@ -9,7 +9,9 @@
class Logger { class Logger {
public: public:
void logToLogfile(std::string text); void logToLogfile(std::string text);
void safeip(std::string ip); void safeip(std::string ip);
std::string readip(); std::string readip();
}; };

View File

@ -18,7 +18,8 @@ std::string API::request(std::string myurl) {
return request(std::move(myurl), false, map, str); return request(std::move(myurl), false, map, str);
} }
std::string API::request(std::string myurl, bool post, Hashmap<std::string,std::string> &map, std::vector<std::string> &headers) { std::string
API::request(std::string myurl, bool post, Hashmap<std::string, std::string> &map, std::vector<std::string> &headers) {
CURL *curl; CURL *curl;
CURLcode res; CURLcode res;
@ -66,7 +67,6 @@ std::string API::request(std::string myurl, bool post, Hashmap<std::string,std::
} }
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readString); curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readString);

View File

@ -12,6 +12,7 @@
class API { class API {
public: public:
std::string request(std::string myurl); std::string request(std::string myurl);
std::string request(std::string myurl, bool post, Hashmap<std::string, std::string> &map, std::vector<std::string> &headers); std::string request(std::string myurl, bool post, Hashmap<std::string, std::string> &map, std::vector<std::string> &headers);
private: private:

View File

@ -9,10 +9,13 @@
#include <iostream> #include <iostream>
#include <vector> #include <vector>
template <class keytype,class valuetype> class Hashmap { template<class keytype, class valuetype>
class Hashmap {
public: public:
void add(keytype key, keytype value); void add(keytype key, keytype value);
keytype getKey(int position); keytype getKey(int position);
valuetype getValue(int position); valuetype getValue(int position);
int size(); int size();