mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-24 15:24:30 +01:00
Add int64_t support to INI parser (#12374)
This commit is contained in:
committed by
GitHub
parent
6ba6184602
commit
3b60740128
@@ -155,6 +155,23 @@ public:
|
||||
return result;
|
||||
}
|
||||
|
||||
int64_t GetInt64(const std::string& name, int64_t defaultValue) const override
|
||||
{
|
||||
int64_t result = defaultValue;
|
||||
std::string value;
|
||||
if (TryGetString(name, &value))
|
||||
{
|
||||
try
|
||||
{
|
||||
result = std::stoll(value);
|
||||
}
|
||||
catch (const std::exception&)
|
||||
{
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
float GetFloat(const std::string& name, float defaultValue) const override
|
||||
{
|
||||
float result = defaultValue;
|
||||
@@ -388,6 +405,11 @@ public:
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
int64_t GetInt64([[maybe_unused]] const std::string& name, int64_t defaultValue) const override
|
||||
{
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
float GetFloat([[maybe_unused]] const std::string& name, float defaultValue) const override
|
||||
{
|
||||
return defaultValue;
|
||||
|
||||
Reference in New Issue
Block a user