ASN1C C# Runtime Library  7.6
Public Member Functions | Properties | List of all members
Asn1CharSet Class Referenceabstract
Inheritance diagram for Asn1CharSet:
Asn1CharRange Asn1DiscreteCharSet

Public Member Functions

abstract int GetCharAtIndex (int index)
 
abstract int GetCharIndex (int charValue)
 
virtual int GetNumBitsPerChar (bool aligned)
 
abstract bool validate (String s)
 

Properties

abstract int MaxValue [get]
 

Detailed Description

This is the base class for representing character sets that are defined in ASN.1 permitted alphabet constraints.

Member Function Documentation

◆ GetCharAtIndex()

abstract int GetCharAtIndex ( int  index)
pure virtual

This method will fetch the character from the permitted alphabet at the given index.

Parameters
indexIndex of character within the character set
Returns
Character at given index
Exceptions
Asn1ConsVioExceptionIndex not within define range

Implemented in Asn1CharRange, and Asn1DiscreteCharSet.

Referenced by Asn1UniversalString.Decode(), and Asn1PerDecodeBuffer.DecodeCharString().

◆ GetCharIndex()

abstract int GetCharIndex ( int  charValue)
pure virtual

This method will determine the index of the given character within the permitted alphabet character set.

Parameters
charValueCharacter value to search for
Returns
Index of character
Exceptions
Asn1ConsVioExceptionCharacter not found in set

Implemented in Asn1CharRange, and Asn1DiscreteCharSet.

Referenced by Asn1UniversalString.Encode(), and Asn1PerEncodeBuffer.EncodeCharString().

◆ GetNumBitsPerChar()

virtual int GetNumBitsPerChar ( bool  aligned)
virtual

This method will return the number of bits-per-character.

Parameters
alignedBoolean value indicating whether number of aligned (true) or unaligned (false) characters should be returned.
Returns
Number of bits-per-character

Referenced by Asn1UniversalString.Decode(), Asn1PerDecodeBuffer.DecodeCharString(), Asn1UniversalString.Encode(), Asn1PerEncodeBuffer.EncodeCharString(), and Asn1CharString.validate().

◆ validate()

abstract bool validate ( String  s)
pure virtual

This method will validate a character string by comparing its contents to the character set. If a character string contains characters that are not in the character set, this method will return false. Otherwise it returns true.

Parameters
sThe string to be validated.
Returns
False if the string contains invalid characters; true otherwise.

Implemented in Asn1CharRange, and Asn1DiscreteCharSet.

Referenced by Asn1CharString.validate(), and Asn1UniversalString.validate().

Property Documentation

◆ MaxValue

abstract int MaxValue
get

Gets the maximum value of the character within the given permitted alphabet character set.

Value: Upper Bound Character or Character with max int value

Referenced by Asn1UniversalString.Decode(), Asn1PerDecodeBuffer.DecodeCharString(), Asn1UniversalString.Encode(), and Asn1PerEncodeBuffer.EncodeCharString().