* Retrieves the 'hash' file form the bundle * * Returns: * - A Result containing the 'hash' entry if it exists. Error if it does not. * Notes: * - Thread-safe. Using a recursive mutex to guard access. * - See BundleResourcesProcessor.swift for how the 'hash' file is generated. */
| 356 | * - See BundleResourcesProcessor.swift for how the 'hash' file is generated. |
| 357 | */ |
| 358 | Result<StringBox> Bundle::getHash() { |
| 359 | static auto kHashName = STRING_LITERAL("hash"); |
| 360 | std::lock_guard<std::recursive_mutex> guard(_mutex); |
| 361 | |
| 362 | auto entryResult = getResourceContent(kHashName); |
| 363 | if (!entryResult) { |
| 364 | return entryResult.moveError(); |
| 365 | } |
| 366 | auto hash = StringCache::getGlobal().makeString(entryResult.value().raw.asStringView()); |
| 367 | return hash; |
| 368 | } |
| 369 | |
| 370 | void Bundle::setLoadedArchiveIfNeeded(const Ref<ValdiModuleArchive>& archive) { |
| 371 | std::lock_guard<std::recursive_mutex> guard(_mutex); |
no test coverage detected