MCPcopy Create free account
hub / github.com/apple/coremltools / removeItemInfoEntry

Method removeItemInfoEntry

modelpackage/src/ModelPackage.cpp:336–351  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

334}
335
336void ModelPackageImpl::removeItemInfoEntry(const std::string& identifier)
337{
338 auto itemInfoEntries = getItemInfoEntries();
339
340 std::vector<std::string> identifiers;
341 itemInfoEntries->getKeys(identifiers);
342
343 auto newItemInfoEntries = std::make_unique<JsonMap>();
344 for (const auto& localIdentifier : identifiers) {
345 if (localIdentifier != identifier) {
346 newItemInfoEntries->setObject(localIdentifier, itemInfoEntries->getObject(localIdentifier));
347 }
348 }
349
350 m_manifest->setObject(kModelPackageItemInfoEntriesKey, std::move(newItemInfoEntries));
351}
352
353void ModelPackageImpl::createItemInfoEntry(const std::string& identifier, const std::string& path, const std::string& name, const std::string& author, const std::string& description) {
354 auto itemInfoEntry = getItemInfoEntry(identifier);

Callers

nothing calls this directly

Calls 4

moveFunction · 0.85
getKeysMethod · 0.80
setObjectMethod · 0.80
getObjectMethod · 0.45

Tested by

no test coverage detected