Simple C Expat Wrapper (SCEW)  1.1.7
tree.h
Go to the documentation of this file.
1 
39 #ifndef TREE_H_0302202332
40 #define TREE_H_0302202332
41 
42 #include "export.h"
43 
44 #include "element.h"
45 
46 #include <expat.h>
47 
48 #ifdef __cplusplus
49 extern "C" {
50 #endif /* __cplusplus */
51 
61 typedef enum
62  {
67 
73 typedef struct scew_tree scew_tree;
74 
84 typedef scew_bool (*scew_tree_cmp_hook) (scew_tree const *, scew_tree const *);
85 
86 
100 extern SCEW_API scew_tree* scew_tree_create (void);
101 
115 extern SCEW_API scew_tree* scew_tree_copy (scew_tree const *tree);
116 
126 extern SCEW_API void scew_tree_free (scew_tree *tree);
127 
128 
162 extern SCEW_API scew_bool scew_tree_compare (scew_tree const *a,
163  scew_tree const *b,
164  scew_tree_cmp_hook hook);
165 
166 
186 extern SCEW_API XML_Char const*
187 scew_tree_xml_version (scew_tree const *tree);
188 
203 extern SCEW_API void scew_tree_set_xml_version (scew_tree *tree,
204  XML_Char const *version);
205 
231 extern SCEW_API XML_Char const* scew_tree_xml_encoding (scew_tree const *tree);
232 
247 extern SCEW_API void scew_tree_set_xml_encoding (scew_tree *tree,
248  XML_Char const *encoding);
249 
263 extern SCEW_API scew_tree_standalone
264 scew_tree_xml_standalone (scew_tree const *tree);
265 
279 extern SCEW_API void
280 scew_tree_set_xml_standalone (scew_tree *tree,
281  scew_tree_standalone standalone);
282 
283 
300 extern SCEW_API scew_element* scew_tree_root (scew_tree const *tree);
301 
320 extern SCEW_API scew_element* scew_tree_set_root (scew_tree *tree,
321  XML_Char const *name);
322 
341 extern SCEW_API scew_element* scew_tree_set_root_element (scew_tree *tree,
342  scew_element *root);
359 extern SCEW_API XML_Char const* scew_tree_xml_preamble (scew_tree const *tree);
360 
377 extern SCEW_API void scew_tree_set_xml_preamble (scew_tree *tree,
378  XML_Char const *preamble);
379 
380 #ifdef __cplusplus
381 }
382 #endif /* __cplusplus */
383 
384 #endif /* TREE_H_0302202332 */
SCEW element's handling routines.
SCEW_API scew_element * scew_tree_set_root(scew_tree *tree, XML_Char const *name)
Creates the root element of an XML tree with the given name.
scew_tree_standalone
List of possible values for the standalone attribute.
Definition: tree.h:61
SCEW shared library support.
SCEW_API void scew_tree_set_xml_preamble(scew_tree *tree, XML_Char const *preamble)
Sets the preamble string for the XML document.
SCEW_API scew_element * scew_tree_root(scew_tree const *tree)
Returns the root element of the given tree.
Extra files are necessary.
Definition: tree.h:64
unsigned char scew_bool
This should be defined using stdbool.h when C99 is available.
Definition: bool.h:35
SCEW_API scew_tree_standalone scew_tree_xml_standalone(scew_tree const *tree)
Returns whether the given tree is an standalone document.
Document stands on its own.
Definition: tree.h:65
SCEW_API void scew_tree_set_xml_encoding(scew_tree *tree, XML_Char const *encoding)
Sets the character encoding used in the given XML tree.
SCEW_API scew_bool scew_tree_compare(scew_tree const *a, scew_tree const *b, scew_tree_cmp_hook hook)
Performs a deep comparison for the given trees.
SCEW_API void scew_tree_free(scew_tree *tree)
Frees a tree memory structure.
SCEW_API void scew_tree_set_xml_standalone(scew_tree *tree, scew_tree_standalone standalone)
The standalone property tells the XML processor whether there are any other extra files to load...
SCEW_API XML_Char const * scew_tree_xml_version(scew_tree const *tree)
Returns the current XML version for the given tree.
SCEW_API void scew_tree_set_xml_version(scew_tree *tree, XML_Char const *version)
Sets the XML version in the XML declaration to the given tree.
SCEW_API XML_Char const * scew_tree_xml_encoding(scew_tree const *tree)
Returns the current XML character encoding for the given tree.
SCEW_API XML_Char const * scew_tree_xml_preamble(scew_tree const *tree)
Return the XML preamble for the given tree.
scew_bool(* scew_tree_cmp_hook)(scew_tree const *, scew_tree const *)
SCEW tree compare hooks might be used to define new user XML tree comparisons.
Definition: tree.h:84
struct scew_tree scew_tree
This is the type delcaration for XML trees.
Definition: tree.h:73
SCEW_API scew_tree * scew_tree_create(void)
Creates a new empty XML tree in memory.
SCEW_API scew_element * scew_tree_set_root_element(scew_tree *tree, scew_element *root)
Sets the root element of an XML tree with the given element.
SCEW_API scew_tree * scew_tree_copy(scew_tree const *tree)
Makes a deep copy of the given tree.
struct scew_element scew_element
This is the type delcaration for SCEW elements.
Definition: element.h:56
Standalone attribute not defined.
Definition: tree.h:63