Node Clone(const Node& node) { NodeEvents events(node); NodeBuilder builder; events.Emit(builder); return builder.Root(); }
Node Load(std::istream& input) { Parser parser(input); NodeBuilder builder; if(!parser.HandleNextDocument(builder)) return Node(); return builder.Root(); }
std::vector<Node> LoadAll(std::istream& input) { std::vector<Node> docs; Parser parser(input); while(1) { NodeBuilder builder; if(!parser.HandleNextDocument(builder)) break; docs.push_back(builder.Root()); } return docs; }