...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Return the buffer size needed for percent-encoding.
Defined in header <boost/url/encode.hpp>
template< class CharSet> std::size_t encoded_size( string_view s, CharSet const& unreserved, encoding_opts opt = {});
This function returns the exact number of bytes necessary to store the result of applying percent-encoding to the string using the given options and character set. No encoding is actually performed.
assert( encoded_size( "My Stuff", pchars ) == 10 );
Throws nothing.
The number of bytes needed, excluding any null terminator.
Name |
Description |
---|---|
|
The string to measure. |
|
The set of characters that is not percent-encoded. |
|
The options for encoding. If this parameter is omitted, the default options are be used. |
encode
,
encoding_opts
,
make_pct_string_view
.
Convenience header <boost/url.hpp>