blob: e936b6c9934deb83c69f3eae2649d9cb248cfe6f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
#pragma once
#include <cstdint>
#include <string>
#include <unordered_map>
class ApiUrl {
public:
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 setPage(uint64_t iPage);
void setPageSize(const std::string &iPageSize);
void setPageSize(uint64_t iPageSize);
bool hasRegion() const;
bool hasLocale() const;
bool hasGameMode() const;
bool hasPage() const;
bool hasPageSize() const;
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 mContentType;
std::string mRegion;
std::unordered_map<std::string, std::string> aParameters;
void setValue(const std::string &iKey, const std::string &iValue);
bool hasValue(const std::string &iKey) const;
};
|