MCPcopy Create free account
hub / github.com/Kitware/CMake / ReadPropertyEntry

Method ReadPropertyEntry

Source/cmCacheManager.cxx:171–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169 "STRINGS" };
170
171bool cmCacheManager::ReadPropertyEntry(std::string const& entryKey,
172 CacheEntry const& e)
173{
174 // All property entries are internal.
175 if (e.Type != cmStateEnums::INTERNAL) {
176 return false;
177 }
178
179 char const* end = entryKey.c_str() + entryKey.size();
180 for (char const* p : cmCacheManager::PersistentProperties) {
181 std::string::size_type plen = strlen(p) + 1;
182 if (entryKey.size() > plen && *(end - plen) == '-' &&
183 strcmp(end - plen + 1, p) == 0) {
184 std::string key = entryKey.substr(0, entryKey.size() - plen);
185 if (auto* entry = this->GetCacheEntry(key)) {
186 // Store this property on its entry.
187 entry->SetProperty(p, e.Value);
188 } else {
189 // Create an entry and store the property.
190 CacheEntry& ne = this->Cache[key];
191 ne.SetProperty(p, e.Value);
192 }
193 return true;
194 }
195 }
196 return false;
197}
198
199void cmCacheManager::WritePropertyEntries(std::ostream& os,
200 std::string const& entryKey,

Callers 1

LoadCacheMethod · 0.95

Calls 6

GetCacheEntryMethod · 0.95
c_strMethod · 0.80
strlenFunction · 0.50
sizeMethod · 0.45
substrMethod · 0.45
SetPropertyMethod · 0.45

Tested by

no test coverage detected