mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-02 16:32:55 +00: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:
parent
1435c2527a
commit
05c418ebe2
4 changed files with 342 additions and 258 deletions
|
@ -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];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue