diff options
| author | Aotrix <[email protected]> | 2026-04-23 02:48:00 +0200 |
|---|---|---|
| committer | Aotrix <[email protected]> | 2026-04-23 02:48:00 +0200 |
| commit | 5582e994d39b16a6d61f05b13e78c30f4bac5d84 (patch) | |
| tree | f1bb074a61fad89d072d007b8a19d3ca9f446d4f /battleNetApi/src/apiUrl.cpp | |
| parent | cc436cb44c60ef2485321e1e22b3ea0a59ee22af (diff) | |
Create TokenBuilder class
Diffstat (limited to 'battleNetApi/src/apiUrl.cpp')
| -rw-r--r-- | battleNetApi/src/apiUrl.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/battleNetApi/src/apiUrl.cpp b/battleNetApi/src/apiUrl.cpp index 1f11add..fa07372 100644 --- a/battleNetApi/src/apiUrl.cpp +++ b/battleNetApi/src/apiUrl.cpp @@ -19,7 +19,8 @@ void ApiUrl::setLocale(const std::string &iLocale) { void ApiUrl::setGameMode(const std::string &iGameMode) { if (not iGameMode.empty()) { //!< A recognized game mode, e.g. "constructed" - //!< @see https://community.developer.battle.net/documentation/hearthstone/guides/game-modes + //!< @see + //!< https://community.developer.battle.net/documentation/hearthstone/guides/game-modes setValue(kGAME_MODE_KEY, iGameMode); } } @@ -36,13 +37,19 @@ void ApiUrl::setPageSize(const std::string &iPageSize) { setValue(kPAGE_SIZE_KEY, iPageSize); } } -void ApiUrl::setPageSize(uint64_t iPageSize) { return setPageSize(std::to_string(iPageSize)); } +void ApiUrl::setPageSize(uint64_t iPageSize) { + return setPageSize(std::to_string(iPageSize)); +} bool ApiUrl::hasLocale() const { return hasValue(kLOCALE_KEY); } bool ApiUrl::hasGameMode() const { return hasValue(kGAME_MODE_KEY); } bool ApiUrl::hasPage() const { return hasValue(kPAGE_KEY); } bool ApiUrl::hasPageSize() const { return hasValue(kPAGE_SIZE_KEY); } -void ApiUrl::setValue(const std::string &iKey, const std::string &iValue) { aParameters[iKey] = iValue; } -bool ApiUrl::hasValue(const std::string &iKey) const { return aParameters.count(iKey) > 0; } +void ApiUrl::setValue(const std::string &iKey, const std::string &iValue) { + aParameters[iKey] = iValue; +} +bool ApiUrl::hasValue(const std::string &iKey) const { + return aParameters.count(iKey) > 0; +} std::string ApiUrl::text() const { std::string aFormattedParameters; for (const auto &[key, value] : aParameters) { @@ -52,6 +59,7 @@ std::string ApiUrl::text() const { aFormattedParameters[0] = '?'; } aFormattedParameters = - std::format("https://{}.api.blizzard.com/hearthstone/{}/{}", mRegion, mContentType, aFormattedParameters); + std::format("https://{}.api.blizzard.com/hearthstone/{}/{}", mRegion, + mContentType, aFormattedParameters); return aFormattedParameters; } |
