13 #include <type_traits> 24 template<
bool Is_Uint64_Longer>
32 if( v >
static_cast<std::uint64_t>(std::numeric_limits<std::size_t>::max()) )
33 throw std::runtime_error(
"64-bit value can't be safely truncated " 34 "into std::size_t type" );
35 return static_cast<std::size_t>(v);
61 return safe_uint64_to_size_t<(
sizeof(std::uint64_t) >
sizeof(std::size_t))>::truncate(v);
std::size_t uint64_to_size_t(std::uint64_t v)
Helper function for truncating uint64 to std::size_t with exception if that truncation will lead to d...
void normalize_to(string_view_t what, char *dest)
Perform normalization of URI value.
static std::size_t truncate(std::uint64_t v)
static std::size_t truncate(std::uint64_t v)
RESTINIO_NODISCARD expected_t< unescape_percent_encoding_success_t, unescape_percent_encoding_failure_t > do_unescape_percent_encoding(const string_view_t data, Chars_Collector &&collector)
The actual implementation of unescape-percent-encoding procedure.
std::enable_if< std::is_same< Parameter_Container, query_string_params_t >::value||std::is_same< Parameter_Container, router::route_params_t >::value, optional_t< Value_Type > >::type opt_value(const Parameter_Container ¶ms, string_view_t key)
Gets the value of a parameter specified by key wrapped in optional_t<Value_Type> if parameter exists ...