diff --git a/src/ini.c b/src/ini.c index b679df9..823ebc3 100644 --- a/src/ini.c +++ b/src/ini.c @@ -146,6 +146,11 @@ double iniAsNum(const inivalue_t *value) { return val; } +bool iniAsBool(const inivalue_t *value) { + if (!value) return false; + return strvCompare(value->value, strvInit("true")) == 0; +} + // == INI WRITER ======================================================================== #include "strstream.h" diff --git a/src/ini.h b/src/ini.h index 687d446..945dacf 100644 --- a/src/ini.h +++ b/src/ini.h @@ -44,6 +44,7 @@ vec(strview_t) iniAsArrayU8(const inivalue_t *value, const char *delim); uint64 iniAsUInt(const inivalue_t *value); int64 iniAsInt(const inivalue_t *value); double iniAsNum(const inivalue_t *value); +bool iniAsBool(const inivalue_t *value); // == INI WRITER ========================================================================