|
openMSX
|
This class implements a subset of the proposal for std::string_ref (proposed for the next c++ standard (c++1y)). More...
#include <string_ref.hh>
Public Types | |
| typedef size_t | size_type |
| typedef std::ptrdiff_t | difference_type |
| typedef const char * | const_iterator |
| typedef std::reverse_iterator < const_iterator > | const_reverse_iterator |
Static Public Attributes | |
| static const size_type | npos = size_type(-1) |
This class implements a subset of the proposal for std::string_ref (proposed for the next c++ standard (c++1y)).
It has an interface that is close to std::string, but it does not own the memory for the string. Basically it's just a wrapper around: const char* + length.
Definition at line 18 of file string_ref.hh.
| typedef const char* string_ref::const_iterator |
Definition at line 23 of file string_ref.hh.
| typedef std::reverse_iterator<const_iterator> string_ref::const_reverse_iterator |
Definition at line 24 of file string_ref.hh.
| typedef std::ptrdiff_t string_ref::difference_type |
Definition at line 22 of file string_ref.hh.
| typedef size_t string_ref::size_type |
Definition at line 21 of file string_ref.hh.
|
inline |
Definition at line 29 of file string_ref.hh.
Referenced by substr().
|
inline |
Definition at line 31 of file string_ref.hh.
|
inline |
Definition at line 33 of file string_ref.hh.
|
inline |
Definition at line 35 of file string_ref.hh.
|
inline |
Definition at line 37 of file string_ref.hh.
|
inline |
Definition at line 39 of file string_ref.hh.
|
inline |
Definition at line 67 of file string_ref.hh.
Referenced by StringOp::endsWith(), openmsx::FileOperations::join(), and StringOp::trimRight().
|
inline |
Definition at line 49 of file string_ref.hh.
Referenced by find(), find_first_of(), find_last_of(), rend(), rfind(), utf8::unchecked::size(), and utf8::unchecked::substr().
|
inline |
Definition at line 75 of file string_ref.hh.
Referenced by openmsx::XMLElement::clearName(), remove_prefix(), remove_suffix(), StringOp::splitOnFirst(), StringOp::splitOnLast(), and openmsx::DBParser::start().
| int string_ref::compare | ( | string_ref | x | ) | const |
Definition at line 41 of file string_ref.cc.
Referenced by operator<().
|
inline |
Definition at line 68 of file string_ref.hh.
Referenced by openmsx::ConsoleLine::addChunk(), openmsx::TclObject::addListElement(), openmsx::TclObject::checkCommand(), openmsx::TclObject::checkExpression(), StringMapEntry< T >::create(), ends_with(), openmsx::FileOperations::expandCurrentDirFromDrive(), openmsx::FileOperations::expandTilde(), StringOp::caseless::operator()(), operator+(), StringOp::Builder::operator<<(), operator<<(), operator=(), operator==(), openmsx::SocketConnection::output(), openmsx::FileOperations::parseCommandFileArgument(), openmsx::TclObject::setString(), openmsx::Sha1Sum::Sha1Sum(), starts_with(), openmsx::DBParser::stop(), StringOp::stringToBool(), and openmsx::TclObject::TclObject().
|
inline |
Definition at line 56 of file string_ref.hh.
Referenced by StringOp::endsWith(), openmsx::FileOperations::expandTilde(), find(), openmsx::OSDWidget::findSubWidget(), openmsx::FileOperations::getUserHomeDir(), openmsx::FileOperations::isAbsolutePath(), openmsx::FileOperations::join(), openmsx::FileOperations::mkdirp(), openmsx::FileOperations::parseCommandFileArgument(), openmsx::HelpOption::parseOption(), rfind(), StringOp::split(), StringOp::startsWith(), StringOp::trimLeft(), StringOp::trimRight(), and openmsx::UserFileContext::UserFileContext().
|
inline |
Definition at line 50 of file string_ref.hh.
Referenced by find(), find_first_of(), find_last_of(), rbegin(), rfind(), utf8::unchecked::size(), and utf8::unchecked::substr().
| bool string_ref::ends_with | ( | string_ref | x | ) | const |
Definition at line 142 of file string_ref.cc.
References data(), and size().
Referenced by StringOp::endsWith(), and openmsx::Reactor::getHwConfigs().
| string_ref::size_type string_ref::find | ( | string_ref | s | ) | const |
Definition at line 58 of file string_ref.cc.
References begin(), empty(), end(), npos, and size().
Referenced by openmsx::DBParser::doctype(), find(), find_first_of(), StringOp::parseRange(), rfind(), StringOp::trimLeft(), and StringOp::trimRight().
| string_ref::size_type string_ref::find | ( | char | c | ) | const |
| string_ref::size_type string_ref::find_first_of | ( | string_ref | s | ) | const |
Definition at line 107 of file string_ref.cc.
References begin(), end(), and npos.
Referenced by openmsx::FileOperations::expandTilde(), find_last_of(), and StringOp::splitOnFirst().
| string_ref::size_type string_ref::find_first_of | ( | char | c | ) | const |
Definition at line 113 of file string_ref.cc.
References find().
| string_ref::size_type string_ref::find_last_of | ( | string_ref | s | ) | const |
Definition at line 121 of file string_ref.cc.
References begin(), end(), find_first_of(), npos, rbegin(), and rend().
Referenced by StringOp::splitOnLast().
| string_ref::size_type string_ref::find_last_of | ( | char | c | ) | const |
Definition at line 127 of file string_ref.cc.
References rfind().
|
inline |
Definition at line 66 of file string_ref.hh.
Referenced by StringOp::startsWith().
|
inline |
Definition at line 42 of file string_ref.hh.
|
inline |
Definition at line 61 of file string_ref.hh.
|
inline |
Definition at line 78 of file string_ref.hh.
References remove_suffix().
Referenced by StringOp::trimRight().
|
inline |
Definition at line 79 of file string_ref.hh.
References remove_prefix().
Referenced by StringOp::trimLeft().
|
inline |
Definition at line 51 of file string_ref.hh.
References end().
Referenced by find_last_of(), and rfind().
| void string_ref::remove_prefix | ( | size_type | n | ) |
| void string_ref::remove_suffix | ( | size_type | n | ) |
Definition at line 29 of file string_ref.cc.
References clear().
Referenced by openmsx::Reactor::getHwConfigs(), and pop_back().
|
inline |
Definition at line 52 of file string_ref.hh.
References begin().
Referenced by find_last_of(), and rfind().
| string_ref::size_type string_ref::rfind | ( | string_ref | s | ) | const |
Definition at line 85 of file string_ref.cc.
References begin(), empty(), end(), npos, and size().
Referenced by openmsx::CartCmd::execute(), find_last_of(), openmsx::FileOperations::getBaseName(), openmsx::FileOperations::getExtension(), openmsx::FileOperations::getFilename(), and openmsx::FileOperations::stripExtension().
| string_ref::size_type string_ref::rfind | ( | char | c | ) | const |
|
inline |
Definition at line 55 of file string_ref.hh.
Referenced by openmsx::ConsoleLine::addChunk(), openmsx::TclObject::addListElement(), openmsx::TclObject::checkCommand(), openmsx::TclObject::checkExpression(), StringMapEntry< T >::create(), ends_with(), openmsx::CartCmd::execute(), openmsx::FileOperations::expandCurrentDirFromDrive(), openmsx::FileOperations::expandTilde(), find(), openmsx::CartridgeSlotManager::getSlotNum(), openmsx::FileOperations::isAbsolutePath(), StringOp::caseless::operator()(), operator+(), StringOp::Builder::operator<<(), operator<<(), operator=(), operator==(), openmsx::SocketConnection::output(), openmsx::FileOperations::parseCommandFileArgument(), rfind(), openmsx::TclObject::setString(), openmsx::Sha1Sum::Sha1Sum(), starts_with(), StringOp::stringToBool(), and openmsx::TclObject::TclObject().
| bool string_ref::starts_with | ( | string_ref | x | ) | const |
Definition at line 136 of file string_ref.cc.
References data(), and size().
Referenced by openmsx::JoystickConfigChecker::check(), and StringOp::startsWith().
| string string_ref::str | ( | ) | const |
Definition at line 10 of file string_ref.cc.
Referenced by openmsx::XMLElement::addAttribute(), openmsx::AfterCommand::execute(), openmsx::DiskCommand::execute(), openmsx::LaserdiscCommand::execute(), openmsx::BindCmd::execute(), openmsx::FileOperations::expandCurrentDirFromDrive(), openmsx::FileOperations::expandTilde(), openmsx::FileOperations::getAbsolutePath(), openmsx::FileOperations::getConventionalPath(), openmsx::Reactor::getHwConfigs(), openmsx::MSXMultiIODevice::getName(), openmsx::MSXMultiMemDevice::getName(), openmsx::FileOperations::getNativePath(), openmsx::FileOperations::getNextNumberedFileName(), openmsx::FileBase::getOriginalName(), openmsx::FileOperations::getUserHomeDir(), openmsx::FileOperations::join(), openmsx::FileOperations::parseCommandFileArgument(), openmsx::XMLElement::setAttribute(), openmsx::XMLElement::setData(), openmsx::XMLElement::setName(), openmsx::OSDText::setProperty(), openmsx::OSDRectangle::setProperty(), StringOp::split(), stoi(), stoll(), stoul(), StringOp::toLower(), openmsx::Event::toString(), openmsx::MSXCliComm::update(), and openmsx::GlobalCliComm::update().
| string_ref string_ref::substr | ( | size_type | pos, |
| size_type | n = npos |
||
| ) | const |
Definition at line 52 of file string_ref.cc.
References string_ref().
Referenced by openmsx::ConsoleLine::chunkText(), openmsx::DBParser::doctype(), openmsx::CartCmd::execute(), openmsx::FileOperations::expandCurrentDirFromDrive(), openmsx::FileOperations::expandTilde(), openmsx::FileOperations::getBaseName(), openmsx::FileOperations::getExtension(), openmsx::FileOperations::getFilename(), openmsx::CDImageCLI::parseOption(), openmsx::HDImageCLI::parseOption(), StringOp::parseRange(), StringOp::splitOnFirst(), StringOp::splitOnLast(), openmsx::FileOperations::stripExtension(), and openmsx::GlobalCommandController::tabCompletion().
Definition at line 26 of file string_ref.hh.
Referenced by openmsx::ConsoleLine::chunkText(), openmsx::DBParser::doctype(), openmsx::CartCmd::execute(), openmsx::FileOperations::expandTilde(), find(), find_first_of(), find_last_of(), openmsx::FileOperations::getBaseName(), openmsx::FileOperations::getExtension(), openmsx::FileOperations::getFilename(), StringOp::parseRange(), rfind(), StringOp::splitOnFirst(), StringOp::splitOnLast(), openmsx::FileOperations::stripExtension(), utf8::unchecked::substr(), StringOp::trimLeft(), and StringOp::trimRight().
1.8.1.2