Simple C Expat Wrapper (SCEW)  1.1.7
parser.h
Go to the documentation of this file.
1 
38 #ifndef PARSER_H_0211250057
39 #define PARSER_H_0211250057
40 
41 #include "export.h"
42 
43 #include "bool.h"
44 #include "reader.h"
45 #include "tree.h"
46 
47 #include <expat.h>
48 
49 #include <stdio.h>
50 
51 #ifdef __cplusplus
52 extern "C" {
53 #endif /* __cplusplus */
54 
60 typedef struct scew_parser scew_parser;
61 
80 typedef scew_bool (*scew_parser_load_hook) (scew_parser *, void *, void *);
81 
82 
100 extern SCEW_API scew_parser* scew_parser_create (void);
101 
116 extern SCEW_API scew_parser* scew_parser_namespace_create (XML_Char separator);
117 
124 extern SCEW_API void scew_parser_free (scew_parser *parser);
125 
126 
158 extern SCEW_API scew_tree* scew_parser_load (scew_parser *parser,
159  scew_reader *reader);
160 
191 extern SCEW_API scew_bool scew_parser_load_stream (scew_parser *parser,
192  scew_reader *reader);
193 
206 extern SCEW_API void scew_parser_reset (scew_parser *parser);
207 
230 extern SCEW_API void scew_parser_set_element_hook (scew_parser *parser,
232  void *user_data);
233 
253 extern SCEW_API void scew_parser_set_tree_hook (scew_parser *parser,
255  void *user_data);
256 
280 extern SCEW_API void scew_parser_ignore_whitespaces (scew_parser *parser,
281  scew_bool ignore);
282 
283 
301 extern SCEW_API XML_Parser scew_parser_expat (scew_parser *parser);
302 
303 #ifdef __cplusplus
304 }
305 #endif /* __cplusplus */
306 
307 #endif /* PARSER_H_0211250057 */
SCEW_API void scew_parser_free(scew_parser *parser)
Frees a parser memory structure.
SCEW_API scew_parser * scew_parser_create(void)
Creates a new parser.
SCEW reader common functions.
SCEW shared library support.
SCEW tree handling routines.
struct scew_parser scew_parser
This is the type declaration of the SCEW parser.
Definition: parser.h:60
unsigned char scew_bool
This should be defined using stdbool.h when C99 is available.
Definition: bool.h:35
SCEW_API scew_tree * scew_parser_load(scew_parser *parser, scew_reader *reader)
Loads an XML tree from the specified reader.
SCEW_API void scew_parser_set_tree_hook(scew_parser *parser, scew_parser_load_hook hook, void *user_data)
Registers a hook to be called once an XML tree is successfully parsed.
SCEW_API scew_parser * scew_parser_namespace_create(XML_Char separator)
Creates a new parser with namespaces support.
scew_bool(* scew_parser_load_hook)(scew_parser *, void *, void *)
SCEW parser hooks might be used as notifications to know when XML elements or trees are parsed...
Definition: parser.h:80
SCEW_API void scew_parser_set_element_hook(scew_parser *parser, scew_parser_load_hook hook, void *user_data)
Registers a hook to be called once an XML element is successfully parsed.
SCEW_API XML_Parser scew_parser_expat(scew_parser *parser)
Returns the internal Expat parser being used by the given SCEW parser.
SCEW_API void scew_parser_ignore_whitespaces(scew_parser *parser, scew_bool ignore)
Tells the parser how to treat white spaces.
SCEW_API void scew_parser_reset(scew_parser *parser)
Resets the given parser for further uses.
struct scew_reader scew_reader
This is the type delcaration for SCEW readers.
Definition: reader.h:66
SCEW_API scew_bool scew_parser_load_stream(scew_parser *parser, scew_reader *reader)
Loads multiple XML trees from the specified stream reader.
struct scew_tree scew_tree
This is the type delcaration for XML trees.
Definition: tree.h:73
SCEW boolean type declaration.