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

◆ root_element()

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

Borrow the document root element, independent of the row read position.

Definition at line 291 of file XmlReader.cpp.

292{
293 if (!m_rows)
294 return std::nullopt;
295
296 for (size_t index = 0; index < m_rows->size(); index += m_forest->subtree_size(index)) {
297 const auto source = m_rows->at(index);
298 if (source && source->text("kind") == std::string_view("element"))
299 return XmlElementView(*m_rows, *m_forest, index);
300 }
301 return std::nullopt;
302}
std::optional< Kakshya::CompositeArray > m_rows
std::optional< Kakshya::ForestIndex > m_forest
Source source()
Begin a Source chain.
Definition Plot.hpp:127

References m_forest, and m_rows.