:relfileprefix: ../../
[#boost-urls-pct_string_view]

== xref:boost.adoc[pass:[boost]]::xref:boost/urls.adoc[pass:[urls]]::pct_string_view


A reference to a valid percent-encoded string


=== Synopsis

Declared in header `<https://www.github.com/boostorg/url/blob/develop/include/boost/url/pct_string_view.hpp#L73[boost/url/pct_string_view.hpp,window=blank_]>`

[source,cpp,subs="verbatim,macros,-callouts"]
----
class pct_string_view
    : public xref:boost/urls/grammar.adoc[grammar]::xref:boost/urls/grammar/string_view_base.adoc[string_view_base];
----

===  Types
[cols=2,separator=¦]
|===
¦Name ¦Description
¦xref:boost/urls/grammar/string_view_base/const_iterator.adoc[`const_iterator`]  ¦

The const iterator type

¦xref:boost/urls/grammar/string_view_base/const_pointer.adoc[`const_pointer`]  ¦

The const pointer type

¦xref:boost/urls/grammar/string_view_base/const_reference.adoc[`const_reference`]  ¦

The const reference type

¦xref:boost/urls/grammar/string_view_base/const_reverse_iterator.adoc[`const_reverse_iterator`]  ¦

The const reverse iterator type

¦xref:boost/urls/grammar/string_view_base/difference_type.adoc[`difference_type`]  ¦

The difference type

¦xref:boost/urls/grammar/string_view_base/iterator.adoc[`iterator`]  ¦

The iterator type

¦xref:boost/urls/grammar/string_view_base/pointer.adoc[`pointer`]  ¦

The pointer type

¦xref:boost/urls/grammar/string_view_base/reference.adoc[`reference`]  ¦

The reference type

¦xref:boost/urls/grammar/string_view_base/reverse_iterator.adoc[`reverse_iterator`]  ¦

The reverse iterator type

¦xref:boost/urls/grammar/string_view_base/size_type.adoc[`size_type`]  ¦

The size type

¦xref:boost/urls/grammar/string_view_base/traits_type.adoc[`traits_type`]  ¦

The character traits

¦xref:boost/urls/grammar/string_view_base/value_type.adoc[`value_type`]  ¦

The value type

|===
===  Member Functions
[cols=2,separator=¦]
|===
¦Name ¦Description
¦xref:boost/urls/grammar/string_view_base/at.adoc[`at`]  ¦

Access a character

¦xref:boost/urls/grammar/string_view_base/back.adoc[`back`]  ¦

Return the last character

¦xref:boost/urls/grammar/string_view_base/begin.adoc[`begin`]  ¦

Return an iterator to the beginning

¦xref:boost/urls/grammar/string_view_base/cbegin.adoc[`cbegin`]  ¦

Return an iterator to the beginning

¦xref:boost/urls/grammar/string_view_base/cend.adoc[`cend`]  ¦

Return an iterator to the end

¦xref:boost/urls/grammar/string_view_base/compare.adoc[`compare`]  ¦

Return the result of comparing to another string

¦xref:boost/urls/grammar/string_view_base/contains.adoc[`contains`]  ¦

Return true if matching characters are found

¦xref:boost/urls/grammar/string_view_base/copy.adoc[`copy`]  ¦

Copy the characters to another buffer

¦xref:boost/urls/grammar/string_view_base/crbegin.adoc[`crbegin`]  ¦

Return a reverse iterator to the end

¦xref:boost/urls/grammar/string_view_base/crend.adoc[`crend`]  ¦

Return a reverse iterator to the beginning

¦xref:boost/urls/grammar/string_view_base/data.adoc[`data`]  ¦

Return a pointer to the character buffer

¦xref:boost/urls/pct_string_view/decode.adoc[`decode`]  ¦

Return the string with percent-decoding

¦xref:boost/urls/pct_string_view/decoded_size.adoc[`decoded_size`]  ¦

Return the decoded size

¦xref:boost/urls/grammar/string_view_base/empty.adoc[`empty`]  ¦

Return true if the string is empty

¦xref:boost/urls/grammar/string_view_base/end.adoc[`end`]  ¦

Return an iterator to the end

¦xref:boost/urls/grammar/string_view_base/ends_with.adoc[`ends_with`]  ¦

Return true if a matching suffix exists

¦xref:boost/urls/grammar/string_view_base/find.adoc[`find`]  ¦

Return the position of matching characters

¦xref:boost/urls/grammar/string_view_base/find_first_not_of.adoc[`find_first_not_of`]  ¦

Return the position of the first non-match

¦xref:boost/urls/grammar/string_view_base/find_first_of.adoc[`find_first_of`]  ¦

Return the position of the first match

¦xref:boost/urls/grammar/string_view_base/find_last_not_of.adoc[`find_last_not_of`]  ¦

Return the position of the last non-match

¦xref:boost/urls/grammar/string_view_base/find_last_of.adoc[`find_last_of`]  ¦

Return the position of the last match

¦xref:boost/urls/grammar/string_view_base/front.adoc[`front`]  ¦

Return the first character

¦xref:boost/urls/grammar/string_view_base/length.adoc[`length`]  ¦

Return the size

¦xref:boost/urls/grammar/string_view_base/max_size.adoc[`max_size`]  ¦

Return the maximum allowed size

¦xref:boost/urls/grammar/string_view_base/2conversion-06.adoc[`operator std::string`]  ¦

Conversion

¦xref:boost/urls/grammar/string_view_base/2conversion-0e.adoc[`operator core::string_view`]  ¦

Conversion

¦xref:boost/urls/pct_string_view/operator_star.adoc[`operator*`]  ¦

Return the string as a range of decoded characters

¦xref:boost/urls/pct_string_view/operator_ptr.adoc[`operator->`]  ¦

Arrow support

¦xref:boost/urls/pct_string_view/operator_assign.adoc[`operator=`]  ¦

Assignment

¦xref:boost/urls/grammar/string_view_base/operator_subs.adoc[`operator[]`]  ¦

Access a character

¦xref:boost/urls/pct_string_view/2constructor.adoc[`pct_string_view`] [.small]#[constructor]# ¦

Constructor


Constructor (deleted)

¦xref:boost/urls/grammar/string_view_base/rbegin.adoc[`rbegin`]  ¦

Return a reverse iterator to the end

¦xref:boost/urls/grammar/string_view_base/rend.adoc[`rend`]  ¦

Return a reverse iterator to the beginning

¦xref:boost/urls/grammar/string_view_base/rfind.adoc[`rfind`]  ¦

Return the position of matching characters

¦xref:boost/urls/grammar/string_view_base/size.adoc[`size`]  ¦

Return the size

¦xref:boost/urls/grammar/string_view_base/starts_with.adoc[`starts_with`]  ¦

Return true if a matching prefix exists

¦xref:boost/urls/grammar/string_view_base/substr.adoc[`substr`]  ¦

Return a view to part of the string

¦xref:boost/urls/pct_string_view/swap.adoc[`swap`]  ¦

Swap

|===
===  Static Data Members
[cols=2,separator=¦]
|===
¦Name ¦Description
¦xref:boost/urls/grammar/string_view_base/npos.adoc[`npos`]  ¦

A constant used to represent "no position"

|===
===  Friends
[cols=2,separator=¦]
|===
¦Name ¦Description
¦xref:boost/urls/grammar/string_view_base/08friend-09d.adoc[`hash_value`]  ¦

Return the hash of this value

¦xref:boost/urls/pct_string_view/08friend.adoc[`make_pct_string_view`]  ¦

Return a valid percent-encoded string

¦xref:boost/urls/grammar/string_view_base/08friend-017.adoc[`operator!=`]  ¦

Compare two string views for inequality

¦xref:boost/urls/grammar/string_view_base/08friend-010.adoc[`operator<`]  ¦

Compare two string views for less than

¦xref:boost/urls/grammar/string_view_base/08friend-0a.adoc[`operator<<`]  ¦

Format a string to an output stream

¦xref:boost/urls/grammar/string_view_base/08friend-0c.adoc[`operator<=`]  ¦

Compare two string views for less than or equal

¦xref:boost/urls/grammar/string_view_base/08friend-095.adoc[`operator==`]  ¦

Compare two string views for equality

¦xref:boost/urls/grammar/string_view_base/08friend-0d.adoc[`operator>`]  ¦

Compare two string views for greater than

¦xref:boost/urls/grammar/string_view_base/08friend-02.adoc[`operator>=`]  ¦

Compare two string views for greater than or equal

|===

=== Description


Objects of this type behave like a
`core::string_view` and have the same interface,
but offer an additional invariant: they can
only be constructed from strings containing
valid percent-escapes.

Attempting construction from a string
containing invalid or malformed percent
escapes results in an exception.

=== The following operators are supported between

xref:boost/urls/pct_string_view/2constructor-00.adoc[pct_string_view]
and any object that is
convertible to `core::string_view`
[,cpp]
----
bool operator==( pct_string_view, pct_string_view ) noexcept;
bool operator!=( pct_string_view, pct_string_view ) noexcept;
bool operator<=( pct_string_view, pct_string_view ) noexcept;
bool operator< ( pct_string_view, pct_string_view ) noexcept;
bool operator> ( pct_string_view, pct_string_view ) noexcept;
bool operator>=( pct_string_view, pct_string_view ) noexcept;
----



