ASN1C C# Runtime Library  7.2
Public Member Functions | Properties | List of all members
Asn1XerEncodeBuffer Class Reference
Inheritance diagram for Asn1XerEncodeBuffer:
Asn1XerEncoder Asn1XmlXerEncoder

Public Member Functions

 Asn1XerEncodeBuffer ()
 
 Asn1XerEncodeBuffer (bool canonical)
 
 Asn1XerEncodeBuffer (bool canonical, int sizeIncrement)
 
override void BinDump (System.IO.StreamWriter outs, System.String varName)
 
virtual void Copy (System.String data)
 
virtual void DecrLevel ()
 
virtual void EncodeBinStrValue (byte[] bits, int nbits)
 
virtual void EncodeByte (byte data)
 
virtual void EncodeData (System.String data)
 
virtual void EncodeEmptyElement (System.String elemName)
 
virtual void EncodeEndDocument ()
 
virtual void EncodeEndElement (System.String elemName)
 
virtual void EncodeHexStrValue (byte[] data)
 
virtual void EncodeNamedValue (System.String valueName, System.String elemName)
 
virtual void EncodeNamedValueElement (System.String elemName)
 
virtual void EncodeRealValue (double data, System.String elemName)
 
virtual void EncodeStartDocument ()
 
virtual void EncodeStartElement (System.String elemName)
 
virtual void IncrLevel ()
 
virtual void Indent ()
 
virtual bool IsCanonical ()
 
- Public Member Functions inherited from Asn1XmlXerEncoder
void Copy (byte data)
 
void Copy (byte[] data)
 
void Copy (byte[] data, int off, int len)
 

Properties

virtual bool Canonical [set]
 
virtual int State [get, set]
 
- Properties inherited from Asn1XerEncoder
int State [get, set]
 
- Properties inherited from Asn1XmlXerEncoder
Asn1Context Context [get]
 

Detailed Description

This class handles the encoding of ASN.1 messages as specified in the XML Encoding Rules (XER) as specified in the ITU-T X.693 standard.

Constructor & Destructor Documentation

◆ Asn1XerEncodeBuffer() [1/3]

The default constructor creates an XER encode buffer object with the default size increment and canonical set to false.

◆ Asn1XerEncodeBuffer() [2/3]

Asn1XerEncodeBuffer ( bool  canonical)

The parameterized constructor creates an XER encode buffer object with default size increment and canonical set to the given values.

Parameters
canonicalBoolean indicating a canonical or non-canonical encoding should be produced as defined in the X.693 standard.

◆ Asn1XerEncodeBuffer() [3/3]

Asn1XerEncodeBuffer ( bool  canonical,
int  sizeIncrement 
)

The parameterized constructor creates an XER encode buffer object with size increment and canonical set to the given values.

Parameters
canonicalBoolean indicating a canonical or non-canonical encoding should be produced as defined in the X.693 standard.
sizeIncrementThe initial size in bytes of an encode buffer. If the buffer becomes full, it will be expanded by the amount. If this parameter is set to zero, the default increment will be used.

Member Function Documentation

◆ BinDump()

override void BinDump ( System.IO.StreamWriter  outs,
System.String  varName 
)
virtual

This method dumps the encoded message in a human-readable format showing a bit trace of all fields to the given print output stream.

Parameters
outsOutput will be written to this stream
varNameName of the Decoded ASN1 Type

Implements Asn1EncodeBuffer.

◆ Copy()

virtual void Copy ( System.String  data)
virtual

This method copies a character string to the encode buffer.

Parameters
dataThe string value to copy

Implements Asn1XmlXerEncoder.

References Asn1Util.WriteStackTrace().

Referenced by Asn1OpenType.SaxHandler.EndElement().

◆ DecrLevel()

virtual void DecrLevel ( )
virtual

This method decrements the element nesting level counter.

Implements Asn1XmlXerEncoder.

◆ EncodeBinStrValue()

virtual void EncodeBinStrValue ( byte []  bits,
int  nbits 
)
virtual

This method encodes XML binary string data

Parameters
bitsBit String to encode
nbitsNumber of bits to encode

Implements Asn1XmlXerEncoder.

References Asn1Util.URShift().

◆ EncodeByte()

virtual void EncodeByte ( byte  data)
virtual

This method is used to encode a single byte to the encode buffer. It first converts the byte to a hex character representation and then copies it to the output buffer.

Parameters
dataThe byte value to copy

Implements Asn1XmlXerEncoder.

References Asn1Util.URShift().

◆ EncodeData()

virtual void EncodeData ( System.String  data)
virtual

This method encodes XML string data

Parameters
dataString value to encode

Implements Asn1XmlXerEncoder.

References Asn1XerEncoder_Fields.XERDATA.

Referenced by Asn1OpenType.SaxHandler.Characters().

◆ EncodeEmptyElement()

virtual void EncodeEmptyElement ( System.String  elemName)
virtual

This method encodes an XML empty element tag

Parameters
elemNameThe name of element.

Implements Asn1XerEncoder.

References Asn1XerEncoder_Fields.XEREND.

◆ EncodeEndDocument()

virtual void EncodeEndDocument ( )
virtual

This method encodes standard trailor information at the end of the XML document.

Implements Asn1XmlXerEncoder.

◆ EncodeEndElement()

virtual void EncodeEndElement ( System.String  elemName)
virtual

This method encodes an XML end element tag

Parameters
elemNameThe name of element.

Implements Asn1XerEncoder.

References Asn1XerEncoder_Fields.XEREND.

Referenced by Asn1OpenType.SaxHandler.EndElement().

◆ EncodeHexStrValue()

virtual void EncodeHexStrValue ( byte []  data)
virtual

This method encodes XML hexadecimal string data

Parameters
dataData to encode

Implements Asn1XmlXerEncoder.

◆ EncodeNamedValue()

virtual void EncodeNamedValue ( System.String  valueName,
System.String  elemName 
)
virtual

This method encodes an XML named value (with start and end tags)

Parameters
elemNameThe name of element.
valueNamenamed value.

Implements Asn1XerEncoder.

◆ EncodeNamedValueElement()

virtual void EncodeNamedValueElement ( System.String  elemName)
virtual

This method encodes an XML named value element tag

Parameters
elemNameThe name of element.
Exceptions
Asn1ExceptionThrown, if operation is failed.

Implements Asn1XmlXerEncoder.

References Asn1XerEncoder_Fields.XERDATA.

Referenced by Asn1Enumerated.Encode(), and Asn1Boolean.Encode().

◆ EncodeRealValue()

virtual void EncodeRealValue ( double  data,
System.String  elemName 
)
virtual

This method encodes an XML REAL (double) value (with start and end tags).

Parameters
dataThe value to be encoded.
elemNameThe name of element. If null, then start and end tags won't be encoded.
Exceptions
Asn1ExceptionThrown, if operation is failed.

Implements Asn1XerEncoder.

References Asn1XerUtil.EncodeReal().

◆ EncodeStartDocument()

virtual void EncodeStartDocument ( )
virtual

This method encodes standard header information at the beginning of the XML document.

Implements Asn1XmlXerEncoder.

◆ EncodeStartElement()

virtual void EncodeStartElement ( System.String  elemName)
virtual

This method encodes an XML start element tag

Parameters
elemNameThe name of element.

Implements Asn1XerEncoder.

References Asn1XerEncoder_Fields.XERSTART.

Referenced by Asn1OpenType.SaxHandler.StartElement().

◆ IncrLevel()

virtual void IncrLevel ( )
virtual

This method increments the element nesting level counter.

Implements Asn1XmlXerEncoder.

◆ Indent()

virtual void Indent ( )
virtual

This methods indents by adding a new-line followed by whitespace corresponding to the current nesting level to the encode buffer.

Implements Asn1XmlXerEncoder.

References Asn1XerEncoder_Fields.XERINDENT.

◆ IsCanonical()

virtual bool IsCanonical ( )
virtual

For XER, canonical mode turns off extra whitespace output.

Return true if the encoder has been put into canonical mode. For XML and XER, canonical mode signals the generated encoders to always encode ASN.1 elements that have a DEFAULT value.

Implements Asn1XmlXerEncoder.

Property Documentation

◆ Canonical

virtual bool Canonical
set

Sets the canonical encoding rule.

Value: true if canonical encoding; otherwise false.

◆ State

virtual int State
getset

Sets the state of the buffer.

Value: buffer stat