exip  Alpha 0.5.4
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
include/contentHandler.h
Go to the documentation of this file.
1 /*==================================================================*\
2 | EXIP - Embeddable EXI Processor in C |
3 |--------------------------------------------------------------------|
4 | This work is licensed under BSD 3-Clause License |
5 | The full license terms and conditions are located in LICENSE.txt |
6 \===================================================================*/
7 
20 #ifndef CONTENTHANDLER_H_
21 #define CONTENTHANDLER_H_
22 
23 #include "procTypes.h"
24 
28 struct ContentHandler
29 {
30  // For handling the meta-data (document structure)
31  errorCode (*startDocument)(void* app_data);
32  errorCode (*endDocument)(void* app_data);
33  errorCode (*startElement)(QName qname, void* app_data);
34  errorCode (*endElement)(void* app_data);
35  errorCode (*attribute)(QName qname, void* app_data);
36 
37  // For handling the data
38  errorCode (*intData)(Integer int_val, void* app_data);
39  errorCode (*booleanData)(boolean bool_val, void* app_data);
40  errorCode (*stringData)(const String str_val, void* app_data);
41  errorCode (*floatData)(Float float_val, void* app_data);
42  errorCode (*binaryData)(const char* binary_val, Index nbytes, void* app_data);
43  errorCode (*dateTimeData)(EXIPDateTime dt_val, void* app_data);
44  errorCode (*decimalData)(Decimal dec_val, void* app_data);
45  errorCode (*listData)(EXITypeClass exiType, unsigned int itemCount, void* app_data);
46  errorCode (*qnameData)(const QName qname, void* app_data); // xsi:type value only
47 
48  // Miscellaneous
49  errorCode (*processingInstruction)(void* app_data); // TODO: define the parameters!
50  errorCode (*namespaceDeclaration)(const String ns, const String prefix, boolean isLocalElementNS, void* app_data);
51 
52  // For error handling
53  errorCode (*warning)(const errorCode code, const char* msg, void* app_data);
54  errorCode (*error)(const errorCode code, const char* msg, void* app_data);
55  errorCode (*fatalError)(const errorCode code, const char* msg, void* app_data);
56 
57  // EXI specific
58  errorCode (*selfContained)(void* app_data); // Used for indexing independent elements for random access
59 };
60 
62 
68 void initContentHandler(ContentHandler* handler);
69 
70 #endif /* CONTENTHANDLER_H_ */