diff options
Diffstat (limited to 'battleNetApi/include/token.hpp')
| -rw-r--r-- | battleNetApi/include/token.hpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/battleNetApi/include/token.hpp b/battleNetApi/include/token.hpp index f529a08..34c6d3e 100644 --- a/battleNetApi/include/token.hpp +++ b/battleNetApi/include/token.hpp @@ -3,8 +3,8 @@ class Token { public: - Token(const std::string &iTokenFilePath, const std::string &iUsername, const std::string &iPassword); - std::string toString() const; + Token(const std::string &iTokenFilePath); + std::string text() const; private: const std::string mFilePath; //!< Path to the token file @@ -16,13 +16,12 @@ class Token { * @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(); + std::string generateToken(); const bool hasTokenExpired() const; - std::string writeNewTokenToLocalFile() const; + void writeNewTokenToLocalFile(const std::string &iTokenContent) 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); friend class TokenTests; |
