Skip to main content

Module read

Module read 

Source
Expand description

A model asbuilt wrote, read back: the elements and relations in the model block of a .c4 file, as the file spells them. The inverse of emit for the model block it writes, so the drift check can say what changed rather than only which lines did. The specification and views are derived from the model block and are not read.

The model block must have emit’s shape: its statements, each element’s fields in emit’s order and at most once, every element before the first relation, and every relation joining two elements the block declares. Anything else (a hand edit, another tool’s model, a release that wrote a different shape) reads as None, never as a partial model: a summary that silently missed part of a file would be worse than none.

Structs§

Written
The elements and relations of a written model. Ids are dotted and as the file writes them (LikeC4 identifiers); kinds are the keywords the specification declares.
WrittenElement
WrittenRelation

Functions§

read
The model block of text, or None when text is not a model asbuilt wrote. Line endings may be \r\n.