#pragma once #include #include namespace nall::Beat::Archive { auto extract(Container& container) -> bool { function extract = [&](auto metadata) { if(metadata.name() != "path" && metadata.name() != "file") return; shared_pointer node = new Node; if(node->unserialize(container.memory, metadata)) { container.nodes.append(node); } if(metadata.name() != "path") return; for(auto node : metadata) extract(node); }; container.nodes.reset(); auto document = BML::unserialize(container.metadata); for(auto node : document["archive"]) extract(node); container.sort(); return true; } }