gwenhywfar  4.6.0beta
xml.h
Go to the documentation of this file.
1 /***************************************************************************
2  begin : Sat Jun 28 2003
3  copyright : (C) 2003-2010 by Martin Preuss
4  email : martin@libchipcard.de
5 
6  ***************************************************************************
7  * *
8  * This library is free software; you can redistribute it and/or *
9  * modify it under the terms of the GNU Lesser General Public *
10  * License as published by the Free Software Foundation; either *
11  * version 2.1 of the License, or (at your option) any later version. *
12  * *
13  * This library is distributed in the hope that it will be useful, *
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
16  * Lesser General Public License for more details. *
17  * *
18  * You should have received a copy of the GNU Lesser General Public *
19  * License along with this library; if not, write to the Free Software *
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
21  * MA 02111-1307 USA *
22  * *
23  ***************************************************************************/
24 
25 #ifndef GWENHYWFAR_XML_H
26 #define GWENHYWFAR_XML_H
27 
28 #include <gwenhywfar/gwenhywfarapi.h>
29 #include <gwenhywfar/stringlist.h>
30 #include <gwenhywfar/types.h>
31 #include <gwenhywfar/list2.h>
32 #include <gwenhywfar/syncio.h>
33 
34 #include <stdio.h>
35 
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
46 
51 
52 
56 
60 #define GWEN_XML_FLAGS_HANDLE_COMMENTS 0x0001
61 
66 #define GWEN_XML_FLAGS_INDENT 0x0002
67 
73 #define GWEN_XML_FLAGS_HANDLE_OPEN_HTMLTAGS 0x0004
74 
79 #define GWEN_XML_FLAGS_NO_CONDENSE 0x0008
80 
85 #define GWEN_XML_FLAGS_KEEP_CNTRL 0x0010
86 
87 #define GWEN_XML_FLAGS_KEEP_BLANKS 0x0020
88 
89 #define GWEN_XML_FLAGS_SIMPLE 0x0040
90 
94 #define GWEN_XML_FLAGS_HANDLE_HEADERS 0x0080
95 
103 #define GWEN_XML_FLAGS_TOLERANT_ENDTAGS 0x0100
104 
105 #define GWEN_XML_FLAGS_HANDLE_NAMESPACES 0x0200
106 
110 #define GWEN_XML_FLAGS_DEFAULT \
111  (\
112  GWEN_XML_FLAGS_INDENT | \
113  GWEN_XML_FLAGS_HANDLE_COMMENTS\
114  )
115 
121 typedef enum {
130 
134 typedef struct GWEN__XMLNODE GWEN_XMLNODE;
136 
139 
141 
142 #ifdef __cplusplus
143 }
144 #endif
145 
146 
147 #include <gwenhywfar/xmlctx.h>
148 #include <gwenhywfar/fastbuffer.h>
149 
150 
151 #ifdef __cplusplus
152 extern "C" {
153 #endif
154 
155 
156 
162 GWEN_XMLNODE *GWEN_XMLNode_new(GWEN_XMLNODE_TYPE t, const char *data);
163 
169 
177 
183 
207 
214 
220 
227 
234 
259  const char *GWEN_XMLNode_GetProperty(const GWEN_XMLNODE *n,
260  const char *name,
261  const char *defaultValue);
262 
272  const char *name,
273  const char *value);
274 
280 int GWEN_XMLNode_GetIntProperty(const GWEN_XMLNODE *n, const char *name,
281  int defaultValue);
282 
288  const char *name, int value);
289 
301  const GWEN_XMLNODE *sn,
302  int overwrite);
312 
315 const char *GWEN_XMLNode_GetData(const GWEN_XMLNODE *n);
316 
320 void GWEN_XMLNode_SetData(GWEN_XMLNODE *n, const char *data);
321 
323 const char *GWEN_XMLNode_GetNamespace(const GWEN_XMLNODE *n);
324 
326 void GWEN_XMLNode_SetNamespace(GWEN_XMLNODE *n, const char *s);
327 
347 
350 
352  uint32_t GWEN_XMLNode_GetUsage(const GWEN_XMLNODE *n);
371 
381 
386 
397 
411 
421 
435 
463  const char *tname,
464  const char *pname,
465  const char *pvalue);
466 
474  const char *tname,
475  const char *pname,
476  const char *pvalue);
477 
483 int GWEN_XMLNode_IsChildOf(const GWEN_XMLNODE *parent,
484  const GWEN_XMLNODE *child);
485 
487 int GWEN_XMLNode_GetXPath(const GWEN_XMLNODE *n1,
488  const GWEN_XMLNODE *n2,
489  GWEN_BUFFER *nbuf);
490 
505  const char *path,
506  uint32_t flags);
507 
508 
516 
527 
537 
543 
556  int copythem);
557 
566  const char *data);
574 
581 
582 
583 
586 
587 
590 
591 
594  GWEN_XMLNODE_NAMESPACE_LIST *l,
595  uint32_t *pLastId);
596 
597 
600 
606 
608 int GWEN_XMLContext_ReadFromFile(GWEN_XML_CONTEXT *ctx, const char *fname);
609 
611 int GWEN_XMLContext_ReadFromString(GWEN_XML_CONTEXT *ctx, const char *text);
612 
613 
619 int GWEN_XML_ReadFile(GWEN_XMLNODE *n, const char *filepath, uint32_t flags);
620 
623  int len,
624  uint32_t flags);
625 
631  GWEN_XML_CONTEXT *ctx,
632  GWEN_SYNCIO *sio);
633 
639  const char *fname,
640  uint32_t flags);
641 
643 int GWEN_XMLNode_toBuffer(const GWEN_XMLNODE *n, GWEN_BUFFER *buf, uint32_t flags);
644 
645 
646 
647 
649 GWEN_XMLNODE_NAMESPACE_LIST *GWEN_XMLNode_GetNameSpaces(const GWEN_XMLNODE *n);
650 
653  const char *s);
654 
657  const char *s);
658 
661 
662 
663 
688 
695 const char *GWEN_XMLNode_GetCharValue(const GWEN_XMLNODE *n,
696  const char *name,
697  const char *defValue);
698 
701  const char *name,
702  const char *value);
703 
718  const char *name,
719  const char *defValue);
720 
730  const char *name,
731  int defValue);
732 
735  const char *name,
736  int value);
737 
745 
750 void GWEN_XMLNode_Dump(const GWEN_XMLNODE *n, int ind);
753  /* defgroup */
754 
755 
763 
765 
766 
773 
779  GWEN_XMLNODE *n);
780 
787 
792 void GWEN_XMLNode_Path_Dump(GWEN_XMLNODE_PATH *np); /* defgroup */ /* defgroup (all)*/
795 
796 
797 
800  const char *url);
801 
804 
807 
810 
813 
814 
815 #ifdef __cplusplus
816 }
817 #endif
818 
819 
820 
821 #endif