| 26 | } |
| 27 | |
| 28 | Future<ResultPointer<Schema>> NetworkSchemaAssetDescriptor::load( |
| 29 | const AsyncSystem& asyncSystem, |
| 30 | const std::shared_ptr<IAssetAccessor>& pAssetAccessor) const { |
| 31 | return this->loadBytesFromNetwork(asyncSystem, pAssetAccessor) |
| 32 | .thenInWorkerThread([](Result<std::vector<std::byte>>&& result) { |
| 33 | if (!result.value) { |
| 34 | return ResultPointer<Schema>(result.errors); |
| 35 | } |
| 36 | |
| 37 | SchemaReader reader{}; |
| 38 | CesiumJsonReader::ReadJsonResult<CesiumGltf::Schema> jsonReadResult = |
| 39 | reader.readFromJson(*result.value); |
| 40 | |
| 41 | CesiumUtility::IntrusivePointer<CesiumGltf::Schema> pSchema; |
| 42 | if (result.value.has_value()) { |
| 43 | pSchema.emplace(std::move(*jsonReadResult.value)); |
| 44 | } |
| 45 | |
| 46 | result.errors.merge( |
| 47 | ErrorList{jsonReadResult.errors, jsonReadResult.warnings}); |
| 48 | |
| 49 | return ResultPointer<Schema>(pSchema, std::move(result.errors)); |
| 50 | }); |
| 51 | } |
| 52 | } // namespace CesiumGltfReader |
| 53 | |
| 54 | std::size_t |
nothing calls this directly
no test coverage detected