1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-12-25 23:21:26 +03:00

Convert the writer to new output buffer and save APIs

Only a handful of places had to be converted for xmlBuf and
the new saving entry point.
This commit is contained in:
Daniel Veillard 2012-07-16 14:54:45 +08:00
parent 8aebce3ec6
commit dbf5411b21

View File

@ -21,6 +21,10 @@
#include <libxml/xmlwriter.h>
#include "buf.h"
#include "enc.h"
#include "save.h"
#define B64LINELEN 72
#define B64CRLF "\r\n"
@ -548,9 +552,9 @@ xmlTextWriterStartDocument(xmlTextWriterPtr writer, const char *version,
writer->out->encoder = encoder;
if (encoder != NULL) {
if (writer->out->conv == NULL) {
writer->out->conv = xmlBufferCreateSize(4000);
writer->out->conv = xmlBufCreateSize(4000);
}
xmlCharEncOutFunc(encoder, writer->out->conv, NULL);
xmlCharEncOutput(writer->out, 1);
if ((writer->doc != NULL) && (writer->doc->encoding == NULL))
writer->doc->encoding = xmlStrdup((xmlChar *)writer->out->encoder->name);
} else
@ -1501,8 +1505,8 @@ xmlTextWriterWriteString(xmlTextWriterPtr writer, const xmlChar * content)
break;
case XML_TEXTWRITER_ATTRIBUTE:
buf = NULL;
xmlAttrSerializeTxtContent(writer->out->buffer, writer->doc,
NULL, content);
xmlBufAttrSerializeTxtContent(writer->out->buffer,
writer->doc, NULL, content);
break;
default:
break;