ScreenSnapshot struct
#include <nxt/vterm.hpp>
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 * ccells.
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.