Raxol.Terminal.ScreenBuffer.DataAdapter (Raxol v2.0.1)
View SourceData structure adapter for ScreenBuffer operations.
Provides bidirectional conversion between the two buffer formats:
- ScreenBuffer.Core format:
:cells(list of lists of Cell structs) - LineOperations format:
:lines(map with integer keys to line lists)
This adapter allows seamless interoperability between different buffer operation layers without requiring architectural changes.
Summary
Functions
Convert buffer from cells format to lines format.
Create empty cells structure for initialization.
Create an empty line with the specified width and style.
Get a line from buffer regardless of format.
Check if buffer uses cells format (list of lists).
Check if buffer uses lines format (map).
Convert buffer from lines format back to cells format.
Set a line in buffer regardless of format.
Execute an operation function with the buffer temporarily in lines format.
Functions
Convert buffer from cells format to lines format.
Transforms buffer.cells (list of lists) into a :lines map
where keys are row indices and values are cell lists.
Create empty cells structure for initialization.
Create an empty line with the specified width and style.
Get a line from buffer regardless of format.
Check if buffer uses cells format (list of lists).
Check if buffer uses lines format (map).
Convert buffer from lines format back to cells format.
Transforms :lines map back into buffer.cells (list of lists).
Set a line in buffer regardless of format.
Execute an operation function with the buffer temporarily in lines format.
This is the key function that allows LineOperations to work with ScreenBuffer.Core structures without permanent conversion.
The operation function can return either:
- A modified buffer map
- A tuple where the second element is the modified buffer map