libopc
textwriter.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2010, Florian Reuter
3  All rights reserved.
4 
5  Redistribution and use in source and binary forms, with or without
6  modification, are permitted provided that the following conditions
7  are met:
8 
9  * Redistributions of source code must retain the above copyright
10  notice, this list of conditions and the following disclaimer.
11  * Redistributions in binary form must reproduce the above copyright
12  notice, this list of conditions and the following disclaimer in
13  the documentation and/or other materials provided with the
14  distribution.
15  * Neither the name of Florian Reuter nor the names of its contributors
16  may be used to endorse or promote products derived from this
17  software without specific prior written permission.
18 
19  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23  COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
25  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
28  STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
30  OF THE POSSIBILITY OF SUCH DAMAGE.
31 
32 */
36 #include <mce/config.h>
37 #include <libxml/xmlwriter.h>
38 #include <mce/helper.h>
39 
40 #ifndef MCE_TEXTWRITER_H
41 #define MCE_TEXTWRITER_H
42 
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46 
50 #define MCE_DEFAULT 0x0
51 
55 #define MCE_IGNORABLE 0x1
56 
60 #define MCE_MUSTUNDERSTAND 0x2
61 
66 
72  mceTextWriter *mceTextWriterCreateIO(xmlOutputWriteCallback iowrite, xmlOutputCloseCallback ioclose, void *ioctx, xmlCharEncodingHandlerPtr encoder);
73 
78 
83 
88 
93 
99  int mceTextWriterStartElement(mceTextWriter *w, const xmlChar *ns, const xmlChar *ln);
100 
104  int mceTextWriterEndElement(mceTextWriter *w, const xmlChar *ns, const xmlChar *ln);
105 
109  int mceTextWriterWriteString(mceTextWriter *w, const xmlChar *content);
110 
117  const xmlChar *mceTextWriterRegisterNamespace(mceTextWriter *w, const xmlChar *ns, const xmlChar *prefix, int flags);
118 
122  int mceTextWriterProcessContent(mceTextWriter *w, const xmlChar *ns, const xmlChar *ln);
123 
128  int mceTextWriterAttributeF(mceTextWriter *w, const xmlChar *ns, const xmlChar *ln, const char *value, ...);
129 
134 
139 
143  int mceTextWriterStartChoice(mceTextWriter *w, const xmlChar *ns);
144 
149 
154 
159 
160 
164  xmlTextWriterPtr mceTextWriterIntern(mceTextWriter *w);
165 
169  xmlTextWriterPtr xmlNewTextWriterFile(FILE *file);
170 
171 
172 #ifdef __cplusplus
173 } /* extern "C" */
174 #endif
175 
176 #endif /* MCE_TEXTWRITER_H */
int mceTextWriterStartAlternateContent(mceTextWriter *w)
Definition: textwriter.c:230
int mceTextWriterAttributeF(mceTextWriter *w, const xmlChar *ns, const xmlChar *ln, const char *value,...)
Definition: textwriter.c:211
int mceTextWriterStartDocument(mceTextWriter *w)
Definition: textwriter.c:75
const xmlChar * mceTextWriterRegisterNamespace(mceTextWriter *w, const xmlChar *ns, const xmlChar *prefix, int flags)
Definition: textwriter.c:195
xmlTextWriterPtr xmlNewTextWriterFile(FILE *file)
Definition: textwriter.c:274
int mceTextWriterEndFallback(mceTextWriter *w)
Definition: textwriter.c:260
int mceTextWriterEndDocument(mceTextWriter *w)
Definition: textwriter.c:82
mceTextWriter * mceNewTextWriterFile(FILE *file)
Definition: textwriter.c:290
int mceTextWriterFree(mceTextWriter *w)
Definition: textwriter.c:63
mceTextWriter * mceTextWriterCreateIO(xmlOutputWriteCallback iowrite, xmlOutputCloseCallback ioclose, void *ioctx, xmlCharEncodingHandlerPtr encoder)
Definition: textwriter.c:43
int mceTextWriterStartElement(mceTextWriter *w, const xmlChar *ns, const xmlChar *ln)
Definition: textwriter.c:90
int mceTextWriterWriteString(mceTextWriter *w, const xmlChar *content)
Definition: textwriter.c:189
int mceTextWriterEndElement(mceTextWriter *w, const xmlChar *ns, const xmlChar *ln)
Definition: textwriter.c:179
int mceTextWriterStartFallback(mceTextWriter *w)
Definition: textwriter.c:256
int mceTextWriterEndChoice(mceTextWriter *w)
Definition: textwriter.c:252
Definition: textwriter.c:34
xmlTextWriterPtr mceTextWriterIntern(mceTextWriter *w)
Definition: textwriter.c:294
int mceTextWriterEndAlternateContent(mceTextWriter *w)
Definition: textwriter.c:234
int mceTextWriterProcessContent(mceTextWriter *w, const xmlChar *ns, const xmlChar *ln)
Definition: textwriter.c:207
int mceTextWriterStartChoice(mceTextWriter *w, const xmlChar *ns)
Definition: textwriter.c:238