From feac00e6819a9c9ad640a586d2fabb9e4e43f41e Mon Sep 17 00:00:00 2001 From: Aotrix <9aotrix@protonmail.com> Date: Sun, 25 Jan 2026 03:16:23 +0100 Subject: renamed some functions --- battleNetApi/src/token.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'battleNetApi/src') diff --git a/battleNetApi/src/token.cpp b/battleNetApi/src/token.cpp index e32a946..21717cb 100644 --- a/battleNetApi/src/token.cpp +++ b/battleNetApi/src/token.cpp @@ -14,7 +14,7 @@ Token::Token(const std::string &iTokenFilePath) : mFilePath{iTokenFilePath}, mTo std::string Token::text() const { return mToken; } -const bool Token::hasTokenExpired() const { +const bool Token::hasExpired() const { std::ifstream aTokenFile{mFilePath}; json aCredentialsFile = json::parse(aTokenFile); if (not aCredentialsFile.contains("Token") or not aCredentialsFile["Token"].contains("ExpirationTime") or @@ -42,14 +42,14 @@ std::string Token::getTokenFromLocalFile() const { } std::string Token::generateToken() { - if (hasTokenExpired()) { + if (hasExpired()) { const std::pair kTokenContent{getTokenWithApi()}; - writeNewTokenToLocalFile(kTokenContent); + writeTokenToLocalFile(kTokenContent); } return getTokenFromLocalFile(); } -void Token::writeNewTokenToLocalFile(const std::pair &iToken) const { +void Token::writeTokenToLocalFile(const std::pair &iToken) const { std::ifstream aTokenFileInput{mFilePath}; json aCredentialsFile = json::parse(aTokenFileInput); aCredentialsFile["Token"]["Content"] = iToken.first; -- cgit v1.2.3