gem5
|
#include <cstring>
#include <limits>
#include <locale>
#include <stdexcept>
#include <string>
#include <vector>
Go to the source code of this file.
Functions | |
void | eat_lead_white (std::string &s) |
void | eat_end_white (std::string &s) |
void | eat_white (std::string &s) |
std::string | to_lower (const std::string &s) |
bool | split_first (const std::string &s, std::string &lhs, std::string &rhs, char c) |
bool | split_last (const std::string &s, std::string &lhs, std::string &rhs, char c) |
void | tokenize (std::vector< std::string > &vector, const std::string &s, char token, bool ign=true) |
template<class T > | |
bool | to_number (const std::string &value, T &retval) |
Turn a string representation of a number, either integral or floating point, into an actual number. More... | |
bool | to_bool (const std::string &value, bool &retval) |
Turn a string representation of a boolean into a boolean value. More... | |
std::string | quote (const std::string &s) |
bool | startswith (const char *s, const char *prefix) |
Return true if 's' starts with the prefix string 'prefix'. More... | |
bool | startswith (const std::string &s, const char *prefix) |
Return true if 's' starts with the prefix string 'prefix'. More... | |
bool | startswith (const std::string &s, const std::string &prefix) |
Return true if 's' starts with the prefix string 'prefix'. More... | |
String to number helper functions for signed and unsigned | |
integeral type, as well as floating-point types. | |
template<class T > | |
std::enable_if < std::is_integral< T >::value &&std::is_signed< T >::value, T >::type | __to_number (const std::string &value) |
template<class T > | |
std::enable_if < std::is_integral< T >::value &&!std::is_signed< T >::value, T >::type | __to_number (const std::string &value) |
template<class T > | |
std::enable_if < std::is_floating_point< T > ::value, T >::type | __to_number (const std::string &value) |
std::enable_if<std::is_integral<T>::value && std::is_signed<T>::value, T>::type __to_number | ( | const std::string & | value | ) |
Definition at line 108 of file str.hh.
References MipsISA::r.
std::enable_if<std::is_integral<T>::value && !std::is_signed<T>::value, T>::type __to_number | ( | const std::string & | value | ) |
Definition at line 120 of file str.hh.
References MipsISA::r.
std::enable_if<std::is_floating_point<T>::value, T>::type __to_number | ( | const std::string & | value | ) |
Definition at line 131 of file str.hh.
References MipsISA::r.
|
inline |
Definition at line 53 of file str.hh.
Referenced by eat_white().
|
inline |
Definition at line 43 of file str.hh.
Referenced by eat_white().
|
inline |
Definition at line 61 of file str.hh.
References eat_end_white(), and eat_lead_white().
Referenced by IniFile::Section::add(), IniFile::add(), SymbolTable::load(), and PseudoInst::loadsymbol().
|
inline |
bool split_first | ( | const std::string & | s, |
std::string & | lhs, | ||
std::string & | rhs, | ||
char | c | ||
) |
bool split_last | ( | const std::string & | s, |
std::string & | lhs, | ||
std::string & | rhs, | ||
char | c | ||
) |
|
inline |
Return true if 's' starts with the prefix string 'prefix'.
Definition at line 205 of file str.hh.
Referenced by System::getMasterId(), openImpl(), and procInfo().
|
inline |
|
inline |
|
inline |
Turn a string representation of a boolean into a boolean value.
Definition at line 167 of file str.hh.
References ArmISA::s, and to_lower().
Referenced by parseParam().
|
inline |
Definition at line 68 of file str.hh.
References ArmISA::c, and ArmISA::len.
Referenced by to_bool().
|
inline |
void tokenize | ( | std::vector< std::string > & | vector, |
const std::string & | s, | ||
char | token, | ||
bool | ign = true |
||
) |