diff options
| author | Aotrix <[email protected]> | 2026-10-10 16:09:48 +0200 |
|---|---|---|
| committer | Aotrix <[email protected]> | 2026-10-10 16:09:48 +0200 |
| commit | c777502a1c22b240f66069831e6f0cb1e7e41b64 (patch) | |
| tree | 6201b076b88ba6c50c4654b6da7abf8b5cda8267 /battleNetApi/include/apiUrl.hpp | |
| parent | 326f6cb61773c82182d91142749072aa3ca4c450 (diff) | |
Diffstat (limited to 'battleNetApi/include/apiUrl.hpp')
| -rw-r--r-- | battleNetApi/include/apiUrl.hpp | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/battleNetApi/include/apiUrl.hpp b/battleNetApi/include/apiUrl.hpp index 1360102..bc62d42 100644 --- a/battleNetApi/include/apiUrl.hpp +++ b/battleNetApi/include/apiUrl.hpp @@ -3,16 +3,18 @@ #include <string> #include <unordered_map> -namespace bnet { +namespace bnet +{ -class ApiUrl { +class ApiUrl +{ public: - ApiUrl(const std::string &iContentType, const std::string &iRegion); + ApiUrl(const std::string& iContentType, + const std::string& iRegion); - void setRegion(const std::string &iRegion); - void setLocale(const std::string &iLocale); - void setGameMode(const std::string &iGameMode); - void setPage(const std::string &iPage); + void setRegion(const std::string& iRegion); + void setLocale(const std::string& iLocale); + void setGameMode(const std::string& iGameMode); void setPage(uint64_t iPage); void setPageSize(uint64_t iPageSize); @@ -25,15 +27,16 @@ class ApiUrl { std::string text() const; private: - static constexpr std::string kLOCALE_KEY{"locale"}; - static constexpr std::string kGAME_MODE_KEY{"gameMode"}; - static constexpr std::string kPAGE_KEY{"page"}; - static constexpr std::string kPAGE_SIZE_KEY{"pageSize"}; + std::string_view kLOCALE_KEY{"locale"}; + std::string_view kGAME_MODE_KEY{"gameMode"}; + std::string_view kPAGE_KEY{"page"}; + std::string_view kPAGE_SIZE_KEY{"pageSize"}; std::string mContentType; std::string mRegion; - std::unordered_map<std::string, std::string> aParameters; + std::unordered_map<std::string_view, std::string> aParameters; - void setValue(const std::string &iKey, const std::string &iValue); - bool hasValue(const std::string &iKey) const; + void setValue(std::string_view iKey, + const std::string& iValue); + bool hasValue(std::string_view iKey) const; }; }; // namespace bnet |
