1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-27 18:50:07 +03:00

- tree.[ch] xmlIO.h: applied patch from Joe McAlerney to add

xmlSaveFormatFileTo()
Daniel
This commit is contained in:
Daniel Veillard 2001-04-28 16:55:50 +00:00
parent e39a93d0d3
commit eefd44943c
6 changed files with 44 additions and 2 deletions

View File

@ -1,3 +1,8 @@
Sat Apr 28 18:54:28 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
* tree.[ch] xmlIO.h: applied patch from Joe McAlerney to add
xmlSaveFormatFileTo()
Sat Apr 28 16:33:05 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
* xpath.c: simple and efficient optimization, XPath functions

View File

@ -689,11 +689,15 @@ void xmlNodeDump (xmlBufferPtr buf,
int level,
int format);
/* This one is exported from xmlIO.h
/* These are exported from xmlIO.h
int xmlSaveFileTo (xmlOutputBuffer *buf,
xmlDocPtr cur,
const char *encoding);
int xmlSaveFormatFileTo (xmlOutputBuffer *buf,
xmlDocPtr cur,
const char *encoding,
int format);
*/
int xmlSaveFileEnc (const char *filename,

View File

@ -162,6 +162,10 @@ int xmlRegisterOutputCallbacks (xmlOutputMatchCallback matchFunc,
int xmlSaveFileTo (xmlOutputBuffer *buf,
xmlDocPtr cur,
const char *encoding);
int xmlSaveFormatFileTo (xmlOutputBuffer *buf,
xmlDocPtr cur,
const char *encoding,
int format);
void xmlNodeDumpOutput (xmlOutputBufferPtr buf,
xmlDocPtr doc,
xmlNodePtr cur,

21
tree.c
View File

@ -6129,6 +6129,27 @@ xmlSaveFileTo(xmlOutputBuffer *buf, xmlDocPtr cur, const char *encoding) {
return(ret);
}
/**
* xmlSaveFormatFileTo:
* @buf: an output I/O buffer
* @cur: the document
* @encoding: the encoding if any assuming the i/O layer handles the trancoding
* @format: should formatting spaces been added
*
* Dump an XML document to an I/O buffer.
*
* returns: the number of byte written or -1 in case of failure.
*/
int
xmlSaveFormatFileTo(xmlOutputBuffer *buf, xmlDocPtr cur, const char *encoding, int format) {
int ret;
if (buf == NULL) return(0);
xmlDocContentDumpOutput(buf, cur, encoding, format);
ret = xmlOutputBufferClose(buf);
return(ret);
}
/**
* xmlSaveFileEnc:
* @filename: the filename (or URL)

6
tree.h
View File

@ -689,11 +689,15 @@ void xmlNodeDump (xmlBufferPtr buf,
int level,
int format);
/* This one is exported from xmlIO.h
/* These are exported from xmlIO.h
int xmlSaveFileTo (xmlOutputBuffer *buf,
xmlDocPtr cur,
const char *encoding);
int xmlSaveFormatFileTo (xmlOutputBuffer *buf,
xmlDocPtr cur,
const char *encoding,
int format);
*/
int xmlSaveFileEnc (const char *filename,

View File

@ -162,6 +162,10 @@ int xmlRegisterOutputCallbacks (xmlOutputMatchCallback matchFunc,
int xmlSaveFileTo (xmlOutputBuffer *buf,
xmlDocPtr cur,
const char *encoding);
int xmlSaveFormatFileTo (xmlOutputBuffer *buf,
xmlDocPtr cur,
const char *encoding,
int format);
void xmlNodeDumpOutput (xmlOutputBufferPtr buf,
xmlDocPtr doc,
xmlNodePtr cur,