Hyper API for C++ 0.0.20746
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. | |
int | compare (const string_view &other) const noexcept |
Compares two character sequences. | |
operator std::string () const | |
Implicit conversion to std::string. | |
bool | empty () |
Returns whether the view is empty. | |
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.
|
inlinenoexcept |
Constructor.
Definition at line 29 of file string_view.hpp.
|
inline |
Constructor, implicit conversion from a null terminated character array.
Definition at line 34 of file string_view.hpp.
|
inline |
Constructor, implicit conversion from a std::string.
Definition at line 39 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.
|
inline |
Returns whether the view is empty.
Definition at line 99 of file string_view.hpp.
|
inline |
Implicit conversion to std::string.
Definition at line 68 of file string_view.hpp.
|
inlinenoexcept |
Returns the number of elements in the view.
Definition at line 46 of file string_view.hpp.