From 91065673d61318a9ab7aebd3459af710abe75fa3 Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Fri, 8 Aug 2003 09:22:56 -0400 Subject: [PATCH] ENH: Get accessor for cache value as boolean --- Source/cmCacheManager.cxx | 5 +++++ Source/cmCacheManager.h | 1 + 2 files changed, 6 insertions(+) diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index a47bb220d5..91d0ddfad7 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -743,6 +743,11 @@ void cmCacheManager::CacheIterator::SetProperty(const char* p, const char* v) ent->m_Properties[p] = v; } +bool cmCacheManager::CacheIterator::GetValueAsBool() const +{ + return cmSystemTools::IsOn(this->GetEntry().m_Value.c_str()); +} + bool cmCacheManager::CacheIterator::GetPropertyAsBool(const char* property) const { // make sure it is not at the end diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index 8ad7d44f3f..700c16e6d4 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -60,6 +60,7 @@ public: void SetProperty(const char* property, const char* value); void SetProperty(const char* property, bool value); const char* GetValue() const { return this->GetEntry().m_Value.c_str(); } + bool GetValueAsBool() const; void SetValue(const char*); CacheEntryType GetType() const { return this->GetEntry().m_Type; } bool Initialized() { return this->GetEntry().m_Initialized; }