cmState: Add cache file manipulation wrappers.

This commit is contained in:
Stephen Kelly 2015-10-10 15:21:41 +02:00
parent a02e53eb94
commit 062ed22ec4
3 changed files with 29 additions and 3 deletions

View File

@ -147,6 +147,24 @@ bool cmState::IsCacheEntryType(std::string const& key)
return false; return false;
} }
bool cmState::LoadCache(const std::string& path, bool internal,
std::set<std::string>& excludes,
std::set<std::string>& includes)
{
return this->CMakeInstance->GetCacheManager()->LoadCache(path, internal,
excludes, includes);
}
bool cmState::SaveCache(const std::string& path)
{
return this->CMakeInstance->GetCacheManager()->SaveCache(path);
}
bool cmState::DeleteCache(const std::string& path)
{
return this->CMakeInstance->GetCacheManager()->DeleteCache(path);
}
std::vector<std::string> cmState::GetCacheEntryKeys() const std::vector<std::string> cmState::GetCacheEntryKeys() const
{ {
std::vector<std::string> definitions; std::vector<std::string> definitions;

View File

@ -208,6 +208,14 @@ public:
static const char* CacheEntryTypeToString(CacheEntryType); static const char* CacheEntryTypeToString(CacheEntryType);
static bool IsCacheEntryType(std::string const& key); static bool IsCacheEntryType(std::string const& key);
bool LoadCache(const std::string& path, bool internal,
std::set<std::string>& excludes,
std::set<std::string>& includes);
bool SaveCache(const std::string& path) ;
bool DeleteCache(const std::string& path);
std::vector<std::string> GetCacheEntryKeys() const; std::vector<std::string> GetCacheEntryKeys() const;
const char* GetCacheEntryValue(std::string const& key) const; const char* GetCacheEntryValue(std::string const& key) const;
const char* GetInitializedCacheValue(std::string const& key) const; const char* GetInitializedCacheValue(std::string const& key) const;

View File

@ -1760,17 +1760,17 @@ bool cmake::LoadCache(const std::string& path, bool internal,
std::set<std::string>& excludes, std::set<std::string>& excludes,
std::set<std::string>& includes) std::set<std::string>& includes)
{ {
return this->CacheManager->LoadCache(path, internal, excludes, includes); return this->State->LoadCache(path, internal, excludes, includes);
} }
bool cmake::SaveCache(const std::string& path) bool cmake::SaveCache(const std::string& path)
{ {
return this->CacheManager->SaveCache(path); return this->State->SaveCache(path);
} }
bool cmake::DeleteCache(const std::string& path) bool cmake::DeleteCache(const std::string& path)
{ {
return this->CacheManager->DeleteCache(path); return this->State->DeleteCache(path);
} }
void cmake::SetProgressCallback(ProgressCallbackType f, void *cd) void cmake::SetProgressCallback(ProgressCallbackType f, void *cd)