C# Класс SimpleFramework.Xml.Stream.Splitter

The Splitter object is used split up a string in to tokens that can be used to create a camel case or hyphenated text representation of the string. This will preserve acronyms and numbers and splits tokens by case and character type. Examples of how a string would be splitted are as follows. CamelCaseString = "Camel" "Case" "String" hyphenated-text = "hyphenated" "text" URLAcronym = "URL" "acronym" RFC2616.txt = "RFC" "2616" "txt" By splitting strings in to individual words this allows the splitter to be used to assemble the words in a way that adheres to a specific style. Each style can then be applied to an XML document to give it a consistent format.
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
builder StringBuilder
count int
off int
text char[]

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

Метод Описание
Acronym ( ) : bool

This is used to extract a acronym from the source string. Once a token has been extracted the Commit method is called to add it to the string being build. Each time this is called a token, if extracted, will be committed to the string.

Commit ( char text, int off, int len ) : void

This is used to commit the provided text in to the style that is required. Committing the text to the buffer assembles the tokens resulting in a complete token.

IsDigit ( char ch ) : bool

This is used to determine if the provided string evaluates to a digit character. This delegates to Character so that the full range of unicode characters are considered.

IsLetter ( char ch ) : bool

This is used to determine if the provided string evaluates to a letter character. This delegates to System.Char so that the full range of unicode characters are considered.

IsSpecial ( char ch ) : bool

This is used to determine if the provided string evaluates to a symbol character. This delegates to System.Char so that the full range of unicode characters are considered.

IsUpper ( char ch ) : bool

This is used to determine if the provided string evaluates to an upper case letter. This delegates to System.Char so that the full range of unicode characters are considered.

Number ( ) : bool

This is used to extract a number from the source string. Once a token has been extracted the Commit method is called to add it to the string being build. Each time this is called a token, if extracted, will be committed to the string.

Parse ( char text, int off, int len ) : void

This is used to parse the provided text in to the style that is required. Manipulation of the text before committing it ensures that the text adheres to the required style.

Process ( ) : String

This is used to process the internal string and convert it in to a styled string. The styled string can then be used as an XML attribute or element providing a consistent format to the document that is being generated.

Splitter ( String source ) : System.Text

Constructor of the Splitter object. This is used to split the provided string in to individual words so that they can be assembled as a styled token, which can represent an XML attribute or element.

ToLower ( char ch ) : char

This is used to convert the provided character to a lower case character. This delegates to System.Char to perform the conversion so unicode characters are considered.

ToUpper ( char ch ) : char

This is used to convert the provided character to an upper case character. This delegates to System.Char to perform the conversion so unicode characters are considered.

Token ( ) : void

This is used to extract a token from the source string. Once a token has been extracted the Commit method is called to add it to the string being build. Each time this is called a token, if extracted, will be committed to the string. Before being committed the string is parsed for styling.

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

Acronym() публичный Метод

This is used to extract a acronym from the source string. Once a token has been extracted the Commit method is called to add it to the string being build. Each time this is called a token, if extracted, will be committed to the string.
public Acronym ( ) : bool
Результат bool

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

This is used to commit the provided text in to the style that is required. Committing the text to the buffer assembles the tokens resulting in a complete token.
public abstract Commit ( char text, int off, int len ) : void
text char /// this is the text buffer to acquire the token from ///
off int /// this is the offset in the buffer token starts at ///
len int /// this is the length of the token to be committed ///
Результат void

IsDigit() публичный Метод

This is used to determine if the provided string evaluates to a digit character. This delegates to Character so that the full range of unicode characters are considered.
public IsDigit ( char ch ) : bool
ch char /// this is the character that is to be evaluated ///
Результат bool

IsLetter() публичный Метод

This is used to determine if the provided string evaluates to a letter character. This delegates to System.Char so that the full range of unicode characters are considered.
public IsLetter ( char ch ) : bool
ch char /// this is the character that is to be evaluated ///
Результат bool

IsSpecial() публичный Метод

This is used to determine if the provided string evaluates to a symbol character. This delegates to System.Char so that the full range of unicode characters are considered.
public IsSpecial ( char ch ) : bool
ch char /// this is the character that is to be evaluated ///
Результат bool

IsUpper() публичный Метод

This is used to determine if the provided string evaluates to an upper case letter. This delegates to System.Char so that the full range of unicode characters are considered.
public IsUpper ( char ch ) : bool
ch char /// this is the character that is to be evaluated ///
Результат bool

Number() публичный Метод

This is used to extract a number from the source string. Once a token has been extracted the Commit method is called to add it to the string being build. Each time this is called a token, if extracted, will be committed to the string.
public Number ( ) : bool
Результат bool

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

This is used to parse the provided text in to the style that is required. Manipulation of the text before committing it ensures that the text adheres to the required style.
public abstract Parse ( char text, int off, int len ) : void
text char /// this is the text buffer to acquire the token from ///
off int /// this is the offset in the buffer token starts at ///
len int /// this is the length of the token to be parsed ///
Результат void

Process() публичный Метод

This is used to process the internal string and convert it in to a styled string. The styled string can then be used as an XML attribute or element providing a consistent format to the document that is being generated.
public Process ( ) : String
Результат String

Splitter() публичный Метод

Constructor of the Splitter object. This is used to split the provided string in to individual words so that they can be assembled as a styled token, which can represent an XML attribute or element.
public Splitter ( String source ) : System.Text
source String /// this is the source that is to be split ///
Результат System.Text

ToLower() публичный Метод

This is used to convert the provided character to a lower case character. This delegates to System.Char to perform the conversion so unicode characters are considered.
public ToLower ( char ch ) : char
ch char /// this is the character that is to be converted ///
Результат char

ToUpper() публичный Метод

This is used to convert the provided character to an upper case character. This delegates to System.Char to perform the conversion so unicode characters are considered.
public ToUpper ( char ch ) : char
ch char /// this is the character that is to be converted ///
Результат char

Token() публичный Метод

This is used to extract a token from the source string. Once a token has been extracted the Commit method is called to add it to the string being build. Each time this is called a token, if extracted, will be committed to the string. Before being committed the string is parsed for styling.
public Token ( ) : void
Результат void

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

builder защищенное свойство

This is the string builder used to build the processed text.
protected StringBuilder builder
Результат StringBuilder

count защищенное свойство

This is the number of characters to be considered for use.
protected int count
Результат int

off защищенное свойство

This is the current read offset of the text string.
protected int off
Результат int

text защищенное свойство

This is the original text that is to be split in to words.
protected char[] text
Результат char[]