summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2003-08-08 13:22:56 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2003-08-08 13:22:56 (GMT)
commit91065673d61318a9ab7aebd3459af710abe75fa3 (patch)
tree179085cfe439ea0c75426aa1554122c266f3cdec
parent103f115f25c28a107532be442d148247fe9b5efc (diff)
downloadCMake-91065673d61318a9ab7aebd3459af710abe75fa3.zip
CMake-91065673d61318a9ab7aebd3459af710abe75fa3.tar.gz
CMake-91065673d61318a9ab7aebd3459af710abe75fa3.tar.bz2
ENH: Get accessor for cache value as boolean
-rw-r--r--Source/cmCacheManager.cxx5
-rw-r--r--Source/cmCacheManager.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx
index a47bb22..91d0ddf 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 8ad7d44..700c16e 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; }