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(1)

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()

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

public abstract int GetCodepointAt()

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