summaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
authorbunnei <ericbunnie@gmail.com>2014-04-15 03:25:46 +0200
committerbunnei <ericbunnie@gmail.com>2014-04-15 03:25:46 +0200
commitcb504e236bb21816b5794a14c4dc57d93766e5a8 (patch)
tree1e97e5923671d473c78131898ccdeb0b9fd539ee /src/common
parentadded a stub for GetLockHandle (diff)
downloadyuzu-cb504e236bb21816b5794a14c4dc57d93766e5a8.tar
yuzu-cb504e236bb21816b5794a14c4dc57d93766e5a8.tar.gz
yuzu-cb504e236bb21816b5794a14c4dc57d93766e5a8.tar.bz2
yuzu-cb504e236bb21816b5794a14c4dc57d93766e5a8.tar.lz
yuzu-cb504e236bb21816b5794a14c4dc57d93766e5a8.tar.xz
yuzu-cb504e236bb21816b5794a14c4dc57d93766e5a8.tar.zst
yuzu-cb504e236bb21816b5794a14c4dc57d93766e5a8.zip
Diffstat (limited to 'src/common')
-rw-r--r--src/common/string_util.cpp16
-rw-r--r--src/common/string_util.h6
2 files changed, 22 insertions, 0 deletions
diff --git a/src/common/string_util.cpp b/src/common/string_util.cpp
index a99644f11..e5a9ba322 100644
--- a/src/common/string_util.cpp
+++ b/src/common/string_util.cpp
@@ -17,6 +17,22 @@
#include <errno.h>
#endif
+/// Make a string lowercase
+void LowerStr(char* str) {
+ for (int i = 0; str[i]; i++) {
+ str[i] = tolower(str[ i ]);
+ }
+}
+
+/// 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;
+ }
+ }
+}
+
// faster than sscanf
bool AsciiToHex(const char* _szValue, u32& result)
{
diff --git a/src/common/string_util.h b/src/common/string_util.h
index 6b7e84797..b3c99a807 100644
--- a/src/common/string_util.h
+++ b/src/common/string_util.h
@@ -14,6 +14,12 @@
#include "common/common.h"
+/// Make a string lowercase
+void LowerStr(char* str);
+
+/// Make a string uppercase
+void UpperStr(char* str);
+
std::string StringFromFormat(const char* format, ...);
// Cheap!
bool CharArrayFromFormatV(char* out, int outsize, const char* format, va_list args);