Copyable UI-affine finite document using the existing read-only scalar binding runtime. Copies share the document/session, not a view. Sources bind to one scene, like ui::Model; replacing a view in that scene preserves text, bookmarks, selection, savepoint and history. The core edit commits before presentation publication. A publication failure may leave the accepted document newer than its last visible value; refresh() retries publication. Methods return checked ManagedError for runApp. lastError() preserves a core typed cause.
More...
#include <ui_text_document.hpp>
|
| | FiniteTextDocument (const FiniteTextDocument &other)=default |
| FiniteTextDocument & | operator= (const FiniteTextDocument &other)=default |
| Model< TextDocumentValue > | source () const |
| std::expected< ModelBookmark, SourceError > | bookmark (std::size_t offset, PositionAffinity affinity=PositionAffinity::FORWARD) const |
| std::expected< void, ManagedError > | replace (std::size_t begin, std::size_t end, std::string_view text) const |
| std::expected< void, ManagedError > | insert (std::size_t offset, std::string_view text) const |
| std::expected< void, ManagedError > | undo () const |
| | Undo through the existing document history; empty history is a UI no-op.
|
| std::expected< void, ManagedError > | redo () const |
| | Redo through existing history; empty history is a UI no-op.
|
| std::expected< void, ManagedError > | restore (const ModelBookmark &bookmark) const |
| std::expected< void, ManagedError > | restore (const std::expected< ModelBookmark, SourceError > &bookmark) const |
| std::expected< TextSaveTicket, ManagedError > | beginSave (std::string_view target) const |
| std::expected< void, ManagedError > | acknowledgeSave (const TextSaveTicket &ticket) const |
| std::expected< void, ManagedError > | acknowledgeSave (const std::expected< TextSaveTicket, ManagedError > &ticket) const |
| std::expected< void, ManagedError > | savepoint (std::string_view target) const |
| | Mark the current in-memory content saved; performs no physical write.
|
| std::optional< TextDocumentError > | lastError () const |
| std::expected< void, ManagedError > | refresh () const |
| | Retry presentation after a prior notification failure; does not edit content.
|
Copyable UI-affine finite document using the existing read-only scalar binding runtime. Copies share the document/session, not a view. Sources bind to one scene, like ui::Model; replacing a view in that scene preserves text, bookmarks, selection, savepoint and history. The core edit commits before presentation publication. A publication failure may leave the accepted document newer than its last visible value; refresh() retries publication. Methods return checked ManagedError for runApp. lastError() preserves a core typed cause.
◆ FiniteTextDocument()
| portals::ui::FiniteTextDocument::FiniteTextDocument |
( |
const FiniteTextDocument & | other | ) |
|
|
default |
- Parameters
-
| other | Shared finite session/source to retain. |
◆ acknowledgeSave() [1/2]
- Parameters
-
| ticket | Checked request result, propagated without caller-side unwrapping. |
- Returns
- Checked acknowledgement or the original request failure.
◆ acknowledgeSave() [2/2]
- Parameters
-
| ticket | Successful save receipt; stale acknowledgements remain checked failures. |
- Returns
- Checked savepoint/presentation result, without changing caret or history.
◆ beginSave()
- Parameters
-
| target | Destination metadata, not a path to be opened here. |
- Returns
- Save ticket for the current bytes; caller acknowledges only after its save succeeds.
◆ bookmark()
- Parameters
-
| offset | Current UTF-8 byte boundary. |
| affinity | Insertion preference. |
- Returns
- Metadata-only bookmark or checked core error; no UI/view is retained.
◆ insert()
| std::expected< void, ManagedError > portals::ui::FiniteTextDocument::insert |
( |
std::size_t | offset, |
|
|
std::string_view | text ) const |
|
inline |
- Parameters
-
| offset | Insertion byte boundary. |
| text | Borrowed UTF-8 to copy. |
- Returns
- Checked edit/presentation result.
◆ lastError()
| std::optional< TextDocumentError > portals::ui::FiniteTextDocument::lastError |
( |
| ) |
const |
|
inline |
- Returns
- Most recent core failure, if any; UI publication failures are ManagedError only.
◆ operator=()
- Parameters
-
| other | Shared finite session/source to retain. |
- Returns
- This facade after assignment.
◆ redo()
| std::expected< void, ManagedError > portals::ui::FiniteTextDocument::redo |
( |
| ) |
const |
|
inline |
Redo through existing history; empty history is a UI no-op.
- Returns
- Checked edit/presentation result.
◆ refresh()
| std::expected< void, ManagedError > portals::ui::FiniteTextDocument::refresh |
( |
| ) |
const |
|
inline |
Retry presentation after a prior notification failure; does not edit content.
- Returns
- Checked existing-property publication result.
◆ replace()
| std::expected< void, ManagedError > portals::ui::FiniteTextDocument::replace |
( |
std::size_t | begin, |
|
|
std::size_t | end, |
|
|
std::string_view | text ) const |
|
inline |
- Parameters
-
| begin | Inclusive byte boundary. |
| end | Exclusive byte boundary. |
| text | Borrowed replacement copied by the finite core. |
- Returns
- Checked edit/presentation result; no file I/O.
◆ restore() [1/2]
- Parameters
-
| bookmark | Scalar read position from this logical document/lineage. |
- Returns
- Checked caret restoration; no write authority is inferred from the bookmark.
◆ restore() [2/2]
- Parameters
-
| bookmark | Checked bookmark result, forwarded without caller-side unwrapping. |
- Returns
- Checked restoration or source-admission error.
◆ savepoint()
| std::expected< void, ManagedError > portals::ui::FiniteTextDocument::savepoint |
( |
std::string_view | target | ) |
const |
|
inline |
Mark the current in-memory content saved; performs no physical write.
- Parameters
-
| target | Explicit in-memory destination metadata. |
- Returns
- Checked synchronous savepoint result, suitable for memory-only demonstrations.
◆ source()
- Returns
- Cold read-only model for ordinary label projections; writes are rejected.
◆ undo()
| std::expected< void, ManagedError > portals::ui::FiniteTextDocument::undo |
( |
| ) |
const |
|
inline |
Undo through the existing document history; empty history is a UI no-op.
- Returns
- Checked edit/presentation result.
◆ finiteTextDocument
Declare one finite in-memory document with a cold read-only presentation source.
- Parameters
-
| text | Initial UTF-8 copied before return. |
| options | Explicit finite bounds/history policy. |
- Returns
- Copyable UI session; admission failures are reported when its source mounts. Includes no terminal, file writer, replay or continuous polling.
The documentation for this class was generated from the following file: