Boost.URL Logo

PrevUpHomeNext

pct_decode_unchecked

Apply percent-decoding to a string.

Synopsis

Defined in header <boost/url/pct_encoding.hpp>

std::size_t
pct_decode_unchecked(
    char* dest,
    char const* end,
    string_view s,
    pct_decode_opts const& opt = {});
Description

This function applies percent-decoding to the input string, without performing any checking to ensure that the input string is valid. The contents of the output buffer will never be left undefined, regardless of input.

Example
char *dest = new char[MAX_LENGTH];
std::size_t decoded_size = pct_decode_unchecked( dest, dest + MAX_LENGTH,
        "Program%20Files" );

assert( decoded_size == 13 );
assert( strncmp("Program Files", dest, decoded_size) == 0 );
Exception Safety

Throws nothing.

Return Value

The number of bytes written to the destination.

Parameters

Name

Description

dest

A pointer to the beginning of the output buffer to hold the percent-decoded characters.

end

A pointer to one past the end of the output buffer.

s

The string to apply percent-decoding to.

opt

Optional settings for applying the decoding. If this parameter is omitted, default settings are used.

Convenience header <boost/url.hpp>


PrevUpHomeNext