Super simple, unmutable, string_view with small string optimization. If the string is 15 bytes or less, it is copied, otherwise, StringRef store a not-owning reference.
More...
#include <string_ref_sso.h>
|
static const uint8_t | SSO_SIZE = sizeof(noSSO) - 1 |
|
static const uint64_t | TYPE_BIT = uint64_t(1) << (sizeof(size_t) * 8 - 1) |
|
Super simple, unmutable, string_view with small string optimization. If the string is 15 bytes or less, it is copied, otherwise, StringRef store a not-owning reference.
Definition at line 21 of file string_ref_sso.h.
◆ StringRef() [1/4]
PJ::StringRef::StringRef |
( |
| ) |
|
|
inline |
◆ StringRef() [2/4]
PJ::StringRef::StringRef |
( |
const std::string & |
str | ) |
|
|
inline |
◆ StringRef() [3/4]
PJ::StringRef::StringRef |
( |
const char * |
str | ) |
|
|
inline |
◆ StringRef() [4/4]
PJ::StringRef::StringRef |
( |
const char * |
data_ptr, |
|
|
size_t |
length |
|
) |
| |
|
inlineexplicit |
◆ data()
const char* PJ::StringRef::data |
( |
| ) |
const |
|
inline |
◆ isSSO()
bool PJ::StringRef::isSSO |
( |
| ) |
const |
|
inline |
◆ size()
size_t PJ::StringRef::size |
( |
| ) |
const |
|
inline |
◆ _storage
union { ... } PJ::StringRef::_storage |
◆ no_sso
noSSO PJ::StringRef::no_sso |
◆ sso
◆ SSO_SIZE
const uint8_t PJ::StringRef::SSO_SIZE = sizeof(noSSO) - 1 |
|
staticprivate |
◆ TYPE_BIT
const uint64_t PJ::StringRef::TYPE_BIT = uint64_t(1) << (sizeof(size_t) * 8 - 1) |
|
staticprivate |
The documentation for this class was generated from the following file: