summaryrefslogtreecommitdiff
path: root/src/common/string_util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/string_util.cpp')
-rw-r--r--src/common/string_util.cpp16
1 files changed, 16 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 @@
17 #include <errno.h> 17 #include <errno.h>
18#endif 18#endif
19 19
20/// Make a string lowercase
21void LowerStr(char* str) {
22 for (int i = 0; str[i]; i++) {
23 str[i] = tolower(str[ i ]);
24 }
25}
26
27/// Make a string uppercase
28void UpperStr(char* str) {
29 for (int i=0; i < strlen(str); i++) {
30 if(str[i] >= 'a' && str[i] <= 'z') {
31 str[i] &= 0xDF;
32 }
33 }
34}
35
20// faster than sscanf 36// faster than sscanf
21bool AsciiToHex(const char* _szValue, u32& result) 37bool AsciiToHex(const char* _szValue, u32& result)
22{ 38{