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

◆ overlay_xml_attributes() [1/2]

template<Reflect::Described T, typename Attributes>
bool MayaFlux::IO::overlay_xml_attributes ( T & target,
Attributes && attributes,
std::string_view label,
std::string & error )

Overlay XML text attributes onto a described value.

Definition at line 38 of file XmlAttributeBinding.hpp.

40{
42 [&](const auto& visit) {
43 return attributes([&](std::string_view name, std::string_view value) {
44 return visit(name, value);
45 });
46 },
47 [&](std::string_view name, std::string_view source, auto& value) {
48 return decode_xml_attribute(name, source, value, label, error);
49 },
50 [&](std::string_view name) {
51 error = "<" + std::string(label) + "> has an unsupported attribute "
52 + std::string(name);
53 return false;
54 });
55}
bool decode_xml_attribute(std::string_view name, std::string_view source, T &value, std::string_view label, std::string &error)
void error(Component component, Context context, std::source_location location, std::string_view message)
Log an error message and optionally throw an exception.
bool overlay_described_fields(T &target, Fields &&fields, Decode &&decode, Unknown &&unknown)
Apply present named fields to a described value.

References decode_xml_attribute(), and MayaFlux::Reflect::overlay_described_fields().

Referenced by MayaFlux::IO::XmlRecordBinding< Input, Node, Access >::overlay(), overlay_xml_attributes(), and MayaFlux::IO::XmlRecordBinding< Input, Node, Access >::read().

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