summaryrefslogtreecommitdiff
path: root/src/common/string_util.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2014-10-25 15:19:05 -0400
committerGravatar bunnei2014-10-25 15:19:05 -0400
commit70058f8151a9c6599bbcd9d5772b87c9602ed0fa (patch)
treeb7f0711f1d817b18f041fea31cfcf0ebe9cbba69 /src/common/string_util.cpp
parentMerge pull request #112 from bunnei/skyeye-dyncom-interpreter (diff)
parentRemoved uses of raw c-string manipulation functions. (diff)
downloadyuzu-70058f8151a9c6599bbcd9d5772b87c9602ed0fa.tar.gz
yuzu-70058f8151a9c6599bbcd9d5772b87c9602ed0fa.tar.xz
yuzu-70058f8151a9c6599bbcd9d5772b87c9602ed0fa.zip
Merge pull request #148 from archshift/no-cstring
Removed some uses of raw c-string manipulation functions.
Diffstat (limited to 'src/common/string_util.cpp')
-rw-r--r--src/common/string_util.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/common/string_util.cpp b/src/common/string_util.cpp
index 9199e30bc..61f0939c4 100644
--- a/src/common/string_util.cpp
+++ b/src/common/string_util.cpp
@@ -186,9 +186,9 @@ bool TryParse(const std::string &str, u32 *const output)
186 186
187bool TryParse(const std::string &str, bool *const output) 187bool TryParse(const std::string &str, bool *const output)
188{ 188{
189 if ("1" == str || !strcasecmp("true", str.c_str())) 189 if ("1" == str || "true" == ToLower(str))
190 *output = true; 190 *output = true;
191 else if ("0" == str || !strcasecmp("false", str.c_str())) 191 else if ("0" == str || "false" == ToLower(str))
192 *output = false; 192 *output = false;
193 else 193 else
194 return false; 194 return false;
@@ -196,13 +196,6 @@ bool TryParse(const std::string &str, bool *const output)
196 return true; 196 return true;
197} 197}
198 198
199std::string StringFromInt(int value)
200{
201 char temp[16];
202 sprintf(temp, "%i", value);
203 return temp;
204}
205
206std::string StringFromBool(bool value) 199std::string StringFromBool(bool value)
207{ 200{
208 return value ? "True" : "False"; 201 return value ? "True" : "False";