MCPcopy Create free account
hub / github.com/Kistler-Group/sdbus-cpp / start_element_handler

Method start_element_handler

tools/xml2cpp-codegen/xml.cpp:262–282  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

260}
261
262void Document::Expat::start_element_handler(void* data, const XML_Char* name, const XML_Char** atts)
263{
264 Document* doc = static_cast<Document*>(data);
265
266 if (!doc->root)
267 {
268 doc->root = new Node(name, atts);
269 }
270 else
271 {
272 Node::Children* cld = &(doc->root->children);
273
274 for (int i = 1; i < doc->m_depth; ++i)
275 {
276 cld = &(cld->back().children);
277 }
278 cld->push_back(Node(name, atts));
279
280 }
281 doc->m_depth++;
282}
283
284void Document::Expat::character_data_handler(void* data, const XML_Char* chars, int len)
285{

Callers

nothing calls this directly

Calls 2

NodeClass · 0.85
push_backMethod · 0.80

Tested by

no test coverage detected