From fac89d0c437c822e41fe12529a875279f48fd2d0 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Wed, 3 Sep 2014 23:00:16 +0200 Subject: Added cIniFile::HasValue() function. --- lib/inifile/iniFile.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'lib/inifile/iniFile.cpp') diff --git a/lib/inifile/iniFile.cpp b/lib/inifile/iniFile.cpp index 2bf6c91ed..7cfe7661f 100644 --- a/lib/inifile/iniFile.cpp +++ b/lib/inifile/iniFile.cpp @@ -668,6 +668,24 @@ void cIniFile::Clear(void) +bool cIniFile::HasValue(const AString & a_KeyName, const AString & a_ValueName) +{ + // Find the key: + int keyID = FindKey(a_KeyName); + if (keyID == noID) + { + return false; + } + + // Find the value: + int valueID = FindValue(keyID, a_ValueName); + return (valueID != noID); +} + + + + + void cIniFile::AddHeaderComment(const AString & comment) { comments.push_back(comment); -- cgit v1.2.3