64 unsigned int len = length();
65 if (len != other.length())
return false;
66 for (
unsigned int i = 0; i < len; i++) {
67 if (tolower((*
this)[i]) != tolower(other[i])) {
95 const std::string& old,
const std::string& newString) {
107 if (size() == 0)
return "";
108 if (size() == 1)
return upper();
113std::vector<TCEString>
163 std::string newStr(str);
169 for (
size_t i = 0; i < str.size(); i++) {
170 str.at(i) = std::toupper(str.at(i), loc);
177 for (
size_t i = 0; i < str.size(); i++) {
178 str.at(i) = std::toupper(str.at(i), loc);
185 const std::string& str,
const std::locale& loc) {
186 std::string result(str);
187 for (
size_t i = 0; i < result.size(); i++) {
188 result.at(i) = std::tolower(result.at(i), loc);
203 if (!toAppend.empty()) {
204 return toAppend += appender;
221 std::string tmp(toAppend);
242 return applyIf(expression, ifTrue,
"");
253 const std::string& oldPattern,
254 const std::string& newPattern) {
256 unsigned replacementCount = 0;
258 std::string::size_type location = str.find(oldPattern);
259 while (location != std::string::npos) {
261 str.begin() + location,
262 str.begin() + location + oldPattern.length(),
268 location = str.find(oldPattern, location + newPattern.length());
270 return replacementCount;
280 result.reserve(str.size());
282 if (std::isdigit(c)) result += c;
289 std::stringstream ss;
290 ss <<
"0x" << std::hex << std::uppercase << num;
296 std::stringstream ss;
297 ss <<
"0x" << std::hex << std::uppercase << num;
const std::string & stringCRef
static std::string toString(const T &source)
TCEString operator+(int val) const
static unsigned replace(std::string &str, const std::string &oldPattern, const std::string &newPattern)
static TCEString toUpper(const TCEString &str, const std::locale &loc=std::locale())
TCEString capitalize() const
static std::string filterDigits(const std::string &str)
bool ciEqual(const TCEString &other) const
static std::string & appendToNonEmpty(std::string &toAppend, stringCRef appender)
TCEString & replaceString(const std::string &old, const std::string &newString)
TCEString & operator<<(const TCEString &rhs)
TCEString & appendIf(bool expression, stringCRef ifTrue)
std::vector< TCEString > split(const std::string &delim) const
static std::string intToHexString(int num)
static std::string unsignedToHexString(unsigned num)
static std::string toLower(const std::string &str, const std::locale &loc=std::locale())
static std::string applyIf(bool expression, stringCRef ifTrue, stringCRef ifFalse)
bool operator()(const TCEString &lhs, const TCEString &rhs) const