C# Class AvalonStudio.TextEditor.Utils.CharRope

Poor man's template specialization: extension methods for Rope<char>.
Afficher le fichier Open project: VitalElement/AvalonStudio Class Usage Examples

Méthodes publiques

Méthode Description
AddText ( this rope, string text ) : void

Appends text to this rope. Runs in O(lg N + M).

Create ( string text ) : Rope

Creates a new rope from the specified text.

IndexOf ( this rope, string searchText, int startIndex, int length, System.StringComparison comparisonType ) : int

Gets the index of the first occurrence of the search text.

IndexOfAny ( this rope, char anyOf, int startIndex, int length ) : int

Gets the index of the first occurrence of any element in the specified array.

InsertText ( this rope, int index, string text ) : void

Inserts text into this rope. Runs in O(lg N + M).

LastIndexOf ( this rope, string searchText, int startIndex, int length, System.StringComparison comparisonType ) : int

Gets the index of the last occurrence of the search text.

ToString ( this rope, int startIndex, int length ) : string

Retrieves the text for a portion of the rope. Runs in O(lg N + M), where M=length.

This method counts as a read access and may be called concurrently to other read accesses.

WriteTo ( this rope, TextWriter output, int startIndex, int length ) : void

Retrieves the text for a portion of the rope and writes it to the specified text writer. Runs in O(lg N + M), where M=length.

This method counts as a read access and may be called concurrently to other read accesses.

Private Methods

Méthode Description
FillNode ( RopeNode node, string text, int start ) : void
InitFromString ( string text ) : RopeNode
WriteTo ( this node, int index, TextWriter output, int count ) : void

Method Details

AddText() public static méthode

Appends text to this rope. Runs in O(lg N + M).
newElements is null.
public static AddText ( this rope, string text ) : void
rope this
text string
Résultat void

Create() public static méthode

Creates a new rope from the specified text.
public static Create ( string text ) : Rope
text string
Résultat Rope

IndexOf() public static méthode

Gets the index of the first occurrence of the search text.
public static IndexOf ( this rope, string searchText, int startIndex, int length, System.StringComparison comparisonType ) : int
rope this
searchText string
startIndex int
length int
comparisonType System.StringComparison
Résultat int

IndexOfAny() public static méthode

Gets the index of the first occurrence of any element in the specified array.
public static IndexOfAny ( this rope, char anyOf, int startIndex, int length ) : int
rope this The target rope.
anyOf char Array of characters being searched.
startIndex int Start index of the search.
length int Length of the area to search.
Résultat int

InsertText() public static méthode

Inserts text into this rope. Runs in O(lg N + M).
newElements is null. index or length is outside the valid range.
public static InsertText ( this rope, int index, string text ) : void
rope this
index int
text string
Résultat void

LastIndexOf() public static méthode

Gets the index of the last occurrence of the search text.
public static LastIndexOf ( this rope, string searchText, int startIndex, int length, System.StringComparison comparisonType ) : int
rope this
searchText string
startIndex int
length int
comparisonType System.StringComparison
Résultat int

ToString() public static méthode

Retrieves the text for a portion of the rope. Runs in O(lg N + M), where M=length.
This method counts as a read access and may be called concurrently to other read accesses.
offset or length is outside the valid range.
public static ToString ( this rope, int startIndex, int length ) : string
rope this
startIndex int
length int
Résultat string

WriteTo() public static méthode

Retrieves the text for a portion of the rope and writes it to the specified text writer. Runs in O(lg N + M), where M=length.
This method counts as a read access and may be called concurrently to other read accesses.
offset or length is outside the valid range.
public static WriteTo ( this rope, TextWriter output, int startIndex, int length ) : void
rope this
output System.IO.TextWriter
startIndex int
length int
Résultat void