[#boost-urls-grammar-string_view_base]
= xref:boost.adoc[boost]::xref:boost/urls.adoc[urls]::xref:boost/urls/grammar.adoc[grammar]::string&lowbar;view&lowbar;base
:relfileprefix: ../../../
:mrdocs:

Common functionality for string views

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L36[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class string&lowbar;view&lowbar;base;
----

== Description

This base class is used to provide common member functions for reference types that behave like string views&period; This cannot be instantiated directly&semi; instead, derive from the type and provide constructors which offer any desired preconditions and invariants&period;

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:boost/urls/grammar/string_view_base/const_iterator.adoc[`const&lowbar;iterator`] 
| The const iterator type
| xref:boost/urls/grammar/string_view_base/const_pointer.adoc[`const&lowbar;pointer`] 
| The const pointer type
| xref:boost/urls/grammar/string_view_base/const_reference.adoc[`const&lowbar;reference`] 
| The const reference type
| xref:boost/urls/grammar/string_view_base/const_reverse_iterator.adoc[`const&lowbar;reverse&lowbar;iterator`] 
| The const reverse iterator type
| xref:boost/urls/grammar/string_view_base/difference_type.adoc[`difference&lowbar;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&lowbar;iterator`] 
| The reverse iterator type
| xref:boost/urls/grammar/string_view_base/size_type.adoc[`size&lowbar;type`] 
| The size type
| xref:boost/urls/grammar/string_view_base/traits_type.adoc[`traits&lowbar;type`] 
| The character traits
| xref:boost/urls/grammar/string_view_base/value_type.adoc[`value&lowbar;type`] 
| The value type
|===


== Member Functions

[cols="1,4"]
|===
| 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-06.adoc[`compare`] 
| Return the result of comparing to another string
| xref:boost/urls/grammar/string_view_base/contains-0a.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/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-09.adoc[`ends&lowbar;with`] 
| Return true if a matching suffix exists
| xref:boost/urls/grammar/string_view_base/find-0e.adoc[`find`] 
| Return the position of matching characters
| xref:boost/urls/grammar/string_view_base/find_first_not_of-01.adoc[`find&lowbar;first&lowbar;not&lowbar;of`] 
| Return the position of the first non&hyphen;match
| xref:boost/urls/grammar/string_view_base/find_first_of-047.adoc[`find&lowbar;first&lowbar;of`] 
| Return the position of the first match
| xref:boost/urls/grammar/string_view_base/find_last_not_of-03e.adoc[`find&lowbar;last&lowbar;not&lowbar;of`] 
| Return the position of the last non&hyphen;match
| xref:boost/urls/grammar/string_view_base/find_last_of-0b.adoc[`find&lowbar;last&lowbar;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&lowbar;size`] 
| Return the maximum allowed size
| xref:boost/urls/grammar/string_view_base/operator_subs.adoc[`operator&lsqb;&rsqb;`] 
| Access a character
| 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-05.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-02.adoc[`starts&lowbar;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/grammar/string_view_base/2conversion-0e.adoc[`operator std::string&lowbar;view`] 
| Conversion
| xref:boost/urls/grammar/string_view_base/2conversion-06.adoc[`operator std::string`] 
| Conversion
|===


== Static Data Members

[cols="1,4"]
|===
| Name| Description
| xref:boost/urls/grammar/string_view_base/npos.adoc[`npos`] 
| A constant used to represent &quot;no position&quot;
|===


== Protected Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:boost/urls/grammar/string_view_base/2constructor-04.adoc[`string&lowbar;view&lowbar;base`]         [.small]#[constructor]#
| Constructor
| xref:boost/urls/grammar/string_view_base/operator_assign.adoc[`operator&equals;`] 
| Assignment
| xref:boost/urls/grammar/string_view_base/swap.adoc[`swap`] 
| Swap
|===


== Protected Data Members

[cols="1,4"]
|===
| Name| Description
| xref:boost/urls/grammar/string_view_base/s_.adoc[`s&lowbar;`] 
| The referenced character buffer
|===


== Friends

[cols="1,4"]
|===
| Name| Description
| `xref:boost/urls/grammar/operator_lshift.adoc[boost::urls::grammar::operator&lt;&lt;]`
| Format a string to an output stream
| `xref:boost/urls/grammar/operator_ge.adoc[boost::urls::grammar::operator&gt;&equals;]`
| Compare two string views for greater than or equal
| `xref:boost/urls/grammar/operator_gt.adoc[boost::urls::grammar::operator&gt;]`
| Compare two string views for greater than
| `xref:boost/urls/grammar/operator_le.adoc[boost::urls::grammar::operator&lt;&equals;]`
| Compare two string views for less than or equal
| `xref:boost/urls/grammar/operator_lt.adoc[boost::urls::grammar::operator&lt;]`
| Compare two string views for less than
| `xref:boost/urls/grammar/operator_not_eq.adoc[boost::urls::grammar::operator!&equals;]`
| Compare two string views for inequality
| `xref:boost/urls/grammar/operator_eq.adoc[boost::urls::grammar::operator&equals;&equals;]`
| Compare two string views for equality
|===

== Derived Classes

[cols="1,4"]
|===
| Name| Description
| xref:boost/urls/pct_string_view.adoc[`pct&lowbar;string&lowbar;view`] 
| A reference to a valid percent&hyphen;encoded string
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
