mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-11 16:49:28 +02:00
Refactor the original and much more compatible IniFile implementation to work more like Billiard's, with a public Section interface, but keep the old interface as well.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5603 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -244,7 +244,6 @@ bool TryParseInt(const char* str, int* outVal)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool TryParseBool(const char* str, bool* output)
|
||||
{
|
||||
if ((str[0] == '1') || !strcasecmp(str, "true"))
|
||||
@ -260,6 +259,25 @@ bool TryParseBool(const char* str, bool* output)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool TryParseFloat(const char* str, float *output)
|
||||
{
|
||||
double d_val;
|
||||
if (sscanf(str, "%f", &d_val) == 1)
|
||||
{
|
||||
*output = (float)d_val;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool TryParseDouble(const char* str, double *output)
|
||||
{
|
||||
return sscanf(str, "%f", output) == 1;
|
||||
}
|
||||
|
||||
std::string StringFromInt(int value)
|
||||
{
|
||||
char temp[16];
|
||||
|
Reference in New Issue
Block a user