openMSX
Classes | Functions
StringOp Namespace Reference

Classes

struct  casecmp
 
struct  caseless
 

Functions

int stringToInt (const string &str)
 
bool stringToInt (const string &str, int &result)
 
unsigned stringToUint (const string &str)
 
bool stringToUint (const string &str, unsigned &result)
 
uint64_t stringToUint64 (const string &str)
 
bool stringToBool (string_view str)
 
double stringToDouble (const string &str)
 
bool stringToDouble (const string &str, double &result)
 
string toLower (string_view str)
 
bool startsWith (string_view total, string_view part)
 
bool startsWith (string_view total, char part)
 
bool endsWith (string_view total, string_view part)
 
bool endsWith (string_view total, char part)
 
void trimRight (string &str, const char *chars)
 
void trimRight (string &str, char chars)
 
void trimRight (string_view &str, string_view chars)
 
void trimRight (string_view &str, char chars)
 
void trimLeft (string &str, const char *chars)
 
void trimLeft (string &str, char chars)
 
void trimLeft (string_view &str, string_view chars)
 
void trimLeft (string_view &str, char chars)
 
void trim (string_view &str, string_view chars)
 
void trim (string_view &str, char chars)
 
std::pair< string_view, string_view > splitOnFirst (string_view str, string_view chars)
 
std::pair< string_view, string_view > splitOnFirst (string_view str, char chars)
 
std::pair< string_view, string_view > splitOnLast (string_view str, string_view chars)
 
std::pair< string_view, string_view > splitOnLast (string_view str, char chars)
 
vector< string_view > split (string_view str, char chars)
 
vector< unsigned > parseRange (string_view str, unsigned min, unsigned max)
 
unsigned fast_stou (string_view s)
 

Function Documentation

◆ endsWith() [1/2]

bool StringOp::endsWith ( string_view  total,
char  part 
)

Definition at line 86 of file StringOp.cc.

◆ endsWith() [2/2]

bool StringOp::endsWith ( string_view  total,
string_view  part 
)

◆ fast_stou()

unsigned StringOp::fast_stou ( string_view  s)

Definition at line 258 of file StringOp.cc.

Referenced by openmsx::DiskFactory::createDisk(), and openmsx::DBParser::text().

◆ parseRange()

std::vector< unsigned > StringOp::parseRange ( string_view  str,
unsigned  min,
unsigned  max 
)

Definition at line 243 of file StringOp.cc.

Referenced by openmsx::SoundDevice::registerSound().

◆ split()

std::vector< std::string_view > StringOp::split ( string_view  str,
char  chars 
)

Definition at line 187 of file StringOp.cc.

References splitOnFirst().

Referenced by openmsx::TTFFont::render().

◆ splitOnFirst() [1/2]

std::pair< std::string_view, std::string_view > StringOp::splitOnFirst ( string_view  str,
char  chars 
)

Definition at line 161 of file StringOp.cc.

◆ splitOnFirst() [2/2]

std::pair< std::string_view, std::string_view > StringOp::splitOnFirst ( string_view  str,
string_view  chars 
)

Definition at line 153 of file StringOp.cc.

Referenced by split().

◆ splitOnLast() [1/2]

std::pair< std::string_view, std::string_view > StringOp::splitOnLast ( string_view  str,
char  chars 
)

Definition at line 178 of file StringOp.cc.

◆ splitOnLast() [2/2]

std::pair< std::string_view, std::string_view > StringOp::splitOnLast ( string_view  str,
string_view  chars 
)

Definition at line 170 of file StringOp.cc.

◆ startsWith() [1/2]

bool StringOp::startsWith ( string_view  total,
char  part 
)

Definition at line 76 of file StringOp.cc.

◆ startsWith() [2/2]

bool StringOp::startsWith ( string_view  total,
string_view  part 
)

◆ stringToBool()

bool StringOp::stringToBool ( string_view  str)

◆ stringToDouble() [1/2]

double StringOp::stringToDouble ( const string &  str)

Definition at line 53 of file StringOp.cc.

◆ stringToDouble() [2/2]

bool StringOp::stringToDouble ( const string &  str,
double &  result 
)

Definition at line 57 of file StringOp.cc.

◆ stringToInt() [1/2]

int StringOp::stringToInt ( const string &  str)

◆ stringToInt() [2/2]

bool StringOp::stringToInt ( const string &  str,
int &  result 
)

Definition at line 20 of file StringOp.cc.

◆ stringToUint() [1/2]

unsigned StringOp::stringToUint ( const string &  str)

Definition at line 27 of file StringOp.cc.

◆ stringToUint() [2/2]

bool StringOp::stringToUint ( const string &  str,
unsigned &  result 
)

Definition at line 31 of file StringOp.cc.

◆ stringToUint64()

uint64_t StringOp::stringToUint64 ( const string &  str)

Definition at line 38 of file StringOp.cc.

◆ toLower()

std::string StringOp::toLower ( string_view  str)

◆ trim() [1/2]

void StringOp::trim ( string_view &  str,
char  chars 
)

Definition at line 147 of file StringOp.cc.

References trimLeft(), and trimRight().

◆ trim() [2/2]

void StringOp::trim ( string_view &  str,
string_view  chars 
)

Definition at line 141 of file StringOp.cc.

References trimLeft(), and trimRight().

◆ trimLeft() [1/4]

void StringOp::trimLeft ( string &  str,
char  chars 
)

Definition at line 124 of file StringOp.cc.

◆ trimLeft() [2/4]

void StringOp::trimLeft ( string &  str,
const char *  chars 
)

Definition at line 120 of file StringOp.cc.

Referenced by trim().

◆ trimLeft() [3/4]

void StringOp::trimLeft ( string_view &  str,
char  chars 
)

Definition at line 134 of file StringOp.cc.

◆ trimLeft() [4/4]

void StringOp::trimLeft ( string_view &  str,
string_view  chars 
)

Definition at line 128 of file StringOp.cc.

◆ trimRight() [1/4]

void StringOp::trimRight ( string &  str,
char  chars 
)

Definition at line 99 of file StringOp.cc.

◆ trimRight() [2/4]

void StringOp::trimRight ( string &  str,
const char *  chars 
)

Definition at line 91 of file StringOp.cc.

Referenced by openmsx::TTFFont::render(), and trim().

◆ trimRight() [3/4]

void StringOp::trimRight ( string_view &  str,
char  chars 
)

Definition at line 113 of file StringOp.cc.

◆ trimRight() [4/4]

void StringOp::trimRight ( string_view &  str,
string_view  chars 
)

Definition at line 107 of file StringOp.cc.