1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-07-06 08:57:11 +02:00

Fixed the INI compilation on Linux by reverting to the original library.

Fixed an infinite loop in the parsing of command specification strings.
Added the option to retrieve common configs with a fall back value if they don't exist.
Few other minor changes.
This commit is contained in:
Sandu Liviu Catalin
2016-03-11 20:04:26 +02:00
parent 20ae383c42
commit f27a195b6f
10 changed files with 1032 additions and 100 deletions

View File

@ -345,13 +345,21 @@ void Core::Terminate()
}
// ------------------------------------------------------------------------------------------------
CSStr Core::GetOption(const String & name) const
CSStr Core::GetOption(CSStr name) const
{
Options::const_iterator elem = m_Options.find(name);
return (elem == m_Options.end()) ? g_EmptyStr : elem->second.c_str();
return (elem == m_Options.end()) ? _SC("") : elem->second.c_str();
}
void Core::SetOption(const String & name, const String & value)
// ------------------------------------------------------------------------------------------------
CSStr Core::GetOption(CSStr name, CSStr value) const
{
Options::const_iterator elem = m_Options.find(name);
return (elem == m_Options.end()) ? value : elem->second.c_str();
}
// ------------------------------------------------------------------------------------------------
void Core::SetOption(CSStr name, CSStr value)
{
m_Options[name] = value;
}