ASN1C C# Runtime Library  7.2
Public Member Functions | List of all members
Asn1BerDecodeContext Class Reference

Public Member Functions

 Asn1BerDecodeContext (Asn1BerDecodeBuffer decodeBuffer, int elemLength)
 
virtual bool Expired ()
 
virtual bool MatchElemTag (short tagClass, short tagForm, int tagIDCode, IntHolder parsedLen, bool advance)
 
virtual bool MatchElemTag (Asn1Tag tag, IntHolder parsedLen, bool advance)
 

Detailed Description

This class is mainly for internal use by the compiler to keep track of where nested constructed elements (SEQUENCE, SET, CHOICE, etc.) begin and end.

Constructor & Destructor Documentation

◆ Asn1BerDecodeContext()

Asn1BerDecodeContext ( Asn1BerDecodeBuffer  decodeBuffer,
int  elemLength 
)

The constructor initializes all internal working varaibles.

Parameters
decodeBufferReference to current Decode buffer method.
elemLengthLength of the element being tracked.

References Asn1DecodeBuffer.ByteCount, and Diag.Prtln().

Member Function Documentation

◆ Expired()

virtual bool Expired ( )
virtual

This method will determine if a decoding context is expired. A context is defined to be the wrapper in which a set of elements or a primitive data type resides..

Returns
True if at the end of the context block

References Asn1DecodeBuffer.ByteCount, Asn1Type.EOC, Asn1Status.INDEFLEN, Asn1BerDecodeBuffer.MatchTag(), Asn1Tag.PRIM, Asn1DecodeBuffer.Reset(), and Asn1Tag.UNIV.

Referenced by Asn1BitString.Clear(), Asn1OctetString.CompareTo(), Asn1BMPString.Decode(), Asn1UniversalString.Decode(), and Asn1CharString.validate().

◆ MatchElemTag() [1/2]

virtual bool MatchElemTag ( short  tagClass,
short  tagForm,
int  tagIDCode,
IntHolder  parsedLen,
bool  advance 
)
virtual

This method will attempt to match the next element tag in a constructed type with the expected value. It will check to see if the context is expired and, if not, will match the given tag with the expected tag. The Decode cursor is advanced if the boolean advance argument is true.

Parameters
tagClassClass value of tag to match
tagFormForm value of tag to match
tagIDCodeID code of tag to match
parsedLenHolder object to receive parsed length value
advanceTrue if Decode cursor to be advanced.
Returns
True, if the tag is matched

References Asn1DecodeBuffer.ByteCount, Asn1Status.INDEFLEN, Asn1BerDecodeBuffer.MatchTag(), IntHolder.mValue, and Asn1DecodeBuffer.Reset().

◆ MatchElemTag() [2/2]

virtual bool MatchElemTag ( Asn1Tag  tag,
IntHolder  parsedLen,
bool  advance 
)
virtual

This method will attempt to match the next element tag in a constructed type with the expected value. It will check to see if the context is expired and, if not, will match the given tag with the expected tag. The Decode cursor is advanced if the boolean advance argument is true.

Parameters
tagTag object representing tag to be matched.
parsedLenHolder object to receive parsed length value
advanceTrue if Decode cursor to be advanced.
Returns
True, if the tag is matched

References Asn1Tag.mClass, Asn1Tag.mForm, and Asn1Tag.mIDCode.