C# Класс QUT.GPGen.CharacterUtilities

This class supplies character escape utilities for project.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Canonicalize ( string source, int startIndex ) : string

Take a possibly escaped character literal and convert it to a canonical form. Thus @"'\377'", @"'\xff'" and @"'\u00FF'" all return @"'\xFF'". Throws a StringInterpretException if character ordinal exceeds "symLimit".

InterpretCharacterEscapes ( string source ) : string

This static method expands characters in a literal string, returning a modified string with character escapes replaced by the character which they denote. This includes characters outside the BMP which return a pair of surrogate characters.

InterpretEscapesInVerbatimString ( string text ) : string

This static method expands characters in a verbatim string, returning a modified string with character escapes replaced by the character which they denote.

Map ( int code ) : string

Map literal characters into the display form

Map ( string source ) : string
OrdinalOfCharacterLiteral ( string source, int offset ) : int

Take the string representation of a possibly backslash- escaped character literal and return the character ordinal. Throws a StringInterpretException if character ordinal exceeds "symLimit".

QuoteMap ( int code ) : string
QuoteMap ( string source ) : string
SetUnicode ( ) : void

Приватные методы

Метод Описание
CodePoint ( string pattern, int &index ) : int
EscapedChar ( string source, int &index ) : int
GetHexadecimalChar ( string source ) : int
GetOctalChar ( string source ) : int

Assert: special case of '\0' is already filtered out.

GetSubstring ( string input, int index, int length ) : string

Get a substring of length len from the input string input, starting from the index ix. If there are not len characters left return rest of string.

GetUnicodeChar ( string source ) : int
HexChar ( char a, char b ) : char

This assumes that a,b are HexDigit characters

HiSurrogate ( int codePoint ) : char
IsHexDigit ( char c ) : bool
IsOctDigit ( char ch ) : bool
LoSurrogate ( int codePoint ) : char
OctChar ( char a, char b, char c ) : char
StrMap ( int code ) : string

Map string characters into the display form

ValOfHex ( char x ) : int

Описание методов

Canonicalize() публичный статический Метод

Take a possibly escaped character literal and convert it to a canonical form. Thus @"'\377'", @"'\xff'" and @"'\u00FF'" all return @"'\xFF'". Throws a StringInterpretException if character ordinal exceeds "symLimit".
public static Canonicalize ( string source, int startIndex ) : string
source string
startIndex int start index of character
Результат string

InterpretCharacterEscapes() публичный статический Метод

This static method expands characters in a literal string, returning a modified string with character escapes replaced by the character which they denote. This includes characters outside the BMP which return a pair of surrogate characters.
public static InterpretCharacterEscapes ( string source ) : string
source string the input string
Результат string

InterpretEscapesInVerbatimString() публичный статический Метод

This static method expands characters in a verbatim string, returning a modified string with character escapes replaced by the character which they denote.
public static InterpretEscapesInVerbatimString ( string text ) : string
text string the input string
Результат string

Map() публичный статический Метод

Map literal characters into the display form
public static Map ( int code ) : string
code int the codepoint to encode
Результат string

Map() публичный статический Метод

public static Map ( string source ) : string
source string
Результат string

OrdinalOfCharacterLiteral() публичный статический Метод

Take the string representation of a possibly backslash- escaped character literal and return the character ordinal. Throws a StringInterpretException if character ordinal exceeds "symLimit".
public static OrdinalOfCharacterLiteral ( string source, int offset ) : int
source string the string representation
offset int start index of character
Результат int

QuoteMap() публичный статический Метод

public static QuoteMap ( int code ) : string
code int
Результат string

QuoteMap() публичный статический Метод

public static QuoteMap ( string source ) : string
source string
Результат string

SetUnicode() публичный статический Метод

public static SetUnicode ( ) : void
Результат void