C# 클래스 QUT.Gplex.Parser.CharacterUtilities

This class supplies character escape utilities for project.
파일 보기 프로젝트 열기: spark-shading-language/spark 1 사용 예제들

공개 메소드들

메소드 설명
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 source ) : 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
MapForCharSet ( int code ) : string

Same as Map(code) except '-' must be escaped.

OrdinalOfCharLiteral ( 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 str ) : int
GetOctalChar ( string str ) : int

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

GetSubstring ( string input, int ix, int len ) : 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 str ) : int
HexChar ( char a, char b ) : char

This assumes that a,b are HexDigit characters

HiSurrogate ( int codePoint ) : char
IsHexDigit ( char ch ) : bool
IsOctDigit ( char ch ) : bool
LoSurrogate ( int codePoint ) : char
OctChar ( char a, char b, char c ) : char
StrMap ( int chr ) : 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
리턴 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
리턴 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 source ) : string
source string
리턴 string

Map() 공개 정적인 메소드

Map literal characters into the display form
public static Map ( int code ) : string
code int
리턴 string

Map() 공개 정적인 메소드

public static Map ( string source ) : string
source string
리턴 string

MapForCharSet() 공개 정적인 메소드

Same as Map(code) except '-' must be escaped.
public static MapForCharSet ( int code ) : string
code int Unicode codepoint
리턴 string

OrdinalOfCharLiteral() 공개 정적인 메소드

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 OrdinalOfCharLiteral ( string source, int offset ) : int
source string
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