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

Function node_output_start

lib/pugixml/src/pugixml.cpp:4102–4162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4100 }
4101
4102 PUGI__FN bool node_output_start(xml_buffered_writer& writer, xml_node_struct* node, const char_t* indent, size_t indent_length, unsigned int flags, unsigned int depth)
4103 {
4104 const char_t* default_name = PUGIXML_TEXT(":anonymous");
4105 const char_t* name = node->name ? node->name + 0 : default_name;
4106
4107 writer.write('<');
4108 writer.write_string(name);
4109
4110 if (node->first_attribute)
4111 node_output_attributes(writer, node, indent, indent_length, flags, depth);
4112
4113 // element nodes can have value if parse_embed_pcdata was used
4114 if (!node->value)
4115 {
4116 if (!node->first_child)
4117 {
4118 if (flags & format_no_empty_element_tags)
4119 {
4120 writer.write('>', '<', '/');
4121 writer.write_string(name);
4122 writer.write('>');
4123
4124 return false;
4125 }
4126 else
4127 {
4128 if ((flags & format_raw) == 0)
4129 writer.write(' ');
4130
4131 writer.write('/', '>');
4132
4133 return false;
4134 }
4135 }
4136 else
4137 {
4138 writer.write('>');
4139
4140 return true;
4141 }
4142 }
4143 else
4144 {
4145 writer.write('>');
4146
4147 text_output(writer, node->value, ctx_special_pcdata, flags);
4148
4149 if (!node->first_child)
4150 {
4151 writer.write('<', '/');
4152 writer.write_string(name);
4153 writer.write('>');
4154
4155 return false;
4156 }
4157 else
4158 {
4159 return true;

Callers 1

node_outputFunction · 0.85

Calls 4

node_output_attributesFunction · 0.85
text_outputFunction · 0.85
write_stringMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected