MCPcopy Create free account
hub / github.com/Snapchat/Valdi / deserialize

Method deserialize

valdi/src/valdi/runtime/Resources/ValdiModuleArchive.cpp:124–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122}
123
124Result<ValdiModuleArchive> ValdiModuleArchive::deserialize(BytesView decompressedContent) {
125 auto module = ValdiArchive(decompressedContent.data(), decompressedContent.data() + decompressedContent.size());
126
127 FlatMap<StringBox, ValdiModuleArchiveEntry> entries;
128 std::vector<StringBox> orderedEntryPaths;
129
130 auto allEntries = module.getEntries();
131 if (!allEntries) {
132 return allEntries.moveError();
133 }
134
135 for (const auto& moduleEntry : allEntries.value()) {
136 entries[moduleEntry.filePath] =
137 (ValdiModuleArchiveEntry){.data = moduleEntry.data, .size = moduleEntry.dataLength};
138 orderedEntryPaths.emplace_back(moduleEntry.filePath);
139 }
140
141 return ValdiModuleArchive(std::move(decompressedContent), std::move(entries), std::move(orderedEntryPaths));
142}
143
144} // namespace Valdi

Callers

nothing calls this directly

Calls 6

ValdiArchiveClass · 0.85
ValdiModuleArchiveClass · 0.70
valueMethod · 0.65
dataMethod · 0.45
sizeMethod · 0.45
getEntriesMethod · 0.45

Tested by

no test coverage detected