| 507 | } |
| 508 | |
| 509 | void 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 | |
| 524 | bool ModelPackageImpl::isValid(const std::filesystem::path& path) |
| 525 | { |