Loading...
Searching...
No Matches
restinio::utils::uri_normalization::unreserved_chars Namespace Reference

## Namespaces

namespace | impl

## Functions

RESTINIO_NODISCARD std::size_t | estimate_required_capacity (string_view_t what)
| Calculate the size of a buffer to hold normalized value of a URI.
void | normalize_to (string_view_t what, char *dest)
| Perform normalization of URI value.

## Function Documentation

## estimate_required_capacity()

RESTINIO_NODISCARD std::size_t restinio::utils::uri_normalization::unreserved_chars::estimate_required_capacity | ( | string_view_t | what | ) |

inline

Calculate the size of a buffer to hold normalized value of a URI.

If what has some chars from unreserved set in percent-encoded form then this function returns the size of a buffer to hold normalized value of what. Otherwise the original size of what is returned.

Note
  This functions throws if what has invalid value.

Since
  v.0.6.2

Definition at line 619 of file percent_encoding.hpp.

## normalize_to()

void restinio::utils::uri_normalization::unreserved_chars::normalize_to | ( | string_view_t | what,
|  | char * | dest
| ) |  |

inline

Perform normalization of URI value.

Copies the content of what into dest and replaces the percent-encoded representation of chars from unreserved set into their normal values.

Attention
  The capacity of dest should be enough to hold the result value. It's assumed that estimate_required_capacity() is called before that function and the result of estimate_required_capacity() is used for allocation of a buffer for dest.

Note
  This functions throws if what has invalid value.

Since
  v.0.6.2

Definition at line 654 of file percent_encoding.hpp.