Changeset View
Changeset View
Standalone View
Standalone View
src/util/strencodings.cpp
Show First 20 Lines • Show All 613 Lines • ▼ Show 20 Lines | bool ParseFixedPoint(const std::string &val, int decimals, | ||||
if (amount_out) { | if (amount_out) { | ||||
*amount_out = mantissa; | *amount_out = mantissa; | ||||
} | } | ||||
return true; | return true; | ||||
} | } | ||||
void Downcase(std::string &str) { | std::string ToLower(const std::string &str) { | ||||
std::transform(str.begin(), str.end(), str.begin(), ToLower); | std::string r; | ||||
for (auto ch : str) { | |||||
r += ToLower(ch); | |||||
} | |||||
return r; | |||||
} | |||||
std::string ToUpper(const std::string &str) { | |||||
std::string r; | |||||
for (auto ch : str) { | |||||
r += ToUpper(ch); | |||||
} | |||||
return r; | |||||
} | } | ||||
std::string Capitalize(std::string str) { | std::string Capitalize(std::string str) { | ||||
if (str.empty()) { | if (str.empty()) { | ||||
return str; | return str; | ||||
} | } | ||||
str[0] = ToUpper(str.front()); | str[0] = ToUpper(str.front()); | ||||
return str; | return str; | ||||
} | } |