summaryrefslogtreecommitdiffstats
path: root/src/common/string_util.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2014-09-11 06:04:36 +0200
committerbunnei <bunneidev@gmail.com>2014-09-11 06:04:36 +0200
commit532a9e80a0bd242d2937335063b719130405d6bc (patch)
tree84fe1f054b62edc488a7a9e80eb8f79b2dd05cd0 /src/common/string_util.cpp
parentMerge pull request #103 from archshift/prune (diff)
parentMoved common_types::Rect from common to Common namespace (diff)
downloadyuzu-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.cpp20
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
+
+}