class query_map#

class query_map#

A type for dealing with query string parameters.

Public Functions

query_map() = default#

The default constructor creates an empty map.

inline query_map(std::initializer_list<value_type> init)#

Construct the map by a list of key/value pairs.

inline auto empty() const noexcept -> bool#

Check whether the container is empty.

inline auto size() const noexcept -> size_type#

Get the number of key/value pairs.

inline auto max_size() const noexcept -> size_type#

Get the maximum possible number of key/value pairs.

inline auto contains(const std::string &name) const noexcept -> bool#

Checks whether the container contains element with specific key.

inline void clear() noexcept#

Clear the contents.

inline void set(std::string name, std::string value)#

Insert new element or update value of existing element with specific key.

template<typename Key>
inline auto get(Key &&key) noexcept -> optional<mapped_type&>#

Get value with specific key.

template<typename Key>
inline auto get(Key &&key) const noexcept -> optional<const mapped_type&>#

Get value with specific key.

inline auto erase(const std::string &name) -> optional<mapped_type>#

Remove element with specific key.

inline auto at(const std::string &name) -> mapped_type&#

Get value with specific key.

inline auto at(const std::string &name) const -> const mapped_type&#

Get value with specific key.

inline auto operator[](const std::string &name) -> mapped_type&#

Get or insert specific element.

inline auto to_string() const -> std::string#

Converts key/value pairs to query string.

inline auto begin() noexcept -> iterator#

Get an iterator to the beginning.

inline auto begin() const noexcept -> const_iterator#

Get an iterator to the beginning.

inline auto cbegin() const noexcept -> const_iterator#

Get an iterator to the beginning.

inline auto end() noexcept -> iterator#

Get an iterator to the end.

inline auto end() const noexcept -> const_iterator#

Get an iterator to the end.

inline auto cend() const noexcept -> const_iterator#

Get an iterator to the end.