MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ root_element()

std::optional< XmlElementView > MayaFlux::IO::XmlDocument::root_element ( ) const
nodiscardnoexcept

Borrow the document root element.

Definition at line 37 of file XmlDocument.cpp.

38{
39 const auto& rows = m_forest->rows();
40 const auto& index = m_forest->index();
41 for (size_t row = 0; row < rows.size(); row += index.subtree_size(row)) {
42 const auto source = rows.at(row);
43 if (source && source->text("kind") == std::string_view("element"))
44 return XmlElementView(rows, index, row);
45 }
46 return std::nullopt;
47}
std::shared_ptr< const Kakshya::CompositeForest > m_forest
Source source()
Begin a Source chain.
Definition Plot.hpp:127

References m_forest.