diff options
| author | Aotrix <[email protected]> | 2026-01-01 03:35:41 +0100 |
|---|---|---|
| committer | Aotrix <[email protected]> | 2026-01-01 03:35:41 +0100 |
| commit | c05901c38c6a77779807a6b224b9b624bfcaa5d3 (patch) | |
| tree | fb8d212cd9995e4eecd351de352ea6aab2295924 /battleNetApi/include/token.hpp | |
| parent | a56ae1a7ad5f624b05570965bed76e928bbd945c (diff) | |
removed useless files
Diffstat (limited to 'battleNetApi/include/token.hpp')
| -rw-r--r-- | battleNetApi/include/token.hpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/battleNetApi/include/token.hpp b/battleNetApi/include/token.hpp new file mode 100644 index 0000000..e2e3088 --- /dev/null +++ b/battleNetApi/include/token.hpp @@ -0,0 +1,25 @@ +#include <chrono> +#include <string> + +class Token { + public: + Token(const std::string &iTokenFilePath, const std::string &iUsername, const std::string &iPassword); + std::string toString() const; + + private: + const std::string mFilePath; //!< Path to the token file + const std::string mUsername; //!< Username for Battle.net API + const std::string mPassword; //!< Password for Battle.net API + const std::string mToken; //!< Token value + + std::string getValidToken() const; + void refreshToken() const; + void writeNewTokenToFile() const; + void writeTokenToFile(const std::string &iToken) const; + std::string getValidTokenWithApi() const; + std::chrono::seconds getCurrentTime() const; + std::string extractTokenWithRegex(const std::string &iText, const std::string &iRegex) const; + static size_t curlCallbackStringOutput(void *iPtr, size_t iSize, size_t iNmemb, std::string *iUserData); + + friend class TokenTests; +}; |
