Docsv3.31.0
Back to API Reference
Interface

ITextDocument

abstract

Read-only view of a text document with codepoint-indexed access. Implemented by UniTextEditable; consumed by generic text-aware features (find / replace, validators, accessibility readers) that should not depend on the concrete editor type.

Implementations(2)

Types that implement ITextDocument.

public int CodepointCount{ get }

Number of Unicode codepoints in the document. Surrogate pairs count as one.

public int CharCount{ get }

Number of UTF-16 chars in the document — the unit Win32 / AppKit / UIKit IMEs and most string APIs use.

public int Version{ get }

Monotonically increasing counter incremented on every mutation. Lets consumers cache derived state and invalidate cheaply.

public abstract int CopyCodepointRange(int startCodepoint, int codepointCount, Span<char> destination)

Copies codepointCount codepoints starting at startCodepoint into destination. Returns the number of UTF-16 chars written.

public abstract int GetCodepointAt(int codepointIndex)

Returns the Unicode codepoint at codepointIndex. Out-of-range indices return 0.