nxt::vterm::Terminal::ScreenSnapshot struct

Dense copy of the current screen cells.

Public types

using cell_view_t = std::experimental::mdspan<Cell, mdspan_extents>
Mutable 2D view over the snapshot cells.
using const_cell_view_t = std::experimental::mdspan<const Cell, mdspan_extents>
Const 2D view over the snapshot cells.
using mdspan_extents = std::experimental::extents<int, std::dynamic_extent, std::dynamic_extent>
Dynamic extents used by the mdspan views.

Constructors, destructors, conversion operators

ScreenSnapshot(int r, int c)
Allocate a snapshot with r * c cells.

Public functions

template <typename Pred>
auto all_of(Pred&& pred) const →  bool
True when every cell satisfies pred.
template <typename Pred>
auto any_of(Pred&& pred) const →  bool
True when any cell satisfies pred.
template <typename Pred>
auto count_if(Pred&& pred) const →  int
Count cells satisfying pred.
auto view() →  cell_view_t noexcept
Mutable 2D view into cells.
auto view() const →  const_cell_view_t noexcept
Const 2D view into cells.

Public variables

std::vector<Cell> cells
Row-major cell storage.
int rows
Snapshot row count.
int cols
Snapshot column count.