Removed uses of raw c-string manipulation functions.
This commit is contained in:
parent
ce8390ac03
commit
7fa4dbd0c6
4 changed files with 10 additions and 21 deletions
|
@ -186,9 +186,9 @@ bool TryParse(const std::string &str, u32 *const output)
|
|||
|
||||
bool TryParse(const std::string &str, bool *const output)
|
||||
{
|
||||
if ("1" == str || !strcasecmp("true", str.c_str()))
|
||||
if ("1" == str || "true" == ToLower(str))
|
||||
*output = true;
|
||||
else if ("0" == str || !strcasecmp("false", str.c_str()))
|
||||
else if ("0" == str || "false" == ToLower(str))
|
||||
*output = false;
|
||||
else
|
||||
return false;
|
||||
|
@ -196,13 +196,6 @@ bool TryParse(const std::string &str, bool *const output)
|
|||
return true;
|
||||
}
|
||||
|
||||
std::string StringFromInt(int value)
|
||||
{
|
||||
char temp[16];
|
||||
sprintf(temp, "%i", value);
|
||||
return temp;
|
||||
}
|
||||
|
||||
std::string StringFromBool(bool value)
|
||||
{
|
||||
return value ? "True" : "False";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue