| 351 | } |
| 352 | |
| 353 | void 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); |
| 355 | |
| 356 | if (nullptr == itemInfoEntry) { |
| 357 | itemInfoEntry = std::make_unique<JsonMap>(); |
| 358 | } |
| 359 | |
| 360 | itemInfoEntry->setString(kModelPackageItemInfoPathKey, path); |
| 361 | itemInfoEntry->setString(kModelPackageItemInfoNameKey, name); |
| 362 | itemInfoEntry->setString(kModelPackageItemInfoAuthorKey, author); |
| 363 | itemInfoEntry->setString(kModelPackageItemInfoDescriptionKey, description); |
| 364 | |
| 365 | auto itemInfoEntries = getItemInfoEntries(); |
| 366 | itemInfoEntries->setObject(identifier, std::move(itemInfoEntry)); |
| 367 | m_manifest->setObject(kModelPackageItemInfoEntriesKey, std::move(itemInfoEntries)); |
| 368 | } |
| 369 | |
| 370 | std::filesystem::path ModelPackageImpl::getItemPath(const std::string& name, const std::string& author) const { |
| 371 | return std::filesystem::path(author) / name; |