C# Класс AvalonStudio.TextEditor.Utils.CharRope

Poor man's template specialization: extension methods for Rope<char>.
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
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.

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

Метод Описание
FillNode ( RopeNode node, string text, int start ) : void
InitFromString ( string text ) : RopeNode
WriteTo ( this node, int index, TextWriter output, int count ) : void

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

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

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
Результат void

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

Creates a new rope from the specified text.
public static Create ( string text ) : Rope
text string
Результат Rope

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

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
Результат int

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

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.
Результат int

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

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
Результат void

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

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
Результат int

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

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
Результат string

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

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
Результат void