From aed891764a6df2e55a5a8d22707c6660e6d73976 Mon Sep 17 00:00:00 2001 From: Tomasz Sowa Date: Tue, 2 Apr 2013 22:24:30 +0000 Subject: [PATCH] added: to config: HasValue() methods for checking if a value exists (useful for checking lists -- they don't have to be copied out) git-svn-id: svn://ttmath.org/publicrep/winix/trunk@920 e52654a7-88a9-db11-a3e9-0013d4bc506e --- core/config.cpp | 22 ++++++++++++++++++++++ core/config.h | 5 +++++ 2 files changed, 27 insertions(+) diff --git a/core/config.cpp b/core/config.cpp index 9ae92e6..e838a33 100755 --- a/core/config.cpp +++ b/core/config.cpp @@ -434,6 +434,28 @@ bool Config::ListText(const std::wstring & name, std::vector & lis } + +bool Config::HasValue(const wchar_t * name, const wchar_t * value) +{ + return space.HasValue(name, value); +} + +bool Config::HasValue(const wchar_t * name, const std::wstring & value) +{ + return space.HasValue(name, value); +} + +bool Config::HasValue(const std::wstring & name, const wchar_t * value) +{ + return space.HasValue(name, value); +} + +bool Config::HasValue(const std::wstring & name, const std::wstring & value) +{ + return space.HasValue(name, value); +} + + void Config::Print(std::wostream & out) { space.Serialize(out); diff --git a/core/config.h b/core/config.h index 0d53424..9b69fd1 100755 --- a/core/config.h +++ b/core/config.h @@ -616,6 +616,11 @@ public: bool ListText(const wchar_t * name, std::vector & list); bool ListText(const std::wstring & name, std::vector & list); + bool HasValue(const wchar_t * name, const wchar_t * value); + bool HasValue(const wchar_t * name, const std::wstring & value); + bool HasValue(const std::wstring & name, const wchar_t * value); + bool HasValue(const std::wstring & name, const std::wstring & value); + // for debug void Print(std::wostream & out);