1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/stdapis/libxml2/libxml2_xmlsave.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -0,0 +1,154 @@
1.4 +/*
1.5 + * Summary: the XML document serializer
1.6 + * Description: API to save document or subtree of document
1.7 + *
1.8 + * Copy: See Copyright for the status of this software.
1.9 + *
1.10 + * Author: Daniel Veillard
1.11 + * Portion Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
1.12 + */
1.13 +
1.14 +/** @file
1.15 +@publishedAll
1.16 +@released
1.17 +*/
1.18 +
1.19 +#ifndef XML_XMLSAVE_H
1.20 +#define XML_XMLSAVE_H
1.21 +
1.22 +#include <stdapis/libxml2/libxml2_xmlio.h>
1.23 +
1.24 +#ifdef LIBXML_OUTPUT_ENABLED
1.25 +#ifdef __cplusplus
1.26 +extern "C" {
1.27 +#endif
1.28 +
1.29 +#define MAX_INDENT 60
1.30 +
1.31 +#ifdef XMLENGINE_NODEFILTER
1.32 +
1.33 +/**
1.34 +Pointer to implementation of interface NodeFilter (as introduced in DOM Level 2)
1.35 +
1.36 +@param aNode Node to test
1.37 +@return
1.38 + 1 = KFilterAccept - use node
1.39 + 2 = KFilterReject - do not use node but proceed with child nodes
1.40 + 3 = KFilterSkip - skip node and its subtree
1.41 + 4 = KFilterSkipElementContents - [non-standard option]
1.42 +*/
1.43 +typedef int (XMLCALL *xmlNodeFilterFunc)(xmlNodePtr aNode);
1.44 +typedef int (XMLCALL *xmlNodeFilterProxyFunc)(void* fn, xmlNodePtr aNode);
1.45 +
1.46 +// Constansts for results that are returned by callbacks of node filter during serialization
1.47 +extern const int KFilterAccept;
1.48 +extern const int KFilterReject;
1.49 +extern const int KFilterSkip;
1.50 +extern const int KFilterSkipElementContents;
1.51 +
1.52 +typedef struct _xmlNodeFilterData xmlNodeFilterData;
1.53 +
1.54 +/**
1.55 + * xmlSaveTextNodeCallback:
1.56 + * @param context an Save context
1.57 + * @param aNode node to be serialized
1.58 + *
1.59 + * Callback used in serializing text nodes
1.60 + *
1.61 + * Returns NULL or pointer to string that replaces binary data
1.62 + */
1.63 +typedef unsigned char* (*xmlSaveTextNodeCallback) (void * context, xmlNodePtr aNode, int* written);
1.64 +
1.65 +struct _xmlNodeFilterData{
1.66 + void* fn;
1.67 + xmlNodeFilterProxyFunc proxyFn;
1.68 +};
1.69 +#endif
1.70 +
1.71 +typedef struct _xmlSaveCtxt xmlSaveCtxt;
1.72 +typedef xmlSaveCtxt *xmlSaveCtxtPtr;
1.73 +struct _xmlSaveCtxt {
1.74 + void *_private;
1.75 + int type;
1.76 + int fd;
1.77 + const xmlChar *filename;
1.78 + const xmlChar *encoding;
1.79 + xmlCharEncodingHandlerPtr handler;
1.80 + xmlOutputBufferPtr buf;
1.81 + xmlDocPtr doc;
1.82 + int options;
1.83 + int level;
1.84 + int format;
1.85 +
1.86 + char indent[MAX_INDENT + 1]; /* array for indenting output */
1.87 + int indent_nr;
1.88 + int indent_size;
1.89 + xmlCharEncodingOutputFunc escape; /* used for element content */
1.90 + xmlCharEncodingOutputFunc escapeAttr;/* used for attribute content */
1.91 + xmlSaveTextNodeCallback textNodeCallback;
1.92 + void * context; /* save context */
1.93 +#ifdef XMLENGINE_NODEFILTER
1.94 + xmlNodeFilterData* nodeFilter;
1.95 +#endif
1.96 +};
1.97 +
1.98 +XMLPUBFUN xmlSaveCtxtPtr XMLCALL
1.99 + xmlSaveToFd(
1.100 + int fd,
1.101 + const char *encoding,
1.102 + int options);
1.103 +
1.104 +XMLPUBFUN xmlSaveCtxtPtr XMLCALL
1.105 + xmlSaveToFilename(
1.106 + const char *filename,
1.107 + const char *encoding,
1.108 + int options);
1.109 +
1.110 +XMLPUBFUN xmlSaveCtxtPtr XMLCALL
1.111 + xmlSaveToBuffer(
1.112 + xmlBufferPtr buffer,
1.113 + const char *encoding,
1.114 + int options);
1.115 +
1.116 +XMLPUBFUN xmlSaveCtxtPtr XMLCALL
1.117 + xmlSaveToIO(
1.118 + xmlOutputWriteCallback iowrite,
1.119 + xmlOutputCloseCallback ioclose,
1.120 + void *ioctx,
1.121 + const char *encoding,
1.122 + int options);
1.123 +
1.124 +XMLPUBFUN long XMLCALL
1.125 + xmlSaveDoc(
1.126 + xmlSaveCtxtPtr ctxt,
1.127 + xmlDocPtr doc);
1.128 +
1.129 +XMLPUBFUN long XMLCALL
1.130 + xmlSaveTree(
1.131 + xmlSaveCtxtPtr ctxt,
1.132 + xmlNodePtr node);
1.133 +// XMLENGINE: were made exported
1.134 +void xmlNsListDumpOutput(
1.135 + xmlOutputBufferPtr buf,
1.136 + xmlNsPtr cur);
1.137 +//
1.138 +XMLPUBFUN int XMLCALL
1.139 + xmlSaveFlush(
1.140 + xmlSaveCtxtPtr ctxt);
1.141 +
1.142 +XMLPUBFUN int XMLCALL
1.143 + xmlSaveClose (xmlSaveCtxtPtr ctxt);
1.144 +XMLPUBFUN int XMLCALL
1.145 + xmlSaveSetEscape (xmlSaveCtxtPtr ctxt,
1.146 + xmlCharEncodingOutputFunc escape);
1.147 +XMLPUBFUN int XMLCALL
1.148 + xmlSaveSetAttrEscape (xmlSaveCtxtPtr ctxt,
1.149 + xmlCharEncodingOutputFunc escape);
1.150 +
1.151 +#ifdef __cplusplus
1.152 +}
1.153 +#endif
1.154 +
1.155 +#endif /* LIBXML_OUTPUT_ENABLED */
1.156 +
1.157 +#endif /* XML_XMLSAVE_H */