namespace
utilsUtility namespace.
Classes
- struct MxcUrl
- Representation of Matrix Content (MXC) URIs.
Functions
-
template<class T>auto deserialize(std::string_view data) -> T
- deserialize a type or string from json.
-
template<class T>auto serialize(const T& obj) -> std::string
- serialize a type or string to json.
- auto parse_mxc_url(const std::string& url) -> MxcUrl
- Parse a matrix content URI into its server & media_id components.
- auto is_number(const std::string& s) -> bool
- Check if the given string represents a number.
- auto random_token(uint8_t len = 12, bool with_symbols = true) -> std::string noexcept
- Generates a random string of the given size.
- auto query_params(const std::map<std::string, std::string>& params) -> std::string noexcept
- Construct query string from the given parameter pairs.
- auto url_encode(std::string_view s) -> std::string noexcept
- URL-encode the input string.
Function documentation
template<class T>
T mtx:: client:: utils:: deserialize(std::string_view data)
deserialize a type or string from json.
Used internally to deserialize the response types for the various http methods.
template<class T>
std::string mtx:: client:: utils:: serialize(const T& obj)
serialize a type or string to json.
Used internally to serialize the request types for the various http methods.
MxcUrl mtx:: client:: utils:: parse_mxc_url(const std::string& url)
#include <include/mtxclient/utils.hpp>
Parse a matrix content URI into its server & media_id components.
bool mtx:: client:: utils:: is_number(const std::string& s)
#include <include/mtxclient/utils.hpp>
Check if the given string represents a number.
std::string mtx:: client:: utils:: random_token(uint8_t len = 12,
bool with_symbols = true) noexcept
#include <include/mtxclient/utils.hpp>
Generates a random string of the given size.
std::string mtx:: client:: utils:: query_params(const std::map<std::string, std::string>& params) noexcept
#include <include/mtxclient/utils.hpp>
Construct query string from the given parameter pairs.
std::string mtx:: client:: utils:: url_encode(std::string_view s) noexcept
#include <include/mtxclient/utils.hpp>
URL-encode the input string.