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

Public Member Functions

 Asn1CharRange (int lower, int upper)
 
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)
 

Properties

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

Detailed Description

This class is used to represent a permitted alphabet that is specified
as a large, continuous range of characters. An example of this can be found in the following extract from T.124:
simpleTextFirstCharacter UniversalString ::= {0, 0, 0, 0}
simpleTextLastCharacter UniversalString ::= {0, 0, 0, 255}
SimpleTextString ::= BMPString (SIZE (0..255))
(FROM (simpleTextFirstCharacter..simpleTextLastCharacter))
This class is mainly for internal use by the compiler when generating
methods that encode/Decode PER charater string components containing permitted alphabet constraints.

Constructor & Destructor Documentation

◆ Asn1CharRange()

Asn1CharRange ( int  lower,
int  upper 
)

This constructor sets the range values.

Parameters
lowerRange lower value
upperRange upper value

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
Asn1ConsVioExceptionIndex not within define range

Implements Asn1CharSet.

◆ 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
Asn1ConsVioExceptionCharacter not found in set

Implements Asn1CharSet.

◆ validate()

override bool validate ( String  s)
virtual

This method will validate a character string by comparing its contents to the character range. Each character in the string is checked against the range. If it exceeds the upper or lower limit of the range, false is returned. Otherwise true is returned.

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 the maximum value of character within the given permitted alphabet character set.

Value: Upper Bound Character or Character with max int value