|
exip
Alpha 0.5.4
|
Implementation of the serializer of EXI streams. More...
#include "EXISerializer.h"#include "grammars.h"#include "memManagement.h"#include "sTables.h"#include "headerEncode.h"#include "bodyEncode.h"#include "hashtable.h"#include "stringManipulate.h"#include "streamEncode.h"#include "initSchemaInstance.h"#include "ioUtil.h"Go to the source code of this file.
Functions | |
| void | initHeader (EXIStream *strm) |
| Initialize the header of an EXI stream object. More... | |
| errorCode | initStream (EXIStream *strm, BinaryBuffer buffer, EXIPSchema *schema) |
| Initialize EXI stream object. More... | |
| errorCode | startDocument (EXIStream *strm) |
| Indicates the start of the EXI body serialization. More... | |
| errorCode | endDocument (EXIStream *strm) |
| Indicates the end of the EXI body serialization. More... | |
| errorCode | startElement (EXIStream *strm, QName qname, EXITypeClass *valueType) |
| Encodes start of an element with qualified name qname. More... | |
| errorCode | endElement (EXIStream *strm) |
| Encodes the end of the last element. More... | |
| errorCode | attribute (EXIStream *strm, QName qname, boolean isSchemaType, EXITypeClass *valueType) |
| Encodes a start of an attribute with qualified name qname Note that the attributes within an element must be encoded lexicographically sorted when in schema mode. More... | |
| errorCode | intData (EXIStream *strm, Integer int_val) |
| Encodes integer data for element or attribute. More... | |
| errorCode | booleanData (EXIStream *strm, boolean bool_val) |
| Encodes boolean data for element or attribute. More... | |
| errorCode | stringData (EXIStream *strm, const String str_val) |
| Encodes string data for element or attribute. More... | |
| errorCode | floatData (EXIStream *strm, Float float_val) |
| Encodes float data for element or attribute. More... | |
| errorCode | binaryData (EXIStream *strm, const char *binary_val, Index nbytes) |
| Encodes binary data for element or attribute. More... | |
| errorCode | dateTimeData (EXIStream *strm, EXIPDateTime dt_val) |
| Encodes dateTime data for element or attribute. More... | |
| errorCode | decimalData (EXIStream *strm, Decimal dec_val) |
| Encodes decimal data for element or attribute. More... | |
| errorCode | listData (EXIStream *strm, unsigned int itemCount) |
| Encodes list data for element or attribute. More... | |
| errorCode | qnameData (EXIStream *strm, QName qname) |
| This function is only used to encode the value of xsi:type attribute. More... | |
| errorCode | processingInstruction (EXIStream *strm) |
| Encode a processing instruction. More... | |
| errorCode | namespaceDeclaration (EXIStream *strm, const String ns, const String prefix, boolean isLocalElementNS) |
| Encode a namespace declaration when Preserve.prefixes == TRUE. More... | |
| errorCode | selfContained (EXIStream *strm) |
| Encode a self Contained event used for indexing independent elements for random access. More... | |
| errorCode | closeEXIStream (EXIStream *strm) |
| Destroy an EXI stream object releasing all the allocated memory for it. More... | |
| errorCode | flushEXIData (EXIStream *strm, char *outBuf, unsigned int bufSize, unsigned int *bytesFlush) |
| In case the EXI buffer (strm->buffer) is filled this function can be used to flush it to some external buffer when strm->buffer.ioStrm.readWriteToStream is not available. More... | |
| errorCode | serializeEvent (EXIStream *strm, EventCode ec, QName *qname) |
| To be used by code generation tools such as static XML bindings and when efficiency is of high importance. More... | |
Variables | |
| const EXISerializer | serialize |
| The handler to be used by the applications to serialize EXI streams. More... | |
Definition in file EXISerializer.c.
| errorCode attribute | ( | EXIStream * | strm, |
| QName | qname, | ||
| boolean | isSchemaType, | ||
| EXITypeClass * | valueType | ||
| ) |
Sorting is done first by local name and then by namespace.
| [in,out] | strm | EXI stream object |
| [in] | qname | qualified name of the attribute |
| [in] | isSchemaType | for schema mode, define if the value of the attribute is conforming to the type defined in the schema for that attribute. If in schemaless it should be TRUE; |
| [out] | valueType | In case of a schema mode and isSchemaType == TRUE - the EXI type class of the attribute. It should be used to determine which function for data handling to be used for its content. Otherwise - VALUE_TYPE_NONE_CLASS |
Definition at line 383 of file EXISerializer.c.
| [in,out] | strm | EXI stream object |
| [in] | binary_val | value to be encoded |
| [in] | nbytes | number of bytes in binary_val |
Definition at line 702 of file EXISerializer.c.
| [in,out] | strm | EXI stream object |
| [in] | bool_val | value to be encoded |
Definition at line 514 of file EXISerializer.c.
| [in,out] | strm | EXI stream object |
Definition at line 1029 of file EXISerializer.c.
| errorCode dateTimeData | ( | EXIStream * | strm, |
| EXIPDateTime | dt_val | ||
| ) |
| [in,out] | strm | EXI stream object |
| [in] | dt_val | value to be encoded |
Definition at line 734 of file EXISerializer.c.
| [in,out] | strm | EXI stream object |
| [in] | dec_val | value to be encoded |
BEGIN type validation
END type validation
Definition at line 799 of file EXISerializer.c.
| [in,out] | strm | EXI stream object |
Definition at line 227 of file EXISerializer.c.
| [in,out] | strm | EXI stream object |
Definition at line 354 of file EXISerializer.c.
| [in,out] | strm | EXI stream object |
| [in] | float_val | value to be encoded |
Definition at line 641 of file EXISerializer.c.
| errorCode flushEXIData | ( | EXIStream * | strm, |
| char * | outBuf, | ||
| unsigned int | bufSize, | ||
| unsigned int * | bytesFlush | ||
| ) |
This is useful when streaming EXI data, for example, which needs to be implemented without a blocking call to the flushing interface i.e. strm->buffer.ioStrm.readWriteToStream.
| [in,out] | strm | EXI stream object |
| [out] | outBuf | the next EXI stream chunk to be parsed |
| [in] | bufSize | the size in bytes of the inBuf |
| [out] | bytesFlush | bytes written to the outBuf |
Definition at line 1049 of file EXISerializer.c.
| void initHeader | ( | EXIStream * | strm) |
| [in,out] | strm | EXI stream object |
Definition at line 66 of file EXISerializer.c.
| errorCode initStream | ( | EXIStream * | strm, |
| BinaryBuffer | buffer, | ||
| EXIPSchema * | schema | ||
| ) |
| [in,out] | strm | EXI stream |
| [in,out] | buffer | output buffer for storing the encoded EXI stream |
| [in] | schema | a compiled schema information to be used for schema enabled processing, NULL if no schema is available |
Definition at line 75 of file EXISerializer.c.
| [in,out] | strm | EXI stream object |
| [in] | int_val | value to be encoded |
Definition at line 482 of file EXISerializer.c.
| [in,out] | strm | EXI stream object |
| [in] | itemCount | the number of list items to be encoded |
Definition at line 897 of file EXISerializer.c.
| errorCode namespaceDeclaration | ( | EXIStream * | strm, |
| const String | ns, | ||
| const String | prefix, | ||
| boolean | isLocalElementNS | ||
| ) |
| [in,out] | strm | EXI stream object |
| [in] | ns | the namespace to be encoded |
| [in] | prefix | the prefix of the namespace to be encoded |
| [in] | isLocalElementNS | TRUE if this is the namespace locally defined for the element that contains it (see local-element-ns flag in the EXI spec) |
Definition at line 968 of file EXISerializer.c.
| [in,out] | strm | EXI stream object |
Definition at line 963 of file EXISerializer.c.
| [in,out] | strm | EXI stream object |
| [in] | qname | the qname to be encoded |
Definition at line 926 of file EXISerializer.c.
| [in,out] | strm | EXI stream object |
Definition at line 1024 of file EXISerializer.c.
| [in,out] | strm | EXI stream |
| [in] | ec | EXI event code of the production |
| [in] | qname | used only for SE(*), AT(*), SE(uri:*), AT(uri:*) and when a new prefix should be serialized in SE(QName) and AT(QName); NULL otherwise |
Definition at line 1069 of file EXISerializer.c.
| [in,out] | strm | EXI stream object |
Definition at line 217 of file EXISerializer.c.
| errorCode startElement | ( | EXIStream * | strm, |
| QName | qname, | ||
| EXITypeClass * | valueType | ||
| ) |
| [in,out] | strm | EXI stream object |
| [in] | qname | qualified name of the element |
| [out] | valueType | In case of a simple type element - the EXI type class of the element. It should be used to determine which function for data handling to be used for its content. If complex type - VALUE_TYPE_NONE_CLASS |
Definition at line 244 of file EXISerializer.c.
| [in,out] | strm | EXI stream object |
| [in] | str_val | value to be encoded |
Definition at line 588 of file EXISerializer.c.
| const EXISerializer serialize |
Used during serialization for easy access to the EXIP serialization API.
Definition at line 34 of file EXISerializer.c.
1.8.4