From 42db1870120481bbd75dd1b056bc7909c2da9232 Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Tue, 29 Apr 2003 10:02:53 -0400 Subject: [PATCH] ENH: Add method to convert from CacheEntryType to string --- Source/cmCacheManager.cxx | 9 +++++++++ Source/cmCacheManager.h | 1 + 2 files changed, 10 insertions(+) diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index 7b213a030..43027e9b2 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -37,6 +37,15 @@ const char* cmCacheManagerTypes[] = 0 }; +const char* cmCacheManager::TypeToString(cmCacheManager::CacheEntryType type) +{ + if ( type > 6 || type < 0 ) + { + return cmCacheManagerTypes[6]; + } + return cmCacheManagerTypes[type]; +} + cmCacheManager::CacheEntryType cmCacheManager::StringToType(const char* s) { int i = 0; diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index 3dbaa584b..12c2aef0f 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -90,6 +90,7 @@ public: * can be different than just a path input */ static CacheEntryType StringToType(const char*); + static const char* TypeToString(CacheEntryType); ///! Load a cache for given makefile. Loads from ouput home. bool LoadCache(cmMakefile*);