summaryrefslogtreecommitdiffstats
path: root/Source/cmCacheManager.h
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-04-07 20:45:54 (GMT)
committerBrad King <brad.king@kitware.com>2015-04-13 15:44:16 (GMT)
commitf081c5bdddcfcaaf5bee7b918fe5c7ff01faae35 (patch)
treea2aad443ecfe835aaa3eaa1d4dd95fc34d94f59f /Source/cmCacheManager.h
parentf71fdf0ec8289ada5b32b784bc2f6f617538ce0b (diff)
downloadCMake-f081c5bdddcfcaaf5bee7b918fe5c7ff01faae35.zip
CMake-f081c5bdddcfcaaf5bee7b918fe5c7ff01faae35.tar.gz
CMake-f081c5bdddcfcaaf5bee7b918fe5c7ff01faae35.tar.bz2
cmState: Move CacheEntryType enum from cmCacheManager.
Diffstat (limited to 'Source/cmCacheManager.h')
-rw-r--r--Source/cmCacheManager.h35
1 files changed, 15 insertions, 20 deletions
diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h
index 00ae334..8462259 100644
--- a/Source/cmCacheManager.h
+++ b/Source/cmCacheManager.h
@@ -14,6 +14,8 @@
#include "cmStandardIncludes.h"
#include "cmPropertyMap.h"
+#include "cmState.h"
+
class cmMakefile;
class cmMarkAsAdvancedCommand;
class cmake;
@@ -30,21 +32,22 @@ public:
cmCacheManager(cmake* cm);
class CacheIterator;
friend class cmCacheManager::CacheIterator;
- enum CacheEntryType{ BOOL=0, PATH, FILEPATH, STRING, INTERNAL,STATIC,
- UNINITIALIZED };
private:
struct CacheEntry
{
std::string Value;
- CacheEntryType Type;
+ cmState::CacheEntryType Type;
cmPropertyMap Properties;
const char* GetProperty(const std::string&) const;
void SetProperty(const std::string& property, const char* value);
void AppendProperty(const std::string& property, const char* value,
bool asString=false);
bool Initialized;
- CacheEntry() : Value(""), Type(UNINITIALIZED), Initialized(false)
+ CacheEntry()
+ : Value(""),
+ Type(cmState::UNINITIALIZED),
+ Initialized(false)
{}
};
@@ -68,8 +71,10 @@ public:
const char* GetValue() const { return this->GetEntry().Value.c_str(); }
bool GetValueAsBool() const;
void SetValue(const char*);
- CacheEntryType GetType() const { return this->GetEntry().Type; }
- void SetType(CacheEntryType ty) { this->GetEntry().Type = ty; }
+ cmState::CacheEntryType GetType() const
+ { return this->GetEntry().Type; }
+ void SetType(cmState::CacheEntryType ty)
+ { this->GetEntry().Type = ty; }
bool Initialized() { return this->GetEntry().Initialized; }
cmCacheManager &Container;
std::map<std::string, CacheEntry>::iterator Position;
@@ -94,17 +99,6 @@ public:
return CacheIterator(*this);
}
- /**
- * Types for the cache entries. These are useful as
- * hints for a cache editor program. Path should bring
- * up a file chooser, BOOL a check box, and STRING a
- * text entry box, FILEPATH is a full path to a file which
- * can be different than just a path input
- */
- static CacheEntryType StringToType(const char*);
- static const char* TypeToString(CacheEntryType);
- static bool IsType(const char*);
-
///! Load a cache for given makefile. Loads from path/CMakeCache.txt.
bool LoadCache(const std::string& path);
bool LoadCache(const std::string& path, bool internal,
@@ -134,7 +128,7 @@ public:
static bool ParseEntry(const std::string& entry,
std::string& var,
std::string& value,
- CacheEntryType& type);
+ cmState::CacheEntryType& type);
///! Get a value from the cache given a key
const char* GetInitializedCacheValue(const std::string& key) const;
@@ -155,7 +149,7 @@ public:
return this->GetCacheIterator(key.c_str()).GetProperty(propName);
}
- CacheEntryType GetCacheEntryType(std::string const& key)
+ cmState::CacheEntryType GetCacheEntryType(std::string const& key)
{
return this->GetCacheIterator(key.c_str()).GetType();
}
@@ -223,7 +217,8 @@ public:
protected:
///! Add an entry into the cache
void AddCacheEntry(const std::string& key, const char* value,
- const char* helpString, CacheEntryType type);
+ const char* helpString,
+ cmState::CacheEntryType type);
///! Get a cache entry object for a key
CacheEntry *GetCacheEntry(const std::string& key);