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 #define OS_UNUSED_ARG(arg) (void)arg
00050 #endif
00051
00052
00053
00061 class EXTRTCLASS Asn1NamedEventHandler {
00062 public:
00063 Asn1NamedEventHandler() {}
00064 virtual ~Asn1NamedEventHandler() {}
00065
00066
00067
00068
00084 virtual void startElement (const char* name, int index) = 0;
00085
00086
00087
00104 virtual void endElement (const char* name, int index) = 0;
00105
00106
00107
00108
00109
00117 virtual void boolValue (OSBOOL value) { OS_UNUSED_ARG(value); }
00118
00126 virtual void intValue (OSINT32 value) { OS_UNUSED_ARG(value); }
00127
00138 virtual void uIntValue (OSUINT32 value) { OS_UNUSED_ARG(value); }
00139
00147 virtual void int64Value (OSINT64 value) {
00148 intValue ((OSINT32)value);
00149 }
00150
00158 virtual void uInt64Value (OSUINT64 value) {
00159 uIntValue ((OSUINT32)value);
00160 }
00161
00171 virtual void bitStrValue (OSUINT32 numbits, const OSOCTET* data) {
00172 OS_UNUSED_ARG(numbits); OS_UNUSED_ARG(data);
00173 }
00174
00184 virtual void octStrValue (OSUINT32 numocts, const OSOCTET* data) {
00185 OS_UNUSED_ARG(numocts); OS_UNUSED_ARG(data);
00186 }
00187
00195 virtual void charStrValue (const char* value) { OS_UNUSED_ARG(value); }
00196
00205 virtual void charStrValue (OSUINT32 nchars, const OSUTF8CHAR* value) {
00206 OS_UNUSED_ARG(nchars); OS_UNUSED_ARG(value);
00207 }
00208
00221 virtual void charStrValue (OSUINT32 nchars, OSUNICHAR* data) {
00222 OS_UNUSED_ARG(nchars); OS_UNUSED_ARG(data);
00223 }
00224
00236 virtual void charStrValue (OSUINT32 nchars, OS32BITCHAR* data) {
00237 OS_UNUSED_ARG(nchars); OS_UNUSED_ARG(data);
00238 }
00239
00247 virtual void nullValue () {}
00248
00257 virtual void oidValue (OSUINT32 numSubIds, OSUINT32* pSubIds) {
00258 OS_UNUSED_ARG(numSubIds); OS_UNUSED_ARG(pSubIds);
00259 }
00260
00268 virtual void realValue (double value) { OS_UNUSED_ARG(value); }
00269
00278 virtual void enumValue (OSUINT32 value, const OSUTF8CHAR* text) {
00279 OS_UNUSED_ARG(value); OS_UNUSED_ARG(text);
00280 }
00281
00291 virtual void openTypeValue (OSUINT32 numocts, const OSOCTET* data) {
00292 OS_UNUSED_ARG(numocts); OS_UNUSED_ARG(data);
00293 }
00294
00295
00296
00297
00298 EXTRTMETHOD static void addEventHandler
00299 (OSCTXT* pCtxt, Asn1NamedEventHandler* pHandler);
00300
00301
00302
00303
00304
00305 EXTRTMETHOD static void removeEventHandler
00306 (OSCTXT* pCtxt, Asn1NamedEventHandler* pHandler);
00307
00308
00309
00310
00311 EXTRTMETHOD static void invokeStartElement
00312 (OSCTXT* pCtxt, const char* name, int index);
00313
00314 EXTRTMETHOD static void invokeEndElement
00315 (OSCTXT* pCtxt, const char* name, int index);
00316
00317 EXTRTMETHOD static void invokeBoolValue (OSCTXT* pCtxt, OSBOOL value);
00318 EXTRTMETHOD static void invokeIntValue (OSCTXT* pCtxt, OSINT32 value);
00319 EXTRTMETHOD static void invokeUIntValue (OSCTXT* pCtxt, OSUINT32 value);
00320 EXTRTMETHOD static void invokeInt64Value (OSCTXT* pCtxt, OSINT64 value);
00321 EXTRTMETHOD static void invokeUInt64Value (OSCTXT* pCtxt, OSUINT64 value);
00322 EXTRTMETHOD static void invokeBitStrValue
00323 (OSCTXT* pCtxt, OSUINT32 numbits, const OSOCTET* data);
00324 EXTRTMETHOD static void invokeOctStrValue
00325 (OSCTXT* pCtxt, OSUINT32 numocts, const OSOCTET* data);
00326 EXTRTMETHOD static void invokeCharStrValue
00327 (OSCTXT* pCtxt, const char* value);
00328 EXTRTMETHOD static void invokeCharStrValue
00329 (OSCTXT* pCtxt, OSUINT32 nchars, OSUNICHAR* data);
00330 EXTRTMETHOD static void invokeCharStrValue
00331 (OSCTXT* pCtxt, OSUINT32 nchars, OS32BITCHAR* data);
00332 EXTRTMETHOD static void invokeCharStrValue
00333 (OSCTXT* pCtxt, OSUINT32 nchars, const OSUTF8CHAR* data);
00334 EXTRTMETHOD static void invokeNullValue (OSCTXT* pCtxt);
00335 EXTRTMETHOD static void invokeOidValue
00336 (OSCTXT* pCtxt, OSUINT32 numSubIds, OSUINT32* pSubIds);
00337 EXTRTMETHOD static void invokeRealValue (OSCTXT* pCtxt, double value);
00338 EXTRTMETHOD static void invokeEnumValue
00339 (OSCTXT* pCtxt, OSUINT32 value, const OSUTF8CHAR* text);
00340 EXTRTMETHOD static void invokeOpenTypeValue
00341 (OSCTXT* pCtxt, OSUINT32 numocts, const OSOCTET* data);
00342
00343 } ;
00344
00345
00346
00347
00348 class EXTRTCLASS Asn1NullEventHandler : public Asn1NamedEventHandler {
00349 public:
00350 virtual void startElement (const char* , int ) {}
00351 virtual void endElement (const char* , int ) {}
00352 } ;
00353
00354
00355
00356
00357 class EXTRTCLASS ASN1MessageBuffer ;
00358
00367 class EXTRTCLASS Asn1ErrorHandler {
00368 public:
00369 Asn1ErrorHandler() {}
00370 virtual ~Asn1ErrorHandler() {}
00371
00383 virtual int error (OSCTXT* pCtxt, ASN1CCB* pCCB, int stat) = 0;
00384
00385
00386
00387
00388 EXTRTMETHOD static int invoke (OSCTXT* pCtxt, ASN1CCB* pCCB, int stat);
00389
00390
00391
00392
00393 EXTRTMETHOD static int invoke
00394 (OSCTXT* pCtxt, OSOCTET* ptr, int len, int stat);
00395
00406 EXTRTMETHOD static void setErrorHandler
00407 (OSCTXT* pCtxt, Asn1ErrorHandler* pHandler);
00408
00409 } ;
00413 #endif