code reformat
This commit is contained in:
parent
31819abcaf
commit
c738a01ce4
1
.gitignore
vendored
1
.gitignore
vendored
@ -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
|
||||||
|
@ -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();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -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);
|
||||||
|
|
||||||
|
@ -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:
|
||||||
|
@ -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();
|
||||||
|
Loading…
Reference in New Issue
Block a user