MCPcopy Create free account
hub / github.com/Kitware/VTK / xmlOutputBufferWriteQuotedString

Function xmlOutputBufferWriteQuotedString

ThirdParty/libxml2/vtklibxml2/xmlIO.c:2783–2822  ·  view source on GitHub ↗

* xmlOutputBufferWriteQuotedString: * @buf: output buffer * @string: the string to add * * routine which manage and grows an output buffer. This one writes * a quoted or double quoted #xmlChar string, checking first if it holds * quote or double-quotes internally */

Source from the content-addressed store, hash-verified

2781 * quote or double-quotes internally
2782 */
2783void
2784xmlOutputBufferWriteQuotedString(xmlOutputBufferPtr buf,
2785 const xmlChar *string) {
2786 const xmlChar *cur, *base;
2787
2788 if ((buf == NULL) || (buf->error))
2789 return;
2790
2791 if (xmlStrchr(string, '\"')) {
2792 if (xmlStrchr(string, '\'')) {
2793 xmlOutputBufferWrite(buf, 1, "\"");
2794 base = cur = string;
2795 while(*cur != 0){
2796 if(*cur == '"'){
2797 if (base != cur)
2798 xmlOutputBufferWrite(buf, cur - base,
2799 (const char *) base);
2800 xmlOutputBufferWrite(buf, 6, """);
2801 cur++;
2802 base = cur;
2803 }
2804 else {
2805 cur++;
2806 }
2807 }
2808 if (base != cur)
2809 xmlOutputBufferWrite(buf, cur - base, (const char *) base);
2810 xmlOutputBufferWrite(buf, 1, "\"");
2811 }
2812 else{
2813 xmlOutputBufferWrite(buf, 1, "'");
2814 xmlOutputBufferWriteString(buf, (const char *) string);
2815 xmlOutputBufferWrite(buf, 1, "'");
2816 }
2817 } else {
2818 xmlOutputBufferWrite(buf, 1, "\"");
2819 xmlOutputBufferWriteString(buf, (const char *) string);
2820 xmlOutputBufferWrite(buf, 1, "\"");
2821 }
2822}
2823
2824/**
2825 * xmlOutputBufferFlush:

Callers 9

xmlC14NPrintNamespacesFunction · 0.85
htmlDtdDumpOutputFunction · 0.85
htmlAttrDumpOutputFunction · 0.85
xmlBufDumpNotationDeclFunction · 0.85
xmlBufDumpAttributeDeclFunction · 0.85
xmlBufDumpEntityContentFunction · 0.85
xmlBufDumpEntityDeclFunction · 0.85
xmlDtdDumpOutputFunction · 0.85
xmlDocContentDumpOutputFunction · 0.85

Calls 3

xmlStrchrFunction · 0.85
xmlOutputBufferWriteFunction · 0.85

Tested by

no test coverage detected