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

◆ read_structure()

template<typename Source, typename Access>
bool MayaFlux::Portal::Forma::Detail::DocumentWalk< Source, Access >::read_structure ( )
inline

Definition at line 87 of file Instantiate.hpp.

88 {
89 if (Access::name(m_root) != "forma")
90 return fail(m_root, "root element must be <forma>");
91 if (!only_attributes(m_root, { "version", "xmlns" }, "xmlns:") || !check_version())
92 return false;
93
94 bool templates_seen = false;
95 const bool traversed = Access::for_each_child(m_root, [&](const Source& section) {
96 const auto name = Access::name(section);
97 if (name == "templates") {
99 return fail(section, "<templates> may appear only once");
100 templates_seen = true;
101 return read_templates(section);
102 }
103 if (name == "surface")
104 return read_surface(section);
105 return fail(section, "<" + std::string(name) + "> is not allowed in <forma>");
106 });
107 return traversed && check_instances();
108 }
bool only_attributes(const Source &source, std::initializer_list< std::string_view > allowed, std::string_view allowed_prefix={})
bool fail(const Source &at, std::string message)

References check_instances(), check_version(), fail(), m_root, only_attributes(), read_surface(), and read_templates().

Referenced by MayaFlux::Portal::Forma::Detail::instantiate(), MayaFlux::Portal::Forma::instantiate_rows(), and MayaFlux::Portal::Forma::instantiate_rows().

Here is the call graph for this function:
Here is the caller graph for this function: