diff options
| author | Aotrix <[email protected]> | 2025-10-01 19:46:58 +0200 |
|---|---|---|
| committer | Aotrix <[email protected]> | 2025-10-01 19:59:11 +0200 |
| commit | 2dd7b40140473b47fbff65795ee1a66e1b84b4b4 (patch) | |
| tree | b6aa6607e46878e555fa25a98965ce454d7a516c /include | |
| parent | e0d4ce7dcebe3230993bd9488723ce8766e6918d (diff) | |
Added more FOLDERS
Diffstat (limited to 'include')
| -rw-r--r-- | include/hearthstoneAPI.hpp (renamed from include/hearthstoneAPIHandler.hpp) | 16 | ||||
| -rw-r--r-- | include/postgresHandler.hpp | 12 |
2 files changed, 10 insertions, 18 deletions
diff --git a/include/hearthstoneAPIHandler.hpp b/include/hearthstoneAPI.hpp index 9d5ec58..f677080 100644 --- a/include/hearthstoneAPIHandler.hpp +++ b/include/hearthstoneAPI.hpp @@ -2,27 +2,23 @@ #include <chrono> #include <string> -class HearthstoneAPIHandler { +class HearthstoneAPI { public: - HearthstoneAPIHandler(); + 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); + 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); + 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); + 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 make_api_request(const std::string &t_url, const std::string &t_header); std::string m_access_token; std::string m_header; diff --git a/include/postgresHandler.hpp b/include/postgresHandler.hpp index 2c3f6f4..444a50f 100644 --- a/include/postgresHandler.hpp +++ b/include/postgresHandler.hpp @@ -1,5 +1,5 @@ #pragma once -#include "hearthstoneAPIHandler.hpp" +#include "hearthstoneAPI.hpp" #include <pqxx/pqxx> #include <regex> @@ -10,8 +10,7 @@ * @param aQuery The SQL query * @return The result of the executed SQL query */ -const pqxx::result executeQuery(pqxx::work &aTransaction, - std::string_view aQuery); +const pqxx::result executeQuery(pqxx::work &aTransaction, std::string_view aQuery); /** * Get the type id of the value element in the "key": value regex match @@ -21,16 +20,13 @@ const pqxx::result executeQuery(pqxx::work &aTransaction, * @param kSregexIt the regex match for a "key": value card information * @return the type identifier of the value element */ -const unsigned int -getTypeIndexOfRegexIterator(const std::sregex_iterator &kSregexIt); +const unsigned int getTypeIndexOfRegexIterator(const std::sregex_iterator &kSregexIt); /** * Add a list of cards (TODO: Complete documentation and function) * * @param kCards * @param aTransaction */ -void addCardsToDatabase(HearthstoneAPIHandler &aAPIIntermediate, - pqxx::work &aTransaction, - const std::string &kURLOfCardsPage); +void addCardsToDatabase(HearthstoneAPI &aAPIIntermediate, pqxx::work &aTransaction, const std::string &kURLOfCardsPage); void refresh_cards_table(); |
