Bounded metadata-only helper for a text provider; not a PositionResolver. Caller serializes every operation. Creation allocates; publication and resolution allocate nothing, perform no I/O or callbacks, and inspect only bounded metadata. Missing proof returns UNAVAILABLE. The enclosing provider must validate/snap mapped scalar hints to actual grapheme boundaries before publishing TEXT replies. This avoids a whole-document grapheme index requirement. Bookmarks contain scalars only. Content-state tokens are positive, provider-local values, not logical resource identities.
More...
#include <text_document.hpp>
Bounded metadata-only helper for a text provider; not a PositionResolver. Caller serializes every operation. Creation allocates; publication and resolution allocate nothing, perform no I/O or callbacks, and inspect only bounded metadata. Missing proof returns UNAVAILABLE. The enclosing provider must validate/snap mapped scalar hints to actual grapheme boundaries before publishing TEXT replies. This avoids a whole-document grapheme index requirement. Bookmarks contain scalars only. Content-state tokens are positive, provider-local values, not logical resource identities.
◆ bookmark()
- Parameters
-
| offset | Current scalar offset, including end; caller must prove the grapheme boundary. |
| affinity | FORWARD follows insertion; BACKWARD stays before insertion. |
- Returns
- Scalar-only TEXT bookmark or INVALID_ARGUMENT.
◆ create()
| std::expected< std::unique_ptr< TextChangeMap >, SourceError > portals::TextChangeMap::create |
( |
ModelResource | resource, |
|
|
std::uint64_t | extent, |
|
|
TextAnchorOptions | options = {}, |
|
|
std::uint64_t | initialRevision = 1, |
|
|
std::uint64_t | initialContentState = 1 ) |
|
static |
- Parameters
-
| resource | Existing logical resource namespace; no new issuer is introduced. |
| extent | Initial extent in provider-defined text units; may exceed resident memory. |
| options | Positive metadata capacity. |
| initialRevision | Positive initial data revision, normally one. |
| initialContentState | Positive provider-local baseline token, normally one. |
- Returns
- Map at the supplied baseline, or a typed admission error.
◆ edit()
| std::expected< void, SourceError > portals::TextChangeMap::edit |
( |
TextSplice | change, |
|
|
std::uint64_t | contentState ) |
|
noexcept |
- Parameters
-
| change | Provider-proven scalar replacement. |
| contentState | New strictly increasing provider-local content token. |
- Returns
- Success or validation/exhaustion failure; failures preserve the map.
◆ extent()
| std::uint64_t portals::TextChangeMap::extent |
( |
| ) |
const |
|
noexcept |
- Returns
- Current logical scalar extent; no source scan.
◆ map()
- Parameters
-
| bookmark | TEXT bookmark captured at a provider-validated grapheme boundary. |
| stop | Cooperative cancellation; checked without retaining the token. |
- Returns
- Intermediate mapped scalar hint or typed cancellation/validation failure. EXACT means scalar mapping is exact; the provider may still need a NEAREST grapheme snap.
◆ revision()
| std::uint64_t portals::TextChangeMap::revision |
( |
| ) |
const |
|
noexcept |
- Returns
- Current monotonically increasing data revision.
◆ traverse()
| std::expected< void, SourceError > portals::TextChangeMap::traverse |
( |
std::uint64_t | contentState, |
|
|
std::uint64_t | extent ) |
|
noexcept |
- Parameters
-
| contentState | Prior token proven by the provider's existing Undo/Redo engine. |
| extent | Exact scalar extent in that state, even when its old proof was evicted. |
- Returns
- Success or validation/exhaustion failure; no second undo engine is stored.
The documentation for this class was generated from the following file: