summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAotrix <[email protected]>2025-10-01 19:46:58 +0200
committerAotrix <[email protected]>2025-10-01 19:56:24 +0200
commitd6cf50a63e35eb8812b4fb576399336d425c7b76 (patch)
treeb6aa6607e46878e555fa25a98965ce454d7a516c /include
parent79453ffc82f75cf0af0537474923e7b112aa2f87 (diff)
added more FOLDERS
Diffstat (limited to 'include')
-rw-r--r--include/hearthstoneAPI.hpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/include/hearthstoneAPI.hpp b/include/hearthstoneAPI.hpp
new file mode 100644
index 0000000..f677080
--- /dev/null
+++ b/include/hearthstoneAPI.hpp
@@ -0,0 +1,25 @@
+#pragma once
+#include <chrono>
+#include <string>
+
+class HearthstoneAPI {
+ public:
+ HearthstoneAPI();
+ std::string get_cards(const std::string &t_card_parameters);
+
+ private:
+ static size_t curl_callback_string_output(void *t_contents, size_t t_size, size_t t_nmemb, std::string *t_s);
+ std::chrono::seconds get_current_time();
+ std::string extract_string_with_regex(const std::string &t_str, const std::string t_regex);
+ void write_new_token_info_to_file(const std::string &t_file_path);
+ void refresh_token_if_needed();
+ std::string get_valid_token();
+ std::string generate_request_header();
+ const std::string get_url(const std::string &t_parameters);
+ const std::string get_set_of_cards_url(const std::string &t_card_parameters);
+ std::string make_api_request(const char *t_url, const char *t_header);
+ std::string make_api_request(const std::string &t_url, const std::string &t_header);
+
+ std::string m_access_token;
+ std::string m_header;
+};