MCPcopy Create free account
hub / github.com/WheretIB/nullc / offset_debug

Method offset_debug

external/pugixml/pugixml.cpp:4291–4320  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4289#endif
4290
4291 ptrdiff_t xml_node::offset_debug() const
4292 {
4293 xml_node_struct* r = root()._root;
4294
4295 if (!r) return -1;
4296
4297 const char_t* buffer = static_cast<xml_document_struct*>(r)->buffer;
4298
4299 if (!buffer) return -1;
4300
4301 switch (type())
4302 {
4303 case node_document:
4304 return 0;
4305
4306 case node_element:
4307 case node_declaration:
4308 case node_pi:
4309 return (_root->header & xml_memory_page_name_allocated_mask) ? -1 : _root->name - buffer;
4310
4311 case node_pcdata:
4312 case node_cdata:
4313 case node_comment:
4314 case node_doctype:
4315 return (_root->header & xml_memory_page_value_allocated_mask) ? -1 : _root->value - buffer;
4316
4317 default:
4318 return -1;
4319 }
4320 }
4321
4322#ifdef __BORLANDC__
4323 bool operator&&(const xml_node& lhs, bool rhs)

Callers 1

xml_node__offset_debugFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected