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

Method removeItem

modelpackage/src/ModelPackage.cpp:509–522  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

507}
508
509void ModelPackageImpl::removeItem(const std::string& identifier)
510{
511 auto itemInfoEntry = getItemInfoEntry(identifier);
512 if (itemInfoEntry == nullptr) {
513 throw std::runtime_error("Failed to look up file with identifier: " + identifier);
514 }
515
516 auto path = m_packageDataDirPath / itemInfoEntry->getString(kModelPackageItemInfoPathKey);
517 if (0 != std::remove(path.c_str())) {
518 throw std::runtime_error("Failed to remove file at path: " + path.string());
519 }
520
521 removeItemInfoEntry(identifier);
522}
523
524bool ModelPackageImpl::isValid(const std::filesystem::path& path)
525{

Callers 3

createPayloadMethod · 0.80
testDirectoryMonitorMethod · 0.80

Calls 2

getStringMethod · 0.45
stringMethod · 0.45

Tested by 1

testDirectoryMonitorMethod · 0.64