C# Класс CsQuery.StringScanner.CharacterData

A static class to provide attribute information about characters, e.g. determining whether or not it belongs to a number of predefined classes. This creates an array of every possible character with a uint that is a bitmap (of up to 32 possible values) This permits very fast access to this information since it only needs to be looked up via an index. Uses an array of 65536 uints = 256K of memory.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
charsHtmlSpaceArray char[]

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

Метод Описание
Closer ( char character ) : char

Return the closing character for a set of known opening enclosing characters (including single and double quotes)

CreateCharacterInfo ( ) : ICharacterInfo

Creates a new instance of the CharacterInfo class

CreateCharacterInfo ( char character ) : ICharacterInfo

Creates a new instance of the CharacterInfo class.

CreateStringInfo ( ) : IStringInfo

Creates a new StringInfo instance

CreateStringInfo ( string text ) : IStringInfo

Creates a new StringInfo instance bound to a string

GetType ( char character ) : CharacterType

Gets a type with all flags set for the types implemented by this character

IsType ( char character, CharacterType type ) : bool

Test whether a character matches a set of flags defined by the paramter

MatchingBound ( char character ) : char

Return the matching bound for known opening and closing bound characters (same as Closer, but accepts closing tags and returns openers)

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

Метод Описание
CharacterData ( ) : System

Configuration of the xref of character info. This sets bitflags in the "characterFlags" array for every unicode value that defines its attributes. This creates a lookup table allowing very rapid access to metadata about a single character, useful during string-parsing and scanning.

CloserImpl ( char character ) : char
SetAlphaISO10646 ( uint hsb ) : void

Sets the bits for ISO 10646.

SetHtmlAttributeName ( uint hsb ) : void

Matches anything but the first character for a valid HTML attribute name.

SetHtmlTagNameExceptStart ( uint hsb ) : void

Add the . back in when actually parsing html

SetHtmlTagNameStart ( uint hsb ) : void

Add the : back in when actually parsing html

SetHtmlTagSelectorExceptStart ( uint hsb ) : void

Similar to above, we omit "." as a valid in-name char because it breaks chained CSS selectors.

SetHtmlTagSelectorStart ( uint hsb ) : void

We omit ":" as a valid name start character because it makes pseudoselectors impossible to parse.

SetRange ( uint flag, ushort start, ushort end ) : void
SetSelectorTerminator ( uint hsb ) : void
setBit ( char character, uint bit ) : void
setBit ( string forCharacters, uint bit ) : void

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

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

Return the closing character for a set of known opening enclosing characters (including single and double quotes)
/// Thrown when the character is not a known opening bound ///
public static Closer ( char character ) : char
character char /// The opening bound character ///
Результат char

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

Creates a new instance of the CharacterInfo class
public static CreateCharacterInfo ( ) : ICharacterInfo
Результат ICharacterInfo

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

Creates a new instance of the CharacterInfo class.
public static CreateCharacterInfo ( char character ) : ICharacterInfo
character char /// The character to bind to the new instance. ///
Результат ICharacterInfo

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

Creates a new StringInfo instance
public static CreateStringInfo ( ) : IStringInfo
Результат IStringInfo

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

Creates a new StringInfo instance bound to a string
public static CreateStringInfo ( string text ) : IStringInfo
text string /// The string to bind. ///
Результат IStringInfo

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

Gets a type with all flags set for the types implemented by this character
public static GetType ( char character ) : CharacterType
character char /// The character to test ///
Результат CharacterType

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

Test whether a character matches a set of flags defined by the paramter
public static IsType ( char character, CharacterType type ) : bool
character char /// The character to test ///
type CharacterType /// The type to which to compare the character ///
Результат bool

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

Return the matching bound for known opening and closing bound characters (same as Closer, but accepts closing tags and returns openers)
/// Thrown when the requested operation is invalid. ///
public static MatchingBound ( char character ) : char
character char /// The opening bound character ///
Результат char

Описание свойств

charsHtmlSpaceArray публичное статическое свойство

An array of all HTML "space" characters.
public static char[] charsHtmlSpaceArray
Результат char[]