summaryrefslogtreecommitdiffstats
path: root/Source/cmSetPropertyCommand.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-04-05 08:48:04 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-04-08 16:47:00 (GMT)
commitba404938a202b51bb82bff8692ed08e53b061ad4 (patch)
tree445c969ae57dc9656e791af23b0b9f6830c6d255 /Source/cmSetPropertyCommand.cxx
parentf3922a9a5b463420db5f7fae08efdf1b4abdfe5e (diff)
downloadCMake-ba404938a202b51bb82bff8692ed08e53b061ad4.zip
CMake-ba404938a202b51bb82bff8692ed08e53b061ad4.tar.gz
CMake-ba404938a202b51bb82bff8692ed08e53b061ad4.tar.bz2
cmCacheManager: Port consumers to non-iterator API.
This simplifies reasoning about the follow-up commit which ports away from cmCacheManager to a class with the same method names.
Diffstat (limited to 'Source/cmSetPropertyCommand.cxx')
-rw-r--r--Source/cmSetPropertyCommand.cxx19
1 files changed, 11 insertions, 8 deletions
diff --git a/Source/cmSetPropertyCommand.cxx b/Source/cmSetPropertyCommand.cxx
index 1150bc7..77f9fb9 100644
--- a/Source/cmSetPropertyCommand.cxx
+++ b/Source/cmSetPropertyCommand.cxx
@@ -452,11 +452,11 @@ bool cmSetPropertyCommand::HandleCacheMode()
// Get the source file.
cmMakefile* mf = this->GetMakefile();
cmake* cm = mf->GetCMakeInstance();
- cmCacheManager::CacheIterator it =
- cm->GetCacheManager()->GetCacheIterator(ni->c_str());
- if(!it.IsAtEnd())
+ const char* existingValue
+ = cm->GetCacheManager()->GetCacheEntryValue(*ni);
+ if(existingValue)
{
- if(!this->HandleCacheEntry(it))
+ if(!this->HandleCacheEntry(*ni))
{
return false;
}
@@ -474,22 +474,25 @@ bool cmSetPropertyCommand::HandleCacheMode()
}
//----------------------------------------------------------------------------
-bool cmSetPropertyCommand::HandleCacheEntry(cmCacheManager::CacheIterator& it)
+bool cmSetPropertyCommand::HandleCacheEntry(std::string const& cacheKey)
{
// Set or append the property.
const char* name = this->PropertyName.c_str();
const char* value = this->PropertyValue.c_str();
+ cmCacheManager* manager = this->Makefile->GetCacheManager();
if (this->Remove)
{
- value = 0;
+ manager->RemoveCacheEntryProperty(cacheKey, name);
+ return true;
}
if(this->AppendMode)
{
- it.AppendProperty(name, value, this->AppendAsString);
+ manager->AppendCacheEntryProperty(cacheKey, name, value,
+ this->AppendAsString);
}
else
{
- it.SetProperty(name, value);
+ manager->SetCacheEntryProperty(cacheKey, name, value);
}
return true;