summaryrefslogtreecommitdiffstats
path: root/src/common/string_util.cpp
diff options
context:
space:
mode:
authorarchshift <admin@archshift.com>2014-09-07 09:49:52 +0200
committerarchshift <admin@archshift.com>2014-09-09 00:41:58 +0200
commit4ed24a06191a0dbf68bd72ad0fcc8d467b37f580 (patch)
treef3a1e6b49dc193153d039c1144b3789a9e7a7bc6 /src/common/string_util.cpp
parentMerge pull request #95 from lioncash/disassembler (diff)
downloadyuzu-4ed24a06191a0dbf68bd72ad0fcc8d467b37f580.tar
yuzu-4ed24a06191a0dbf68bd72ad0fcc8d467b37f580.tar.gz
yuzu-4ed24a06191a0dbf68bd72ad0fcc8d467b37f580.tar.bz2
yuzu-4ed24a06191a0dbf68bd72ad0fcc8d467b37f580.tar.lz
yuzu-4ed24a06191a0dbf68bd72ad0fcc8d467b37f580.tar.xz
yuzu-4ed24a06191a0dbf68bd72ad0fcc8d467b37f580.tar.zst
yuzu-4ed24a06191a0dbf68bd72ad0fcc8d467b37f580.zip
Diffstat (limited to 'src/common/string_util.cpp')
-rw-r--r--src/common/string_util.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/common/string_util.cpp b/src/common/string_util.cpp
index c1f22bda3..c489c868b 100644
--- a/src/common/string_util.cpp
+++ b/src/common/string_util.cpp
@@ -18,19 +18,15 @@
#endif
/// Make a string lowercase
-void LowerStr(char* str) {
- for (int i = 0; str[i]; i++) {
- str[i] = tolower(str[ i ]);
- }
+std::string LowerStr(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 UpperStr(std::string str) {
+ std::transform(str.begin(), str.end(), str.begin(), ::toupper);
+ return str;
}
// faster than sscanf