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.
파일 보기 프로젝트 열기: ngallagher/simplexml

보호된 프로퍼티들

프로퍼티 타입 설명
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[]