00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00043 #ifndef _ASN1CPPEVTHNDLR_H_
00044 #define _ASN1CPPEVTHNDLR_H_
00045
00046 #include "rtsrc/asn1type.h"
00047
00048 #ifndef OS_UNUSED_ARG
00049
00055 #define OS_UNUSED_ARG(arg) (void)arg
00056 #endif
00057
00058
00059
00067 class EXTRTCLASS Asn1NamedEventHandler {
00068 public:
00069 Asn1NamedEventHandler() {}
00070 virtual ~Asn1NamedEventHandler() {}
00071
00072
00073
00074
00090 virtual void startElement (const char* name, int index) = 0;
00091
00092
00093
00110 virtual void endElement (const char* name, int index) = 0;
00111
00112
00113
00114
00115
00123 virtual void boolValue (OSBOOL value) { OS_UNUSED_ARG(value); }
00124
00132 virtual void intValue (OSINT32 value) { OS_UNUSED_ARG(value); }
00133
00144 virtual void uIntValue (OSUINT32 value) { OS_UNUSED_ARG(value); }
00145
00153 virtual void int64Value (OSINT64 value) {
00154 intValue ((OSINT32)value);
00155 }
00156
00164 virtual void uInt64Value (OSUINT64 value) {
00165 uIntValue ((OSUINT32)value);
00166 }
00167
00177 virtual void bitStrValue (OSUINT32 numbits, const OSOCTET* data) {
00178 OS_UNUSED_ARG(numbits); OS_UNUSED_ARG(data);
00179 }
00180
00190 virtual void octStrValue (OSUINT32 numocts, const OSOCTET* data) {
00191 OS_UNUSED_ARG(numocts); OS_UNUSED_ARG(data);
00192 }
00193
00201 virtual void charStrValue (const char* value) { OS_UNUSED_ARG(value); }
00202
00211 virtual void charStrValue (OSUINT32 nchars, const OSUTF8CHAR* value) {
00212 OS_UNUSED_ARG(nchars); OS_UNUSED_ARG(value);
00213 }
00214
00227 virtual void charStrValue (OSUINT32 nchars, OSUNICHAR* data) {
00228 OS_UNUSED_ARG(nchars); OS_UNUSED_ARG(data);
00229 }
00230
00242 virtual void charStrValue (OSUINT32 nchars, OS32BITCHAR* data) {
00243 OS_UNUSED_ARG(nchars); OS_UNUSED_ARG(data);
00244 }
00245
00253 virtual void nullValue () {}
00254
00263 virtual void oidValue (OSUINT32 numSubIds, OSUINT32* pSubIds) {
00264 OS_UNUSED_ARG(numSubIds); OS_UNUSED_ARG(pSubIds);
00265 }
00266
00274 virtual void realValue (double value) { OS_UNUSED_ARG(value); }
00275
00284 virtual void enumValue (OSUINT32 value, const OSUTF8CHAR* text) {
00285 OS_UNUSED_ARG(value); OS_UNUSED_ARG(text);
00286 }
00287
00297 virtual void openTypeValue (OSUINT32 numocts, const OSOCTET* data) {
00298 OS_UNUSED_ARG(numocts); OS_UNUSED_ARG(data);
00299 }
00300
00301
00302
00303
00311 EXTRTMETHOD static void addEventHandler
00312 (OSCTXT* pCtxt, Asn1NamedEventHandler* pHandler);
00313
00314
00315
00316
00317
00326 EXTRTMETHOD static void removeEventHandler
00327 (OSCTXT* pCtxt, Asn1NamedEventHandler* pHandler);
00328
00329
00330
00331
00341 EXTRTMETHOD static void invokeStartElement
00342 (OSCTXT* pCtxt, const char* name, int index);
00343
00353 EXTRTMETHOD static void invokeEndElement
00354 (OSCTXT* pCtxt, const char* name, int index);
00355
00363 EXTRTMETHOD static void invokeBoolValue (OSCTXT* pCtxt, OSBOOL value);
00364
00372 EXTRTMETHOD static void invokeIntValue (OSCTXT* pCtxt, OSINT32 value);
00373
00381 EXTRTMETHOD static void invokeUIntValue (OSCTXT* pCtxt, OSUINT32 value);
00382
00390 EXTRTMETHOD static void invokeInt64Value (OSCTXT* pCtxt, OSINT64 value);
00391
00399 EXTRTMETHOD static void invokeUInt64Value (OSCTXT* pCtxt, OSUINT64 value);
00400
00409 EXTRTMETHOD static void invokeBitStrValue
00410 (OSCTXT* pCtxt, OSUINT32 numbits, const OSOCTET* data);
00411
00420 EXTRTMETHOD static void invokeOctStrValue
00421 (OSCTXT* pCtxt, OSUINT32 numocts, const OSOCTET* data);
00422
00430 EXTRTMETHOD static void invokeCharStrValue
00431 (OSCTXT* pCtxt, const char* value);
00432
00441 EXTRTMETHOD static void invokeCharStrValue
00442 (OSCTXT* pCtxt, OSUINT32 nchars, OSUNICHAR* data);
00443
00452 EXTRTMETHOD static void invokeCharStrValue
00453 (OSCTXT* pCtxt, OSUINT32 nchars, OS32BITCHAR* data);
00454
00463 EXTRTMETHOD static void invokeCharStrValue
00464 (OSCTXT* pCtxt, OSUINT32 nchars, const OSUTF8CHAR* data);
00465
00472 EXTRTMETHOD static void invokeNullValue (OSCTXT* pCtxt);
00473
00482 EXTRTMETHOD static void invokeOidValue
00483 (OSCTXT* pCtxt, OSUINT32 numSubIds, OSUINT32* pSubIds);
00484
00492 EXTRTMETHOD static void invokeRealValue (OSCTXT* pCtxt, double value);
00493
00502 EXTRTMETHOD static void invokeEnumValue
00503 (OSCTXT* pCtxt, OSUINT32 value, const OSUTF8CHAR* text);
00504
00513 EXTRTMETHOD static void invokeOpenTypeValue
00514 (OSCTXT* pCtxt, OSUINT32 numocts, const OSOCTET* data);
00515
00516 } ;
00517
00518
00519
00520
00525 class EXTRTCLASS Asn1NullEventHandler : public Asn1NamedEventHandler {
00526 public:
00528 virtual void startElement (const char* , int ) {}
00530 virtual void endElement (const char* , int ) {}
00531 } ;
00532
00533
00534
00535
00537 class EXTRTCLASS ASN1MessageBuffer ;
00538
00547 class EXTRTCLASS Asn1ErrorHandler {
00548 public:
00549 Asn1ErrorHandler() {}
00550 virtual ~Asn1ErrorHandler() {}
00551
00563 virtual int error (OSCTXT* pCtxt, ASN1CCB* pCCB, int stat) = 0;
00564
00565
00566
00567
00568 EXTRTMETHOD static int invoke (OSCTXT* pCtxt, ASN1CCB* pCCB, int stat);
00569
00570
00571
00572
00573 EXTRTMETHOD static int invoke
00574 (OSCTXT* pCtxt, OSOCTET* ptr, int len, int stat);
00575
00586 EXTRTMETHOD static void setErrorHandler
00587 (OSCTXT* pCtxt, Asn1ErrorHandler* pHandler);
00588
00589 } ;
00593 #endif