diff options
author | arseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640> | 2011-09-10 03:05:29 +0000 |
---|---|---|
committer | arseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640> | 2011-09-10 03:05:29 +0000 |
commit | 7757503d72c7ce61e562fd5a1fd19ae90472410b (patch) | |
tree | 21b372af01729a9218692e6da051a3926f2596cf /src/pugixml.cpp | |
parent | 74f33b1a6c09513626242e6568f40569cd8709fa (diff) |
Added format_no_escapes flag
git-svn-id: http://pugixml.googlecode.com/svn/trunk@819 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'src/pugixml.cpp')
-rw-r--r-- | src/pugixml.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/pugixml.cpp b/src/pugixml.cpp index 7a6e946..3653e95 100644 --- a/src/pugixml.cpp +++ b/src/pugixml.cpp @@ -2856,6 +2856,14 @@ namespace } } + void text_output(xml_buffered_writer& writer, const char_t* s, chartypex_t type, unsigned int flags) + { + if (flags & format_no_escapes) + writer.write(s); + else + text_output_escaped(writer, s, type); + } + void text_output_cdata(xml_buffered_writer& writer, const char_t* s) { do @@ -2878,7 +2886,7 @@ namespace while (*s); } - void node_output_attributes(xml_buffered_writer& writer, const xml_node& node) + void node_output_attributes(xml_buffered_writer& writer, const xml_node& node, unsigned int flags) { const char_t* default_name = PUGIXML_TEXT(":anonymous"); @@ -2888,7 +2896,7 @@ namespace writer.write(a.name()[0] ? a.name() : default_name); writer.write('=', '"'); - text_output_escaped(writer, a.value(), ctx_special_attr); + text_output(writer, a.value(), ctx_special_attr, flags); writer.write('"'); } @@ -2917,7 +2925,7 @@ namespace writer.write('<'); writer.write(name); - node_output_attributes(writer, node); + node_output_attributes(writer, node, flags); if (flags & format_raw) { @@ -2942,7 +2950,7 @@ namespace writer.write('>'); if (node.first_child().type() == node_pcdata) - text_output_escaped(writer, node.first_child().value(), ctx_special_pcdata); + text_output(writer, node.first_child().value(), ctx_special_pcdata, flags); else text_output_cdata(writer, node.first_child().value()); @@ -2969,7 +2977,7 @@ namespace } case node_pcdata: - text_output_escaped(writer, node.value(), ctx_special_pcdata); + text_output(writer, node.value(), ctx_special_pcdata, flags); if ((flags & format_raw) == 0) writer.write('\n'); break; @@ -2992,7 +3000,7 @@ namespace if (node.type() == node_declaration) { - node_output_attributes(writer, node); + node_output_attributes(writer, node, flags); } else if (node.value()[0]) { |