#include #include 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 std::string mToken; //!< Token value /** * @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); friend class TokenTests; };