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 | |
using | size_type = size_t |
using | difference_type = std::ptrdiff_t |
using | const_iterator = const char * |
using | const_reverse_iterator = std::reverse_iterator< const_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.
using string_ref::const_iterator = const char* |
Definition at line 23 of file string_ref.hh.
using string_ref::const_reverse_iterator = std::reverse_iterator<const_iterator> |
Definition at line 24 of file string_ref.hh.
using string_ref::difference_type = std::ptrdiff_t |
Definition at line 22 of file string_ref.hh.
using string_ref::size_type = size_t |
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(), openmsx::DBParser::text(), and StringOp::trimRight().
|
inline |
Definition at line 49 of file string_ref.hh.
Referenced by begin(), find(), find_first_of(), find_last_of(), rend(), and rfind().
|
inline |
Definition at line 75 of file string_ref.hh.
Referenced by StringOp::splitOnFirst(), and StringOp::splitOnLast().
int string_ref::compare | ( | string_ref | x | ) | const |
|
inline |
Definition at line 68 of file string_ref.hh.
References str().
Referenced by openmsx::ConsoleLine::addChunk(), openmsx::TclObject::addListElement(), openmsx::FileOperations::expandCurrentDirFromDrive(), openmsx::FileOperations::expandTilde(), openmsx::SettingsManager::findSetting(), openmsx::Completer::formatListInColumns(), openmsx::CommandLineParser::getInterpreter(), StringOp::caseless::operator()(), StringOp::casecmp::operator()(), StringOp::Builder::operator<<(), operator<<(), operator=(), openmsx::SocketConnection::output(), openmsx::Interpreter::registerSetting(), openmsx::TclObject::setString(), openmsx::Sha1Sum::Sha1Sum(), openmsx::DBParser::stop(), StringOp::stringToBool(), openmsx::TclObject::TclObject(), openmsx::DBParser::text(), openmsx::DiskManipulator::unregisterDrive(), and openmsx::Interpreter::unregisterSetting().
|
inline |
Definition at line 56 of file string_ref.hh.
Referenced by openmsx::BreakPointBase::BreakPointBase(), openmsx::HardwareConfig::createRomConfig(), StringOp::endsWith(), openmsx::FileOperations::expandTilde(), find(), openmsx::UnicodeKeymap::getDeadkey(), openmsx::MSXMotherBoard::getJoystickPort(), openmsx::FileOperations::getUserHomeDir(), StringOp::join(), openmsx::FileOperations::join(), openmsx::MSXtar::mkdir(), openmsx::FileOperations::mkdirp(), openmsx::FileOperations::parseCommandFileArgument(), openmsx::OSDGUI::refresh(), openmsx::CommandLineParser::registerFileType(), rfind(), openmsx::SettingsConfig::saveSetting(), StringOp::split(), openmsx::DBParser::start(), StringOp::startsWith(), StringOp::trimLeft(), StringOp::trimRight(), openmsx::userFileContext(), openmsx::CliConnection::~CliConnection(), openmsx::Interpreter::~Interpreter(), and openmsx::OSDConsoleRenderer::~OSDConsoleRenderer().
|
inline |
Definition at line 50 of file string_ref.hh.
Referenced by end(), find(), find_first_of(), find_last_of(), rbegin(), and rfind().
bool string_ref::ends_with | ( | string_ref | x | ) | const |
Definition at line 126 of file string_ref.cc.
Referenced by StringOp::endsWith().
bool string_ref::ends_with | ( | char | x | ) | const |
Definition at line 131 of file string_ref.cc.
string_ref::size_type string_ref::find | ( | string_ref | s | ) | const |
Definition at line 38 of file string_ref.cc.
References begin(), empty(), end(), npos, and size().
Referenced by openmsx::XMLLoader::XMLElementParser::doctype(), openmsx::DBParser::doctype(), find_first_of(), openmsx::CommandLineParser::getInterpreter(), StringOp::join(), openmsx::GlobalCommandController::tabCompletion(), StringOp::trimLeft(), StringOp::trimRight(), and openmsx::DiskManipulator::unregisterDrive().
string_ref::size_type string_ref::find | ( | char | c | ) | const |
Definition at line 59 of file string_ref.cc.
string_ref::size_type string_ref::find_first_of | ( | string_ref | s | ) | const |
Definition at line 87 of file string_ref.cc.
References begin(), end(), and npos.
Referenced by openmsx::FileOperations::expandTilde(), openmsx::Keys::getCode(), openmsx::OSDText::getType(), StringOp::splitOnFirst(), and openmsx::DiskManipulator::unregisterDrive().
string_ref::size_type string_ref::find_first_of | ( | char | c | ) | const |
Definition at line 93 of file string_ref.cc.
References find().
string_ref::size_type string_ref::find_last_of | ( | string_ref | s | ) | const |
Definition at line 101 of file string_ref.cc.
References begin(), end(), npos, rbegin(), and rend().
Referenced by openmsx::NowindCommand::createDiskChanger(), openmsx::OSDText::getType(), and StringOp::splitOnLast().
string_ref::size_type string_ref::find_last_of | ( | char | c | ) | const |
Definition at line 107 of file string_ref.cc.
References rfind().
|
inline |
Definition at line 66 of file string_ref.hh.
Referenced by openmsx::UnicodeKeymap::getDeadkey(), openmsx::DBParser::start(), StringOp::startsWith(), and StringOp::trimLeft().
|
inline |
Definition at line 42 of file string_ref.hh.
|
inline |
Definition at line 61 of file string_ref.hh.
|
inline |
Definition at line 85 of file string_ref.hh.
References remove_suffix().
Referenced by StringOp::trimRight().
|
inline |
Definition at line 86 of file string_ref.hh.
References compare(), and remove_prefix().
Referenced by openmsx::UnicodeKeymap::getDeadkey(), openmsx::DBParser::start(), and StringOp::trimLeft().
|
inline |
Definition at line 51 of file string_ref.hh.
References end().
Referenced by find_last_of(), and rfind().
|
inline |
Definition at line 76 of file string_ref.hh.
Referenced by openmsx::UnicodeKeymap::getDeadkey(), pop_front(), and openmsx::GlobalCommandController::tabCompletion().
|
inline |
Definition at line 81 of file string_ref.hh.
Referenced by 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 65 of file string_ref.cc.
References begin(), empty(), end(), npos, and size().
Referenced by find_last_of(), openmsx::FileOperations::getDirName(), openmsx::FileOperations::getFilename(), openmsx::CommandLineParser::getInterpreter(), openmsx::CartridgeSlotManager::isExternalSlot(), openmsx::RecordedCommand::needRecord(), openmsx::FileOperations::stripExtension(), and openmsx::GlobalCommandController::tabCompletion().
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(), HexDump::decode(), Base64::decode(), openmsx::XMLLoader::XMLElementParser::doctype(), openmsx::FileOperations::expandCurrentDirFromDrive(), openmsx::FileOperations::expandTilde(), find(), openmsx::SettingsManager::findSetting(), openmsx::Completer::formatListInColumns(), openmsx::CommandLineParser::getInterpreter(), openmsx::CartridgeSlotManager::getSlotNum(), openmsx::CartridgeSlotManager::isExternalSlot(), StringOp::caseless::operator()(), StringOp::casecmp::operator()(), openmsx::ConditionalNegate< false >::operator()(), StringOp::Builder::operator<<(), operator<<(), operator=(), openmsx::SocketConnection::output(), rfind(), openmsx::TclObject::setString(), openmsx::Sha1Sum::Sha1Sum(), StringOp::stringToBool(), openmsx::GlobalCommandController::tabCompletion(), openmsx::TclObject::TclObject(), openmsx::DBParser::text(), and openmsx::DiskManipulator::unregisterDrive().
bool string_ref::starts_with | ( | string_ref | x | ) | const |
Definition at line 116 of file string_ref.cc.
Referenced by openmsx::Debugger::findProbe(), openmsx::SettingsManager::findSetting(), openmsx::UnicodeKeymap::getDeadkey(), openmsx::AviRecorder::getFrameHeight(), openmsx::MSXtar::mkdir(), openmsx::GlobalCommandController::registerCompleter(), openmsx::JoyState::serialize(), openmsx::BaseSetting::setPrefix(), StringOp::startsWith(), openmsx::GlobalCommandController::tabCompletion(), openmsx::DBParser::text(), openmsx::GlobalCommandController::unregisterCompleter(), and openmsx::Interpreter::unregisterSetting().
bool string_ref::starts_with | ( | char | x | ) | const |
Definition at line 121 of file string_ref.cc.
string string_ref::str | ( | ) | const |
Definition at line 12 of file string_ref.cc.
Referenced by openmsx::XMLElement::addAttribute(), openmsx::HardwareConfig::createDevices(), openmsx::NowindCommand::createDiskChanger(), openmsx::HardwareConfig::createExtensionConfig(), data(), openmsx::DiskCommand::execute(), openmsx::FileOperations::expandCurrentDirFromDrive(), openmsx::FileOperations::expandTilde(), openmsx::SettingsManager::findSetting(), openmsx::Completer::formatListInColumns(), openmsx::FileOperations::getAbsolutePath(), openmsx::FileOperations::getConventionalPath(), openmsx::AviRecorder::getFrameHeight(), openmsx::MSXMultiIODevice::getName(), openmsx::MSXMultiMemDevice::getName(), openmsx::FileOperations::getNativePath(), openmsx::FileBase::getOriginalName(), openmsx::FileOperations::getUserHomeDir(), openmsx::FileOperations::join(), openmsx::XmlInputArchive::load(), openmsx::OSDConsoleRenderer::OSDConsoleRenderer(), openmsx::MidiOutLogger::plugHelper(), openmsx::MidiInReader::plugHelper(), openmsx::RS232Tester::plugHelper(), openmsx::GlobalCommandController::registerCompleter(), openmsx::SCSIHD::SCSIHD(), openmsx::XMLElement::setAttribute(), openmsx::XMLElement::setData(), openmsx::XMLElement::setName(), openmsx::OSDText::setProperty(), openmsx::OSDRectangle::setProperty(), openmsx::DBParser::stop(), StringOp::toLower(), openmsx::Event::toString(), openmsx::GlobalCommandController::unregisterCommand(), openmsx::GlobalCommandController::unregisterCompleter(), openmsx::Debugger::unregisterDebuggable(), openmsx::DiskManipulator::unregisterDrive(), openmsx::MSXCliComm::update(), openmsx::GlobalCliComm::update(), openmsx::CliConnection::~CliConnection(), openmsx::OSDConsoleRenderer::~OSDConsoleRenderer(), and openmsx::WavAudioInput::~WavAudioInput().
string_ref string_ref::substr | ( | size_type | pos, |
size_type | n = npos |
||
) | const |
Definition at line 32 of file string_ref.cc.
References gl::min(), and string_ref().
Referenced by openmsx::ConsoleLine::chunkText(), openmsx::NowindCommand::createDiskChanger(), openmsx::XMLLoader::XMLElementParser::doctype(), openmsx::DBParser::doctype(), openmsx::FileOperations::expandCurrentDirFromDrive(), openmsx::FileOperations::expandTilde(), openmsx::Debugger::findProbe(), openmsx::SettingsManager::findSetting(), openmsx::Keys::getCode(), openmsx::FileOperations::getDirName(), openmsx::FileOperations::getFilename(), openmsx::CommandLineParser::getInterpreter(), openmsx::OSDText::getType(), openmsx::CartridgeSlotManager::isExternalSlot(), StringOp::join(), openmsx::RecordedCommand::needRecord(), openmsx::CDImageCLI::parseOption(), openmsx::GlobalCommandController::registerCompleter(), openmsx::CommandLineParser::registerFileType(), StringOp::splitOnFirst(), StringOp::splitOnLast(), openmsx::FileOperations::stripExtension(), openmsx::GlobalCommandController::tabCompletion(), openmsx::GlobalCommandController::unregisterCompleter(), openmsx::DiskManipulator::unregisterDrive(), and openmsx::Interpreter::unregisterSetting().
Definition at line 26 of file string_ref.hh.
Referenced by openmsx::ConsoleLine::chunkText(), openmsx::XMLLoader::XMLElementParser::doctype(), openmsx::DBParser::doctype(), openmsx::FileOperations::expandTilde(), find(), find_first_of(), find_last_of(), openmsx::Keys::getCode(), openmsx::FileOperations::getDirName(), openmsx::FileOperations::getFilename(), openmsx::CommandLineParser::getInterpreter(), openmsx::OSDText::getType(), openmsx::CartridgeSlotManager::isExternalSlot(), StringOp::join(), openmsx::RecordedCommand::needRecord(), rfind(), StringOp::splitOnFirst(), StringOp::splitOnLast(), openmsx::FileOperations::stripExtension(), utf8::unchecked::substr(), openmsx::GlobalCommandController::tabCompletion(), StringOp::trimLeft(), StringOp::trimRight(), and openmsx::DiskManipulator::unregisterDrive().