DefinitionRecord

One definition record as its text: the model that every editor surface reads and writes (construct-definition-editor §DUM-3).

In the namespace construct::registry. Declared in src/libs/libconstruct/construct/registry/DefinitionRecord.hpp.

Detailed description

A definition record is one YAML document. `Definition` is a projection of it: it has no place for a comment, for the order of the keys, or for a key that it does not model. So the record keeps the text, and the typed definition is what the load path makes of it (Registry::definitionFromYaml()).

- `text()` is the YAML of the record, as the user sees it. - `savedText()` is the text of the last load or save. The record is dirty when the two differ, so a metadata edit is an edit. - `definition()` is the definition the last text that parsed gave. A text that does not parse keeps it, and errors() says where the text broke. - `revision()` counts the changes of the text.

A writer changes one value through YamlTextEditor, so every other character of the text stays as it was.

The static functions keep the invariant of §DUM-6a for a definition that is not open in a record: when Definition::sourceText is set, the load path applied to it gives the typed fields.

In this section