MCPcopy Create free account
hub / github.com/comaps/comaps / ValidateElement

Function ValidateElement

libs/editor/xml_feature.cpp:83–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81}
82
83void ValidateElement(pugi::xml_node const & nodeOrWay)
84{
85 using editor::XMLFeature;
86
87 if (!nodeOrWay)
88 MYTHROW(editor::InvalidXML, ("Document has no valid root element."));
89
90 auto const type = XMLFeature::StringToType(nodeOrWay.name());
91
92 if (type == XMLFeature::Type::Unknown)
93 MYTHROW(editor::InvalidXML, ("XMLFeature does not support root tag", nodeOrWay.name()));
94
95 if (type == XMLFeature::Type::Node)
96 UNUSED_VALUE(GetLatLonFromNode(nodeOrWay));
97
98 if (!nodeOrWay.attribute(kTimestamp))
99 MYTHROW(editor::NoTimestamp, ("Node has no timestamp attribute"));
100}
101} // namespace
102
103XMLFeature::XMLFeature(Type const type)

Callers 1

XMLFeatureMethod · 0.85

Calls 2

GetLatLonFromNodeFunction · 0.85
nameMethod · 0.45

Tested by

no test coverage detected