MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / node_output

Function node_output

lib/pugixml/src/pugixml.cpp:4236–4327  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4234 };
4235
4236 PUGI__FN void node_output(xml_buffered_writer& writer, xml_node_struct* root, const char_t* indent, unsigned int flags, unsigned int depth)
4237 {
4238 size_t indent_length = ((flags & (format_indent | format_indent_attributes)) && (flags & format_raw) == 0) ? strlength(indent) : 0;
4239 unsigned int indent_flags = indent_indent;
4240
4241 xml_node_struct* node = root;
4242
4243 do
4244 {
4245 assert(node);
4246
4247 // begin writing current node
4248 if (PUGI__NODETYPE(node) == node_pcdata || PUGI__NODETYPE(node) == node_cdata)
4249 {
4250 node_output_simple(writer, node, flags);
4251
4252 indent_flags = 0;
4253 }
4254 else
4255 {
4256 if ((indent_flags & indent_newline) && (flags & format_raw) == 0)
4257 writer.write('\n');
4258
4259 if ((indent_flags & indent_indent) && indent_length)
4260 text_output_indent(writer, indent, indent_length, depth);
4261
4262 if (PUGI__NODETYPE(node) == node_element)
4263 {
4264 indent_flags = indent_newline | indent_indent;
4265
4266 if (node_output_start(writer, node, indent, indent_length, flags, depth))
4267 {
4268 // element nodes can have value if parse_embed_pcdata was used
4269 if (node->value)
4270 indent_flags = 0;
4271
4272 node = node->first_child;
4273 depth++;
4274 continue;
4275 }
4276 }
4277 else if (PUGI__NODETYPE(node) == node_document)
4278 {
4279 indent_flags = indent_indent;
4280
4281 if (node->first_child)
4282 {
4283 node = node->first_child;
4284 continue;
4285 }
4286 }
4287 else
4288 {
4289 node_output_simple(writer, node, flags);
4290
4291 indent_flags = indent_newline | indent_indent;
4292 }
4293 }

Callers 2

printMethod · 0.85
saveMethod · 0.85

Calls 6

strlengthFunction · 0.85
node_output_simpleFunction · 0.85
text_output_indentFunction · 0.85
node_output_startFunction · 0.85
node_output_endFunction · 0.85
writeMethod · 0.45

Tested by

no test coverage detected