exip
Alpha 0.5.4
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
bin
headers
bin/headers/EXISerializer.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
19
#ifndef EXISERIALIZER_H_
20
#define EXISERIALIZER_H_
21
22
#include "
procTypes.h
"
23
24
struct
EXISerializer
25
{
26
// For handling the meta-data (document structure)
27
errorCode
(*
startDocument
)(
EXIStream
* strm);
28
errorCode
(*
endDocument
)(
EXIStream
* strm);
29
errorCode
(*
startElement
)(
EXIStream
* strm,
QName
qname,
EXITypeClass
* valueType);
30
errorCode
(*
endElement
)(
EXIStream
* strm);
31
errorCode
(*
attribute
)(
EXIStream
* strm,
QName
qname,
boolean
isSchemaType,
EXITypeClass
* valueType);
32
33
// For handling the data
34
errorCode
(*
intData
)(
EXIStream
* strm,
Integer
int_val);
35
errorCode
(*
booleanData
)(
EXIStream
* strm,
boolean
bool_val);
36
errorCode
(*
stringData
)(
EXIStream
* strm,
const
String
str_val);
37
errorCode
(*
floatData
)(
EXIStream
* strm,
Float
float_val);
38
errorCode
(*
binaryData
)(
EXIStream
* strm,
const
char
* binary_val,
Index
nbytes);
39
errorCode
(*
dateTimeData
)(
EXIStream
* strm,
EXIPDateTime
dt_val);
40
errorCode
(*
decimalData
)(
EXIStream
* strm,
Decimal
dec_val);
41
errorCode
(*
listData
)(
EXIStream
* strm,
unsigned
int
itemCount);
42
errorCode
(*
qnameData
)(
EXIStream
* strm,
QName
qname);
// xsi:type value only
43
44
// Miscellaneous
45
errorCode
(*
processingInstruction
)(
EXIStream
* strm);
// TODO: define the parameters!
46
errorCode
(*
namespaceDeclaration
)(
EXIStream
* strm,
const
String
ns,
const
String
prefix,
boolean
isLocalElementNS);
47
48
// EXI specific
49
errorCode
(*
exiHeader
)(
EXIStream
* strm);
50
errorCode
(*
selfContained
)(
EXIStream
* strm);
// Used for indexing independent elements for random access
51
52
// EXIP specific
53
void (*
initHeader
)(
EXIStream
* strm);
54
errorCode
(*
initStream
)(
EXIStream
* strm,
BinaryBuffer
buffer,
EXIPSchema
* schema);
55
errorCode
(*
closeEXIStream
)(
EXIStream
* strm);
56
errorCode
(*
flushEXIData
)(
EXIStream
* strm,
char
* outBuf,
unsigned
int
bufSize,
unsigned
int
* bytesFlush);
57
};
58
59
typedef
struct
EXISerializer
EXISerializer
;
60
64
extern
const
EXISerializer
serialize
;
65
66
/**** START: Serializer API declarations ****/
67
68
// For handling the meta-data (document structure)
69
76
errorCode
startDocument
(
EXIStream
* strm);
77
84
errorCode
endDocument
(
EXIStream
* strm);
85
96
errorCode
startElement
(
EXIStream
* strm,
QName
qname,
EXITypeClass
* valueType);
97
104
errorCode
endElement
(
EXIStream
* strm);
105
106
107
123
errorCode
attribute
(
EXIStream
* strm,
QName
qname,
boolean
isSchemaType,
EXITypeClass
* valueType);
124
125
// For handling the data
126
135
errorCode
intData
(
EXIStream
* strm,
Integer
int_val);
136
145
errorCode
booleanData
(
EXIStream
* strm,
boolean
bool_val);
146
154
errorCode
stringData
(
EXIStream
* strm,
const
String
str_val);
155
164
errorCode
floatData
(
EXIStream
* strm,
Float
float_val);
165
175
errorCode
binaryData
(
EXIStream
* strm,
const
char
* binary_val,
Index
nbytes);
176
185
errorCode
dateTimeData
(
EXIStream
* strm,
EXIPDateTime
dt_val);
186
195
errorCode
decimalData
(
EXIStream
* strm,
Decimal
dec_val);
196
205
errorCode
listData
(
EXIStream
* strm,
unsigned
int
itemCount);
206
214
errorCode
qnameData
(
EXIStream
* strm,
QName
qname);
215
216
// Miscellaneous
217
225
errorCode
processingInstruction
(
EXIStream
* strm);
226
237
errorCode
namespaceDeclaration
(
EXIStream
* strm,
const
String
ns,
const
String
prefix,
boolean
isLocalElementNS);
238
239
// EXI specific
240
248
errorCode
selfContained
(
EXIStream
* strm);
249
250
// EXIP specific
251
258
void
initHeader
(
EXIStream
* strm);
259
268
errorCode
initStream
(
EXIStream
* strm,
BinaryBuffer
buffer,
EXIPSchema
*schema);
269
276
errorCode
closeEXIStream
(
EXIStream
* strm);
277
310
errorCode
flushEXIData
(
EXIStream
* strm,
char
* outBuf,
unsigned
int
bufSize,
unsigned
int
* bytesFlush);
311
312
/**** END: Serializer API implementation ****/
313
314
315
/**** START: Fast, low level API for schema encoding only ****/
316
327
errorCode
serializeEvent
(
EXIStream
* strm,
EventCode
ec,
QName
* qname);
328
329
/**** END: Fast, low level API for schema encoding only ****/
330
331
#endif
/* EXISERIALIZER_H_ */
Generated on Thu Nov 27 2014 10:56:08 for exip by
1.8.4