openMSX
|
Like std::string_view, but with the extra guarantee that it refers to a zero-terminated string. More...
#include <zstring_view.hh>
Public Types | |
using | size_type = size_t |
using | const_iterator = const char * |
Public Member Functions | |
constexpr | zstring_view () |
constexpr | zstring_view (const char *s) |
constexpr | zstring_view (const char *s, size_t n) |
zstring_view (const std::string &s) | |
constexpr auto | begin () const |
constexpr auto | end () const |
constexpr auto | size () const |
constexpr auto | empty () const |
constexpr char | operator[] (size_type i) const |
constexpr char | front () const |
constexpr char | back () const |
constexpr const char * | data () const |
constexpr const char * | c_str () const |
constexpr auto | find (char c, size_type pos=0) const |
constexpr auto | find (const char *s, size_type pos=0) const |
constexpr zstring_view | substr (size_type pos) const |
constexpr std::string_view | substr (size_type pos, size_type count) const |
constexpr bool | starts_with (std::string_view sv) const |
constexpr bool | starts_with (char c) const |
constexpr bool | starts_with (const char *s) const |
constexpr bool | ends_with (std::string_view sv) const |
constexpr bool | ends_with (char c) const |
constexpr bool | ends_with (const char *s) const |
operator std::string () const | |
constexpr std::string_view | view () const |
explicit (false) const expr operator std | |
Static Public Attributes | |
static constexpr auto | npos = std::string_view::npos |
Friends | |
bool | operator== (const zstring_view &x, const std::string &y) |
constexpr friend bool | operator== (const zstring_view &x, const std::string_view &y) |
constexpr friend bool | operator== (const zstring_view &x, const char *y) |
std::ostream & | operator<< (std::ostream &os, const zstring_view &str) |
Like std::string_view, but with the extra guarantee that it refers to a zero-terminated string.
In other words it has this additional invariant: data()[size()] == '\0'
Current version only implements a subset of the std::string_view API. That is because:
Definition at line 21 of file zstring_view.hh.
using zstring_view::const_iterator = const char* |
Definition at line 25 of file zstring_view.hh.
using zstring_view::size_type = size_t |
Definition at line 24 of file zstring_view.hh.
|
inlineconstexpr |
Definition at line 29 of file zstring_view.hh.
|
inlineconstexpr |
Definition at line 31 of file zstring_view.hh.
|
inlineconstexpr |
Definition at line 33 of file zstring_view.hh.
|
inline |
Definition at line 35 of file zstring_view.hh.
|
inlineconstexpr |
Definition at line 49 of file zstring_view.hh.
|
inlineconstexpr |
Definition at line 38 of file zstring_view.hh.
Referenced by begin().
|
inlineconstexpr |
Definition at line 51 of file zstring_view.hh.
Referenced by openmsx::XMLDocumentHandler::attribute(), openmsx::displayFilterCombo(), openmsx::Interpreter::execute(), openmsx::Interpreter::executeFile(), openmsx::TTFFont::getSize(), openmsx::FileOperations::getStat(), openmsx::Interpreter::hasCommand(), openmsx::Interpreter::isComplete(), openmsx::SDLKey::keycodeFromString(), openmsx::PersistentElement< C, float >::load(), openmsx::PersistentElement< C, gl::ivec2 >::load(), openmsx::PersistentElement< C, gl::vec2 >::load(), openmsx::PersistentElement< C, gl::vec4 >::load(), openmsx::ImGuiMessages::loadLine(), openmsx::FileOperations::mkdir(), openmsx::FileOperations::openFile(), openmsx::FileOperations::openOfStream(), openmsx::FileOperations::openOfStream(), openmsx::ImGuiTrainer::paint(), openmsx::Interpreter::registerCommand(), openmsx::FileOperations::rmdir(), openmsx::ImGuiSymbols::save(), openmsx::SDLVideoSystem::setClipboardText(), openmsx::XMLDocumentHandler::start(), and openmsx::FileOperations::unlink().
|
inlineconstexpr |
Definition at line 50 of file zstring_view.hh.
Referenced by openmsx::RomFactory::create(), openmsx::Interpreter::registerSetting(), and openmsx::AviWriter::~AviWriter().
|
inlineconstexpr |
Definition at line 42 of file zstring_view.hh.
Referenced by openmsx::ImGuiTrainer::paint().
|
inlineconstexpr |
Definition at line 39 of file zstring_view.hh.
Referenced by end().
|
inlineconstexpr |
Definition at line 81 of file zstring_view.hh.
References view().
|
inlineconstexpr |
Definition at line 84 of file zstring_view.hh.
References view().
|
inlineconstexpr |
Definition at line 78 of file zstring_view.hh.
References view().
Referenced by openmsx::FileOperations::mkdir().
|
inline |
Definition at line 94 of file zstring_view.hh.
References view().
|
inlineconstexpr |
Definition at line 53 of file zstring_view.hh.
References view().
Referenced by openmsx::XMLDocumentHandler::doctype(), and openmsx::FileOperations::openFile().
|
inlineconstexpr |
Definition at line 56 of file zstring_view.hh.
References view().
|
inlineconstexpr |
Definition at line 48 of file zstring_view.hh.
|
inlineexplicit |
Definition at line 88 of file zstring_view.hh.
|
inlineconstexpr |
Definition at line 44 of file zstring_view.hh.
|
inlineconstexpr |
Definition at line 41 of file zstring_view.hh.
Referenced by openmsx::MSXtar::dirRaw(), and openmsx::XMLDocumentHandler::doctype().
|
inlineconstexpr |
Definition at line 72 of file zstring_view.hh.
References view().
|
inlineconstexpr |
Definition at line 75 of file zstring_view.hh.
References view().
|
inlineconstexpr |
Definition at line 69 of file zstring_view.hh.
References view().
|
inlineconstexpr |
Definition at line 60 of file zstring_view.hh.
Referenced by openmsx::XMLDocumentHandler::doctype().
|
inlineconstexpr |
Definition at line 64 of file zstring_view.hh.
References view().
|
inlineconstexpr |
Definition at line 91 of file zstring_view.hh.
Referenced by ends_with(), ends_with(), ends_with(), explicit(), find(), find(), starts_with(), starts_with(), starts_with(), and substr().
|
friend |
Definition at line 111 of file zstring_view.hh.
|
friend |
Definition at line 107 of file zstring_view.hh.
|
friend |
Definition at line 101 of file zstring_view.hh.
|
friend |
Definition at line 104 of file zstring_view.hh.
|
staticconstexpr |
Definition at line 27 of file zstring_view.hh.