Owning, move-only staged history and already segmented restoration text.
More...
#include <text_history.hpp>
|
| | PreparedTextHistory (PreparedTextHistory &&other) noexcept |
| | Transfer a prepared value without allocating.
|
| PreparedTextHistory & | operator= (PreparedTextHistory &&other) noexcept |
| | Replace this handle without allocating.
|
|
| ~PreparedTextHistory () |
| | Release abandoned staging without changing the owner.
|
| bool | changed () const noexcept |
| | Report whether preparation changes recorded history.
|
| std::size_t | retainedBytes () const noexcept |
| std::size_t | cursor () const noexcept |
| | Return the validated target cursor.
|
| std::size_t | anchor () const noexcept |
| | Return the validated target selection anchor.
|
| std::uint64_t | contentState () const noexcept |
| const GraphemeText * | text () const noexcept |
| | Borrow the already segmented target before publication.
|
| void | takeText (GraphemeText &destination) noexcept |
| | Transfer staged text into existing storage without allocating.
|
Owning, move-only staged history and already segmented restoration text.
Destruction abandons staging. Construction performs all potentially throwing value moves behind a pointer; moving this handle cannot allocate, including MSVC Debug iterator bookkeeping. No callbacks or external object pointers.
◆ PreparedTextHistory()
| portals::PreparedTextHistory::PreparedTextHistory |
( |
PreparedTextHistory && | other | ) |
|
|
noexcept |
Transfer a prepared value without allocating.
- Parameters
-
| other | Prepared value; becomes empty on success. |
◆ anchor()
| std::size_t portals::PreparedTextHistory::anchor |
( |
| ) |
const |
|
nodiscardnoexcept |
Return the validated target selection anchor.
- Returns
- Byte offset of the fixed selection end, or zero for an empty handle.
◆ changed()
| bool portals::PreparedTextHistory::changed |
( |
| ) |
const |
|
nodiscardnoexcept |
Report whether preparation changes recorded history.
- Returns
- False for a regular equal-text edit; true for reset and traversal.
◆ contentState()
| std::uint64_t portals::PreparedTextHistory::contentState |
( |
| ) |
const |
|
nodiscardnoexcept |
- Returns
- Opaque owner-local content state after publication; zero for an empty handle. Undo/Redo restore earlier tokens; tokens identify content states, not resources.
◆ cursor()
| std::size_t portals::PreparedTextHistory::cursor |
( |
| ) |
const |
|
nodiscardnoexcept |
Return the validated target cursor.
- Returns
- Byte offset of the active selection end, or zero for an empty handle.
◆ operator=()
Replace this handle without allocating.
- Parameters
-
| other | Prepared value; self-assignment is supported. |
- Returns
- This handle after ownership transfer.
◆ retainedBytes()
| std::size_t portals::PreparedTextHistory::retainedBytes |
( |
| ) |
const |
|
nodiscardnoexcept |
- Returns
- Owning history bytes after this prepared operation commits; no mutation or allocation.
◆ takeText()
| void portals::PreparedTextHistory::takeText |
( |
GraphemeText & | destination | ) |
|
|
noexcept |
Transfer staged text into existing storage without allocating.
- Parameters
-
| destination | Existing text value to replace by noexcept move assignment. |
- Note
- Call TextHistory::checkPrepared first, then transfer and commit without intervening callbacks or history mutations. A second transfer is a no-op.
◆ text()
| const GraphemeText * portals::PreparedTextHistory::text |
( |
| ) |
const |
|
nodiscardnoexcept |
Borrow the already segmented target before publication.
- Returns
- Target text, or nullptr for an empty handle or after takeText; expires on transfer/destruction.
The documentation for this class was generated from the following file: