Hyper API for C++
0.0.16638
Hyper client library for C++ applications
|
Describes an object that can refer to a constant, contiguous sequence of char-like objects. More...
#include <string_view.hpp>
Public Member Functions | |
string_view (const char *data, size_t length) noexcept | |
Constructor. | |
string_view (const char *c) | |
Constructor, implicit conversion from a null terminated character array. | |
string_view (const std::string &s) | |
Constructor, implicit conversion from a std::string. | |
size_t | size () const noexcept |
Returns the number of elements in the view. | |
const char * | data () const noexcept |
Returns a pointer to the underlying character array. More... | |
int | compare (const string_view &other) const noexcept |
Compares two character sequences. More... | |
operator std::string () const | |
Implicit conversion to std::string. | |
bool | empty () |
Returns whether the view is empty. | |
Friends | |
bool | operator== (const string_view &a, const string_view &b) noexcept |
Equality operator. | |
bool | operator> (const string_view &a, const string_view &b) noexcept |
Greater operator. | |
bool | operator!= (const string_view &a, const string_view &b) noexcept |
Not equal operator. | |
bool | operator< (const string_view &a, const string_view &b) noexcept |
Smaller operator. | |
bool | operator<= (const string_view &a, const string_view &b) noexcept |
Smaller or equal operator. | |
bool | operator>= (const string_view &a, const string_view &b) noexcept |
Greater or equal operator. | |
std::ostream & | operator<< (std::ostream &os, const string_view &v) |
Stream output operator. | |
Describes an object that can refer to a constant, contiguous sequence of char-like objects.
Surrogate for C++17 std::string_view
Definition at line 26 of file string_view.hpp.
|
noexcept |
Compares two character sequences.
|
inlinenoexcept |
Returns a pointer to the underlying character array.
The pointer is such that the range [data(); data() + size()) is valid and the values in it correspond to the values of the view.
Note that this character array is not guaranteed to be null-terminated.
Definition at line 55 of file string_view.hpp.