ASN1C C# Runtime Library  7.5
Public Member Functions | Protected Member Functions | Properties | List of all members
Asn1DiscreteCharSet Class Reference
Inheritance diagram for Asn1DiscreteCharSet:
Asn1CharSet

Public Member Functions

 Asn1DiscreteCharSet (System.String charSet)
 
 Asn1DiscreteCharSet (int[] charSet)
 
override int GetCharAtIndex (int index)
 
override int GetCharIndex (int charValue)
 
override bool validate (String s)
 
- Public Member Functions inherited from Asn1CharSet
virtual int GetNumBitsPerChar (bool aligned)
 

Protected Member Functions

bool helpValidate (char c)
 

Properties

override int MaxValue [get]
 
- Properties inherited from Asn1CharSet
abstract int MaxValue [get]
 

Detailed Description

This class is used to represent a discrete set of characters from a permitted alphabet.

Constructor & Destructor Documentation

◆ Asn1DiscreteCharSet() [1/2]

Asn1DiscreteCharSet ( System.String  charSet)

This constructor sets the permitted alphabet chracter set

Parameters
charSetPermitted alphabet character set

◆ Asn1DiscreteCharSet() [2/2]

Asn1DiscreteCharSet ( int []  charSet)

This constructor sets the permitted alphabet chracter set

Parameters
charSetPermitted alphabet character set

Member Function Documentation

◆ GetCharAtIndex()

override int GetCharAtIndex ( int  index)
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
Asn1ConsVioExceptionThrown if index not within define range

Implements Asn1CharSet.

References Diag.Prtln().

◆ GetCharIndex()

override int GetCharIndex ( int  charValue)
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
Asn1ConsVioExceptionthrown if 'charValue' not found in set

Implements Asn1CharSet.

◆ helpValidate()

bool helpValidate ( char  c)
protected

This function helps validate a character string by checking a character to see if it is in the character set. It returns false if a character is not contained in the set and true otherwise.

◆ validate()

override bool validate ( String  s)
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.

Implements Asn1CharSet.

Property Documentation

◆ MaxValue

override int MaxValue
get

Gets Upper Bound Character or Character with max int value. It will determine the maximum value of the given character within the permitted alphabet character set. As the charset is canonical order, max value is of the last character.