36 static std::expected<QueryParams, RequestError>
ParseDecodified(std::string_view str);
87 [[nodiscard]]
size_t Size()
const;
90 [[nodiscard]]
bool Empty()
const;
107#include <Thoth/Http/Request/QueryParams.tpp>
constexpr const_iterator cbegin() const
constexpr iterator begin()
Definition QueryParams.hpp:11
decltype(MapType().begin()) IterType
Definition QueryParams.hpp:23
std::string QueryValue
Definition QueryParams.hpp:15
bool RemoveKey(QueryKeyRef key)
Remove a key and all values associated.
std::string_view QueryValueRef
Definition QueryParams.hpp:16
void Clear()
Clear all keys.
bool operator==(const QueryParams &other) const
std::pair< QueryKey, QueryValues > QueryPair
Definition QueryParams.hpp:19
QueryValues & operator[](QueryKeyRef key)
bool Exists(QueryKeyRef key) const
check if a key exists.
static QueryParams Parse(std::string_view paramsStr)
Parse the query as it is.
std::string QueryKey
Definition QueryParams.hpp:12
decltype(MapType().cbegin()) CIterType
Definition QueryParams.hpp:24
std::vector< QueryValue > QueryValues
Definition QueryParams.hpp:17
void Add(QueryKeyRef key, QueryValue val)
Add a value with the specified key.
static std::expected< QueryParams, RequestError > ParseDecodified(std::string_view str)
Tries to decode and then parse.
Dsa::LinearMap< QueryKey, QueryValues > MapType
Definition QueryParams.hpp:21
QueryParams(const MapType &initAs)
Create with an existing map.
QueryParams(std::initializer_list< QueryPair > init)
bool Remove(QueryKeyRef key, QueryValueRef val)
Remove a value with the specified key.
bool ValExists(QueryKeyRef key, QueryValueRef val) const
check if a key=val exists.
std::string_view QueryKeyRef
Definition QueryParams.hpp:13
bool SetIfNull(QueryKeyRef key, QueryValueRef value)
If key not exists, set it to value.
std::optional< QueryValues * > Get(QueryKeyRef key)
Get the reference of a key but don't create if it not exists.