diff src/core/ini.cc @ 280:9b6e12c14a1e

chore: merge
author Paper <paper@paper.us.eu.org>
date Mon, 06 May 2024 17:23:30 -0400
parents ec0a2b5493f8
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/core/ini.cc	Mon May 06 17:23:30 2024 -0400
@@ -0,0 +1,16 @@
+#include "core/ini.h"
+
+namespace INI {
+
+std::string GetIniString(const mINI::INIStructure& ini, const std::string& section, const std::string& key, const std::string& def) {
+	if (!ini.has(section) || !ini.get(section).has(key))
+		return def;
+
+	return ini.get(section).get(key);
+}
+
+bool GetIniBool(const mINI::INIStructure& ini, const std::string& section, const std::string& key, bool def) {
+	return Strings::ToBool(GetIniString(ini, section, key, ""), def);
+}
+
+}