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

Method character_data_handler

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

Source from the content-addressed store, hash-verified

282}
283
284void Document::Expat::character_data_handler(void* data, const XML_Char* chars, int len)
285{
286 Document* doc = static_cast<Document*>(data);
287
288 Node* nod = doc->root;
289
290 for (int i = 1; i < doc->m_depth; ++i)
291 {
292 nod = &(nod->children.back());
293 }
294
295 int x = 0, y = len - 1;
296
297 while (isspace(chars[y]) && y > 0) --y;
298 while (isspace(chars[x]) && x < y) ++x;
299
300 nod->cdata = std::string(chars, x, y + 1);
301}
302
303void Document::Expat::end_element_handler(void* data, const XML_Char* /*name*/)
304{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected