diff options
author | bunnei <bunneidev@gmail.com> | 2014-09-11 06:04:36 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2014-09-11 06:04:36 +0200 |
commit | 532a9e80a0bd242d2937335063b719130405d6bc (patch) | |
tree | 84fe1f054b62edc488a7a9e80eb8f79b2dd05cd0 /src/common/string_util.cpp | |
parent | Merge pull request #103 from archshift/prune (diff) | |
parent | Moved common_types::Rect from common to Common namespace (diff) | |
download | yuzu-532a9e80a0bd242d2937335063b719130405d6bc.tar yuzu-532a9e80a0bd242d2937335063b719130405d6bc.tar.gz yuzu-532a9e80a0bd242d2937335063b719130405d6bc.tar.bz2 yuzu-532a9e80a0bd242d2937335063b719130405d6bc.tar.lz yuzu-532a9e80a0bd242d2937335063b719130405d6bc.tar.xz yuzu-532a9e80a0bd242d2937335063b719130405d6bc.tar.zst yuzu-532a9e80a0bd242d2937335063b719130405d6bc.zip |
Diffstat (limited to '')
-rw-r--r-- | src/common/string_util.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/common/string_util.cpp b/src/common/string_util.cpp index b0c65d47d..9199e30bc 100644 --- a/src/common/string_util.cpp +++ b/src/common/string_util.cpp @@ -13,20 +13,18 @@ #include <iconv.h> #endif +namespace Common { + /// Make a string lowercase -void LowerStr(char* str) { - for (int i = 0; str[i]; i++) { - str[i] = tolower(str[ i ]); - } +std::string ToLower(std::string str) { + std::transform(str.begin(), str.end(), str.begin(), ::tolower); + return str; } /// Make a string uppercase -void UpperStr(char* str) { - for (int i=0; i < strlen(str); i++) { - if(str[i] >= 'a' && str[i] <= 'z') { - str[i] &= 0xDF; - } - } +std::string ToUpper(std::string str) { + std::transform(str.begin(), str.end(), str.begin(), ::toupper); + return str; } // faster than sscanf @@ -546,3 +544,5 @@ std::string UTF16ToUTF8(const std::wstring& input) } #endif + +} |