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)
 
bool stringToBool (std::string_view str)
 
std::string toLower (std::string_view str)
 
bool startsWith (std::string_view total, std::string_view part)
 
bool startsWith (std::string_view total, char part)
 
bool endsWith (std::string_view total, std::string_view part)
 
bool endsWith (std::string_view total, char part)
 
void trimRight (std::string_view &str, std::string_view chars)
 
void trimRight (std::string_view &str, char chars)
 
void trimLeft (std::string_view &str, std::string_view chars)
 
void trimLeft (std::string_view &str, char chars)
 
void trim (std::string_view &str, std::string_view chars)
 
void trim (std::string_view &str, char chars)
 
std::pair< std::string_view, std::string_view > splitOnFirst (std::string_view str, std::string_view chars)
 
std::pair< std::string_view, std::string_view > splitOnFirst (std::string_view str, char chars)
 
std::pair< std::string_view, std::string_view > splitOnLast (std::string_view str, std::string_view chars)
 
std::pair< std::string_view, std::string_view > splitOnLast (std::string_view str, char chars)
 
std::vector< std::string_view > split (std::string_view str, char chars)
 
std::vector< unsigned > parseRange (std::string_view str, unsigned min, unsigned max)
 
unsigned fast_stou (std::string_view s)
 

Function Documentation

◆ endsWith() [1/4]

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

◆ endsWith() [2/4]

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

◆ endsWith() [3/4]

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

◆ endsWith() [4/4]

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

Definition at line 86 of file StringOp.cc.

◆ fast_stou() [1/2]

unsigned StringOp::fast_stou ( std::string_view  s)

◆ fast_stou() [2/2]

unsigned StringOp::fast_stou ( string_view  s)

◆ parseRange() [1/2]

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

◆ parseRange() [2/2]

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

◆ split() [1/2]

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

◆ split() [2/2]

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

◆ splitOnFirst() [1/4]

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

◆ splitOnFirst() [2/4]

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

◆ splitOnFirst() [3/4]

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

◆ splitOnFirst() [4/4]

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

Definition at line 164 of file StringOp.cc.

◆ splitOnLast() [1/4]

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

◆ splitOnLast() [2/4]

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

◆ splitOnLast() [3/4]

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

◆ splitOnLast() [4/4]

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

Definition at line 183 of file StringOp.cc.

◆ startsWith() [1/4]

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

◆ startsWith() [2/4]

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

◆ startsWith() [3/4]

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

◆ startsWith() [4/4]

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

Definition at line 76 of file StringOp.cc.

◆ stringToBool() [1/2]

bool StringOp::stringToBool ( std::string_view  str)

◆ stringToBool() [2/2]

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() [1/2]

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

◆ toLower() [2/2]

string StringOp::toLower ( string_view  str)

◆ trim() [1/4]

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

◆ trim() [2/4]

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

◆ trim() [3/4]

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

Definition at line 143 of file StringOp.cc.

References trimLeft(), and trimRight().

Referenced by split().

◆ trim() [4/4]

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

Definition at line 149 of file StringOp.cc.

References trimLeft(), and trimRight().

◆ trimLeft() [1/6]

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

◆ trimLeft() [2/6]

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

◆ trimLeft() [3/6]

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

Definition at line 122 of file StringOp.cc.

Referenced by openmsx::MSXtar::mkdir(), and trim().

◆ trimLeft() [4/6]

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

Definition at line 126 of file StringOp.cc.

◆ trimLeft() [5/6]

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

Definition at line 130 of file StringOp.cc.

◆ trimLeft() [6/6]

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

Definition at line 136 of file StringOp.cc.

◆ trimRight() [1/6]

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

◆ trimRight() [2/6]

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

◆ trimRight() [3/6]

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

◆ trimRight() [4/6]

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

Definition at line 100 of file StringOp.cc.

◆ trimRight() [5/6]

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

Definition at line 109 of file StringOp.cc.

◆ trimRight() [6/6]

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

Definition at line 115 of file StringOp.cc.