00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00028 #ifndef _RTEXIENCODER_H_
00029 #define _RTEXIENCODER_H_
00030
00031 #include "rtexisrc/osrtexi.h"
00032
00033 #ifdef __cplusplus
00034 extern "C" {
00035 #endif
00036
00052 EXTERNEXI int rtEXIEncAttribute
00053 (OSCTXT* pctxt, const OSUTF8CHAR* prefix, const OSUTF8CHAR* namespaceURI,
00054 const OSUTF8CHAR* localName, const OSUTF8CHAR* value);
00055
00066 EXTERNEXI int rtEXIEncBinary
00067 (OSCTXT* pctxt, OSUINT32 nocts, const OSOCTET* value);
00068
00078 EXTERNEXI int rtEXIEncBoolValue (OSCTXT* pctxt, OSBOOL value);
00079
00094 EXTERNEXI int rtEXIEncBoolValueWithPattern
00095 (OSCTXT* pctxt, OSBOOL value, OSUINT8 pattern);
00096
00106 EXTERNEXI int rtEXIEncComment (OSCTXT* pctxt, const OSUTF8CHAR* data);
00107
00117 EXTERNEXI int rtEXIEncCharacters (OSCTXT* pctxt, const OSUTF8CHAR* text);
00118
00131 EXTERNEXI int rtEXIEncCharArray
00132 (OSCTXT* pctxt, const OSUTF8CHAR* text, OSUINT32 nbytes);
00133
00143 EXTERNEXI int rtEXIEncDate (OSCTXT* pctxt, const OSNumDateTime* pvalue);
00144
00160 EXTERNEXI int rtEXIEncDateString (OSCTXT* pctxt, const OSUTF8CHAR* pvalue);
00161
00171 EXTERNEXI int rtEXIEncDateTime (OSCTXT* pctxt, const OSNumDateTime* pvalue);
00172
00191 EXTERNEXI int rtEXIEncDateTimeString
00192 (OSCTXT* pctxt, const OSUTF8CHAR* pvalue);
00193
00203 EXTERNEXI int rtEXIEncDecimalValue (OSCTXT* pctxt, OSREAL value);
00204
00214 EXTERNEXI int rtEXIEncDoubleValue (OSCTXT* pctxt, OSREAL value);
00215
00228 EXTERNEXI int rtEXIEncDTD
00229 (OSCTXT* pctxt, const OSUTF8CHAR* name, const OSUTF8CHAR* publix,
00230 const OSUTF8CHAR* system, const OSUTF8CHAR* text);
00231
00244 EXTERNEXI int rtEXIEncElemGrammarEvent (OSCTXT* pctxt, OSUINT16 eventId);
00245
00257 EXTERNEXI int rtEXIEncElemGrammarEE (OSCTXT* pctxt);
00258
00267 EXTERNEXI int rtEXIEncEndDocument (OSCTXT* pctxt);
00268
00277 EXTERNEXI int rtEXIEncEndElement (OSCTXT* pctxt);
00278
00287 EXTERNEXI int rtEXIEncEndEvent (OSCTXT* pctxt);
00288
00298 EXTERNEXI int rtEXIEncEntityRef (OSCTXT* pctxt, const OSUTF8CHAR* name);
00299
00315 EXTERNEXI int rtEXIEncEventCode
00316 (OSCTXT* pctxt, const char* name,
00317 OSINT32 part1, OSINT32 part2, OSINT32 part3,
00318 OSUINT32 nbits1, OSUINT32 nbits2, OSUINT32 nbits3);
00319
00320 #define rtEXIEncEventCode1(pctxt,name,part1,nbits1) \
00321 rtEXIEncEventCode (pctxt, name, part1, -1, -1, nbits1, 0, 0)
00322
00323 #define rtEXIEncEventCode2(pctxt,name,part1,part2,nbits1,nbits2) \
00324 rtEXIEncEventCode (pctxt, name, part1, part2, -1, nbits1, nbits2, 0)
00325
00335 EXTERNEXI int rtEXIEncGDay (OSCTXT* pctxt, const OSNumDateTime* pvalue);
00336
00349 EXTERNEXI int rtEXIEncGDayString (OSCTXT* pctxt, const OSUTF8CHAR* pvalue);
00350
00360 EXTERNEXI int rtEXIEncGMonth (OSCTXT* pctxt, const OSNumDateTime* pvalue);
00361
00371 EXTERNEXI int rtEXIEncGMonthDay (OSCTXT* pctxt, const OSNumDateTime* pvalue);
00372
00387 EXTERNEXI int rtEXIEncGMonthDayString
00388 (OSCTXT* pctxt, const OSUTF8CHAR* pvalue);
00389
00402 EXTERNEXI int rtEXIEncGMonthString (OSCTXT* pctxt, const OSUTF8CHAR* pvalue);
00403
00413 EXTERNEXI int rtEXIEncGYear (OSCTXT* pctxt, const OSNumDateTime* pvalue);
00414
00424 EXTERNEXI int rtEXIEncGYearMonth (OSCTXT* pctxt, const OSNumDateTime* pvalue);
00425
00439 EXTERNEXI int rtEXIEncGYearMonthString
00440 (OSCTXT* pctxt, const OSUTF8CHAR* pvalue);
00441
00454 EXTERNEXI int rtEXIEncGYearString (OSCTXT* pctxt, const OSUTF8CHAR* pvalue);
00455
00467 EXTERNEXI int rtEXIEncHeader (OSCTXT* pctxt);
00468
00479 EXTERNEXI int rtEXIEncInitCompression (OSCTXT* pctxt, OSUINT32 nmChannelIds);
00480
00490 EXTERNEXI int rtEXIEncInt64Value (OSCTXT* pctxt, OSINT64 value);
00491
00502 EXTERNEXI int rtEXIEncIntCHEvent (OSCTXT* pctxt, OSINT32 value);
00503
00517 EXTERNEXI int rtEXIEncIntElem
00518 (OSCTXT* pctxt, OSINT32 value,
00519 const OSUTF8CHAR* elemName, OSXMLNamespace* pNS);
00520
00530 EXTERNEXI int rtEXIEncIntValue (OSCTXT* pctxt, OSINT32 value);
00531
00543 EXTERNEXI int rtEXIEncNBitUIntValue
00544 (OSCTXT* pctxt, OSUINT32 value, OSUINT32 nbits);
00545
00559 EXTERNEXI int rtEXIEncNamespace
00560 (OSCTXT* pctxt, const OSUTF8CHAR* prefix, const OSUTF8CHAR* namespaceURI,
00561 OSBOOL indicator);
00562
00572 EXTERNEXI int rtEXIEncoderInit (OSCTXT* pctxt);
00573
00584 EXTERNEXI int rtEXIEncProcessingInstruction
00585 (OSCTXT* pctxt, const OSUTF8CHAR* target, const OSUTF8CHAR* data);
00586
00598 EXTERNEXI int rtEXIEncQNameValue
00599 (OSCTXT* pctxt, const OSXMLFullQName* pvalue, const OSXMLFullQName* pqname);
00600
00612 EXTERNEXI int rtEXIEncSimpleTypeEvent
00613 (OSCTXT* pctxt, const char* name, OSINT32 part1, OSBOOL hasXsiAttrs);
00614
00624 EXTERNEXI int rtEXIEncStartDocument (OSCTXT* pctxt);
00625
00639 EXTERNEXI int rtEXIEncStartElement
00640 (OSCTXT* pctxt, const OSUTF8CHAR* elemName, OSXMLNamespace* pNS);
00641
00656 EXTERNEXI int rtEXIEncString
00657 (OSCTXT* pctxt, const OSUTF8CHAR* value, const OSXMLFullQName* pqname,
00658 const OSUINT16* charSet);
00659
00675 EXTERNEXI int rtEXIEncString2
00676 (OSCTXT* pctxt, const OSUTF8CHAR* value,
00677 const OSUTF8CHAR* elemName, struct OSXMLNamespace* pNS,
00678 const OSUINT16* charSet);
00679
00689 EXTERNEXI int rtEXIEncTime (OSCTXT* pctxt, const OSNumDateTime* pvalue);
00690
00705 EXTERNEXI int rtEXIEncTimeString (OSCTXT* pctxt, const OSUTF8CHAR* pvalue);
00706
00716 EXTERNEXI int rtEXIEncUInt64Value (OSCTXT* pctxt, OSUINT64 value);
00717
00728 EXTERNEXI int rtEXIEncUIntCHEvent (OSCTXT* pctxt, OSUINT32 value);
00729
00743 EXTERNEXI int rtEXIEncUIntElem
00744 (OSCTXT* pctxt, OSUINT32 value,
00745 const OSUTF8CHAR* elemName, OSXMLNamespace* pNS);
00746
00756 EXTERNEXI int rtEXIEncUIntValue (OSCTXT* pctxt, OSUINT32 value);
00757
00774 EXTERNEXI int rtEXIEncUTF8Str
00775 (OSCTXT* pctxt, const OSUTF8CHAR* value, size_t lengthIncr,
00776 const OSUINT16* charSet);
00777
00778 #define RTEXIENCCHEVENT(pctxt,encfunc,value,stat) \
00779 stat = rtEXIEncEventCode1 (pctxt, "CH", 0, 1); \
00780 if (0 == stat) stat = encfunc (pctxt, value);
00781
00782 #define RTEXIENC_CH_DATA_EE_0_1(pctxt,encfunc,value,stat) \
00783 stat = rtEXIEncEventCode1 (pctxt, "CH", 0, 1); \
00784 if (0 == stat) stat = encfunc (pctxt, value); \
00785 if (0 == stat) stat = rtEXIEncEventCode1 (pctxt, "EE", 0, 1);
00786
00787 #define RTEXIENC_CH_STR_EE_0_1(pctxt,value,pqname,charSet,stat) \
00788 stat = rtEXIEncEventCode1 (pctxt, "CH", 0, 1); \
00789 if (0 == stat) stat = rtEXIEncString (pctxt, value, pqname, charSet); \
00790 if (0 == stat) stat = rtEXIEncEventCode1 (pctxt, "EE", 0, 1);
00791
00792 #define RTEXIENC_CH_NBIT_EE_0_1(pctxt,value,nbits,stat) \
00793 stat = rtEXIEncEventCode1 (pctxt, "CH", 0, 1); \
00794 if (0 == stat) stat = rtEXIEncNBitUIntValue (pctxt, value, nbits); \
00795 if (0 == stat) stat = rtEXIEncEventCode1 (pctxt, "EE", 0, 1);
00796
00797 #define RTEXIENC_CH_BINARY_EE_0_1(pctxt,encfunc,len,value,stat) \
00798 stat = rtEXIEncEventCode1 (pctxt, "CH", 0, 1); \
00799 if (0 == stat) stat = encfunc (pctxt, len, value); \
00800 if (0 == stat) stat = rtEXIEncEventCode1 (pctxt, "EE", 0, 1);
00801
00802 #ifdef __cplusplus
00803 }
00804 #endif
00805
00806 #endif
00807