summaryrefslogtreecommitdiff
path: root/battleNetApi/include
diff options
context:
space:
mode:
Diffstat (limited to 'battleNetApi/include')
-rw-r--r--battleNetApi/include/token.hpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/battleNetApi/include/token.hpp b/battleNetApi/include/token.hpp
index e2e3088..f529a08 100644
--- a/battleNetApi/include/token.hpp
+++ b/battleNetApi/include/token.hpp
@@ -10,13 +10,17 @@ class Token {
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 mToken; //!< Token value
- std::string getValidToken() const;
- void refreshToken() const;
- void writeNewTokenToFile() const;
- void writeTokenToFile(const std::string &iToken) const;
- std::string getValidTokenWithApi() const;
+ /**
+ * @return A token that a user can use to perform API requests.
+ * A new token might be computed if the current token lifetime expired.
+ */
+ std::string getValidToken();
+ const bool hasTokenExpired() const;
+ std::string writeNewTokenToLocalFile() const;
+ std::string getTokenFromLocalFile() const;
+ std::string getTokenWithApi() 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);