| 133 | } |
| 134 | |
| 135 | Result<BytesView> Bundle::getEntry(const StringBox& path) { |
| 136 | std::lock_guard<std::recursive_mutex> guard(_mutex); |
| 137 | |
| 138 | auto archiveResult = lockFreeLoadEntriesIfNeeded(); |
| 139 | if (!archiveResult) { |
| 140 | return archiveResult.moveError(); |
| 141 | } |
| 142 | |
| 143 | const auto& it = _entryByPath.find(path); |
| 144 | if (it == _entryByPath.end()) { |
| 145 | return Error(STRING_FORMAT("No item named '{}' in module '{}', available items are: {}", |
| 146 | path, |
| 147 | _name, |
| 148 | StringBox::join(_allEntryPaths, ", "))); |
| 149 | } |
| 150 | |
| 151 | return it->second; |
| 152 | } |
| 153 | |
| 154 | bool Bundle::hasEntry(const StringBox& path) { |
| 155 | std::lock_guard<std::recursive_mutex> guard(_mutex); |