CharacterMap<T> Class

Allows to associate characters to a data structures and query efficiently for them.

public sealed class CharacterMap<T> where T : class

Type parameters

T

Constructors

NameDescription
CharacterMap(IEnumerable<KeyValuePair<char, T>>)Initializes a new instance of the CharacterMap<T> class.

CharacterMap(IEnumerable<KeyValuePair<char, T>>)

CharacterMap.cs

Initializes a new instance of the CharacterMap<T> class.

public CharacterMap(IEnumerable<KeyValuePair<char, T>> maps)

Properties

NameDescription
OpeningCharactersGets all the opening characters defined.

OpeningCharacters

CharacterMap.cs

Gets all the opening characters defined.

public char[] OpeningCharacters { get; }

Property value

char[]

Indexers

NameDescription
this[uint]Gets the list of parsers valid for the specified opening character.

this[uint]

CharacterMap.cs

Gets the list of parsers valid for the specified opening character.

public T? this[uint openingChar] { get; }

Parameters

openingChar uint
The opening character.

Property value

T?

Methods

NameDescription
IndexOfOpeningCharacter(string, int, int)Searches for an opening character from a registered parser in the specified string.

IndexOfOpeningCharacter(string, int, int)

CharacterMap.cs

Searches for an opening character from a registered parser in the specified string.

public int IndexOfOpeningCharacter(string text, int start, int end)

Parameters

text string
The text.
start int
The start.
end int
The end.

Returns

int Index position within the string of the first opening character found in the specified text; if not found, returns -1