:relfileprefix: ../../
[#B7D2A57D498C57F2EAD1EE6D183F5DFDE0AAF97D]

= Class pct_string_view

pass:v,q[A reference to a valid percent-encoded string]


== Synopsis

Declared in header `</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]
|===
|Name |Description
|xref:boost/urls/grammar/string_view_base/const_iterator.adoc[`pass:v[const_iterator]`] |
pass:v,q[The const iterator type]

|xref:boost/urls/grammar/string_view_base/const_pointer.adoc[`pass:v[const_pointer]`] |
pass:v,q[The const pointer type]

|xref:boost/urls/grammar/string_view_base/const_reference.adoc[`pass:v[const_reference]`] |
pass:v,q[The const reference type]

|xref:boost/urls/grammar/string_view_base/const_reverse_iterator.adoc[`pass:v[const_reverse_iterator]`] |
pass:v,q[The const reverse iterator type]

|xref:boost/urls/grammar/string_view_base/difference_type.adoc[`pass:v[difference_type]`] |
pass:v,q[The difference type]

|xref:boost/urls/grammar/string_view_base/iterator.adoc[`pass:v[iterator]`] |
pass:v,q[The iterator type]

|xref:boost/urls/grammar/string_view_base/pointer.adoc[`pass:v[pointer]`] |
pass:v,q[The pointer type]

|xref:boost/urls/grammar/string_view_base/reference.adoc[`pass:v[reference]`] |
pass:v,q[The reference type]

|xref:boost/urls/grammar/string_view_base/reverse_iterator.adoc[`pass:v[reverse_iterator]`] |
pass:v,q[The reverse iterator type]

|xref:boost/urls/grammar/string_view_base/size_type.adoc[`pass:v[size_type]`] |
pass:v,q[The size type]

|xref:boost/urls/grammar/string_view_base/traits_type.adoc[`pass:v[traits_type]`] |
pass:v,q[The character traits]

|xref:boost/urls/grammar/string_view_base/value_type.adoc[`pass:v[value_type]`] |
pass:v,q[The value type]

|===
==  Member Functions
[,cols=2]
|===
|Name |Description
|xref:boost/urls/grammar/string_view_base/at.adoc[`pass:v[at]`] |
pass:v,q[Access a character]

|xref:boost/urls/grammar/string_view_base/back.adoc[`pass:v[back]`] |
pass:v,q[Return the last character]

|xref:boost/urls/grammar/string_view_base/begin.adoc[`pass:v[begin]`] |
pass:v,q[Return an iterator to the beginning]

|xref:boost/urls/grammar/string_view_base/cbegin.adoc[`pass:v[cbegin]`] |
pass:v,q[Return an iterator to the beginning]

|xref:boost/urls/grammar/string_view_base/cend.adoc[`pass:v[cend]`] |
pass:v,q[Return an iterator to the end]

|xref:boost/urls/grammar/string_view_base/compare.adoc[`pass:v[compare]`] |
pass:v,q[Return the result of comparing to another string]

|xref:boost/urls/grammar/string_view_base/contains.adoc[`pass:v[contains]`] |
pass:v,q[Return true if matching characters are found]

|xref:boost/urls/grammar/string_view_base/copy.adoc[`pass:v[copy]`] |
pass:v,q[Copy the characters to another buffer]

|xref:boost/urls/grammar/string_view_base/crbegin.adoc[`pass:v[crbegin]`] |

|xref:boost/urls/grammar/string_view_base/crend.adoc[`pass:v[crend]`] |

|xref:boost/urls/grammar/string_view_base/data.adoc[`pass:v[data]`] |
pass:v,q[Return a pointer to the character buffer]

|xref:boost/urls/pct_string_view/decode.adoc[`pass:v[decode]`] |
pass:v,q[Return the string with percent-decoding]

|xref:boost/urls/pct_string_view/decoded_size.adoc[`pass:v[decoded_size]`] |
pass:v,q[Return the decoded size]

|xref:boost/urls/grammar/string_view_base/empty.adoc[`pass:v[empty]`] |
pass:v,q[Return true if the string is empty]

|xref:boost/urls/grammar/string_view_base/end.adoc[`pass:v[end]`] |
pass:v,q[Return an iterator to the end]

|xref:boost/urls/grammar/string_view_base/ends_with.adoc[`pass:v[ends_with]`] |
pass:v,q[Return true if a matching suffix exists]

|xref:boost/urls/grammar/string_view_base/find.adoc[`pass:v[find]`] |
pass:v,q[Return the position of matching characters]

|xref:boost/urls/grammar/string_view_base/find_first_not_of.adoc[`pass:v[find_first_not_of]`] |
pass:v,q[Return the position of the first non-match]

|xref:boost/urls/grammar/string_view_base/find_first_of.adoc[`pass:v[find_first_of]`] |
pass:v,q[Return the position of the first match]

|xref:boost/urls/grammar/string_view_base/find_last_not_of.adoc[`pass:v[find_last_not_of]`] |
pass:v,q[Return the position of the last non-match]

|xref:boost/urls/grammar/string_view_base/find_last_of.adoc[`pass:v[find_last_of]`] |
pass:v,q[Return the position of the last match]

|xref:boost/urls/grammar/string_view_base/front.adoc[`pass:v[front]`] |
pass:v,q[Return the first character]

|xref:boost/urls/grammar/string_view_base/length.adoc[`pass:v[length]`] |
pass:v,q[Return the size]

|xref:boost/urls/grammar/string_view_base/max_size.adoc[`pass:v[max_size]`] |
pass:v,q[Return the maximum allowed size]

|xref:boost/urls/grammar/string_view_base/2conversion-06.adoc[`pass:v[operator string]`] |
pass:v,q[Conversion]

|xref:boost/urls/grammar/string_view_base/2conversion-0e.adoc[`pass:v[operator string_view]`] |
pass:v,q[Conversion]

|xref:boost/urls/pct_string_view/operator_star.adoc[`pass:v[operator*]`] |
pass:v,q[Return the string as a range of decoded characters]

|xref:boost/urls/pct_string_view/operator_ptr.adoc[`pass:v[operator->]`] |

|xref:boost/urls/pct_string_view/operator_assign.adoc[`pass:v[operator=]`] |
pass:v,q[Assignment]

|xref:boost/urls/grammar/string_view_base/operator_subs.adoc[`pass:v[operator[]]`] |
pass:v,q[Access a character]

|xref:boost/urls/pct_string_view/2constructor.adoc[`pass:v[pct_string_view]`] |
pass:v,q[Constructor (deleted)]

pass:v,q[Constructor]

|xref:boost/urls/grammar/string_view_base/rbegin.adoc[`pass:v[rbegin]`] |

|xref:boost/urls/grammar/string_view_base/rend.adoc[`pass:v[rend]`] |

|xref:boost/urls/grammar/string_view_base/rfind.adoc[`pass:v[rfind]`] |
pass:v,q[Return the position of matching characters]

|xref:boost/urls/grammar/string_view_base/size.adoc[`pass:v[size]`] |
pass:v,q[Return the size]

|xref:boost/urls/grammar/string_view_base/starts_with.adoc[`pass:v[starts_with]`] |
pass:v,q[Return true if a matching prefix exists]

|xref:boost/urls/grammar/string_view_base/substr.adoc[`pass:v[substr]`] |
pass:v,q[Return a view to part of the string]

|xref:boost/urls/pct_string_view/swap.adoc[`pass:v[swap]`] |
pass:v,q[Swap]

|===
==  Static Data Members
[,cols=2]
|===
|Name |Description
|xref:boost/urls/grammar/string_view_base/npos.adoc[`pass:v[npos]`] |
pass:v,q[A constant used to represent "no position"]

|===
==  Friends
[,cols=2]
|===
|Name |Description
|xref:boost/urls/grammar/string_view_base/8friend-09d.adoc[`pass:v[hash_value]`] |
pass:v,q[Return the hash of this value]

|xref:boost/urls/pct_string_view/8friend.adoc[`pass:v[make_pct_string_view]`] |

|xref:boost/urls/grammar/string_view_base/8friend-017.adoc[`pass:v[operator!=]`] |

|xref:boost/urls/grammar/string_view_base/8friend-010.adoc[`pass:v[operator<]`] |

|xref:boost/urls/grammar/string_view_base/8friend-00.adoc[`pass:v[operator<<]`] |

|xref:boost/urls/grammar/string_view_base/8friend-0c.adoc[`pass:v[operator<=]`] |

|xref:boost/urls/grammar/string_view_base/8friend-095.adoc[`pass:v[operator==]`] |

|xref:boost/urls/grammar/string_view_base/8friend-0d.adoc[`pass:v[operator>]`] |

|xref:boost/urls/grammar/string_view_base/8friend-02.adoc[`pass:v[operator>=]`] |

|===

== Description

pass:v,q[Objects of this type behave like a] pass:v,q[`core::string_view` and have the same interface,]
pass:v,q[but offer an additional invariant: they can]
pass:v,q[only be constructed from strings containing]
pass:v,q[valid percent-escapes.]
pass:v,q[Attempting construction from a string]
pass:v,q[containing invalid or malformed percent]
pass:v,q[escapes results in an exception.]

=== Operators
pass:v,q[The following operators are supported between]
xref:boost/urls/pct_string_view/2constructor-00.adoc[pct_string_view]
pass:v,q[and any object that is]
pass:v,q[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;
----



