Donner 0.5.1
Embeddable browser-grade SVG2 engine
Loading...
Searching...
No Matches
donner::editor::TextPatch Struct Reference

A byte-level splice in the source text buffer. More...

#include "donner/editor/TextPatch.h"

Collaboration diagram for donner::editor::TextPatch:
[legend]

Public Attributes

std::size_t offset = 0
 Byte offset in the source text.
std::size_t length = 0
 Number of bytes to replace (0 = pure insert).
std::string replacement
 New text to splice in (empty = pure delete).

Detailed Description

A byte-level splice in the source text buffer.

Represents "replace `length` bytes starting at `offset` with `replacement`." Patches are applied in descending offset order by applyPatches so earlier patches don't shift the byte offsets of later ones.

Member Data Documentation

◆ length

std::size_t donner::editor::TextPatch::length = 0

Number of bytes to replace (0 = pure insert).

◆ offset

std::size_t donner::editor::TextPatch::offset = 0

Byte offset in the source text.

◆ replacement

std::string donner::editor::TextPatch::replacement

New text to splice in (empty = pure delete).


The documentation for this struct was generated from the following file: