MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / startElement

Method startElement

src/App/ProjectFile.cpp:233–290  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

231 }
232
233 FilterAction startElement(DOMElement* node) override
234 {
235 std::array property = {chLatin_P,
236 chLatin_r,
237 chLatin_o,
238 chLatin_p,
239 chLatin_e,
240 chLatin_r,
241 chLatin_t,
242 chLatin_y,
243 chNull};
244 if (XMLString::equals(node->getNodeName(), property.data())) {
245 std::array name = {chLatin_n,
246 chLatin_a,
247 chLatin_m,
248 chLatin_e,
249 chNull};
250 if (DOMAttr* attr = node->getAttributeNode(name.data())) {
251 std::string value = StrX(attr->getNodeValue()).c_str();
252 auto it = propMap.find(value);
253 if (it != propMap.end()) {
254 currentProperty = value;
255 }
256 else {
257 currentProperty.clear();
258 }
259 }
260 }
261
262 std::array string = {chLatin_S,
263 chLatin_t,
264 chLatin_r,
265 chLatin_i,
266 chLatin_n,
267 chLatin_g,
268 chNull};
269 if (XMLString::equals(node->getNodeName(), string.data())) {
270 if (!currentProperty.empty()) {
271 propMap[currentProperty] = readValue(node->getParentNode());
272 currentProperty.clear();
273 }
274 }
275
276 // This is the node after the 'Properties' element of the document
277 std::array Objects = {chLatin_O,
278 chLatin_b,
279 chLatin_j,
280 chLatin_e,
281 chLatin_c,
282 chLatin_t,
283 chLatin_s,
284 chNull};
285 if (XMLString::equals(node->getNodeName(), Objects.data())) {
286 ThrowXML(ParseException,XMLExcepts::Parser_Parse1);
287 }
288
289 return DOMLSParserFilter::FILTER_ACCEPT;
290 }

Callers

nothing calls this directly

Calls 9

equalsFunction · 0.85
StrXClass · 0.85
readValueFunction · 0.85
dataMethod · 0.45
c_strMethod · 0.45
findMethod · 0.45
endMethod · 0.45
clearMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected