Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for a snapshot of the develop branch, built from commit 541b305a06.
PrevUpHomeNext
pct_string_view::decode

Return the string with percent-decoding.

Synopsis
template<
    class StringToken = string_token::return_string>
StringToken::result_type
decode(
    encoding_opts opt = {},
    StringToken&& token = {}) const;
Description

This function converts percent escapes in the string into ordinary characters and returns the result. When called with no arguments, the return type is std::string. Otherwise, the return type and style of output is determined by which string token is passed.

Example
assert( pct_string_view( "Program%20Files" ).decode() == "Program Files" );
Complexity

Linear in this->size().

Exception Safety

Calls to allocate may throw. String tokens may throw exceptions.

Parameters

Name

Description

opt

The options for encoding. If this parameter is omitted, the default options are used.

token

An optional string token. If this parameter is omitted, then a new std::string is returned. Otherwise, the function return type is the result type of the token.

See Also

encoding_opts, string_token::return_string.


PrevUpHomeNext