UtilsLite
Utilities for C++ programming
Loading...
Searching...
No Matches
Utils::Table::Cell Class Reference

Represents a cell in a table with alignment, content, and optional column span. More...

#include <Table.hxx>

Public Member Functions

 Cell ()=default
 Default constructor for an empty cell.
 
 Cell (Table *table, string_view val="", integer col_span=1)
 Constructs a cell with a value and optional column span.
 
string_view value () const
 
void value (string_view val)
 
Alignment alignment () const
 
void alignment (Alignment const &align)
 
integer col_span () const
 
void col_span (integer col_span)
 
integer width (integer col) const
 
integer height () const
 
integer maximum_line_width () const
 
string line (integer idx) const
 
string render (integer line, integer col) const
 

Static Public Member Functions

static void trim_line (std::string &line)
 

Detailed Description

Represents a cell in a table with alignment, content, and optional column span.

The Cell class manages the content of a single cell in the table. It allows specification of alignment, column span, and other properties.

Constructor & Destructor Documentation

◆ Cell() [1/2]

Utils::Table::Cell::Cell ( )
default

Default constructor for an empty cell.

◆ Cell() [2/2]

Utils::Table::Cell::Cell ( Table * table,
string_view val = "",
integer col_span = 1 )
explicit

Constructs a cell with a value and optional column span.

Parameters
tablePointer to the table containing the cell.
valThe string value to be displayed in the cell.
col_spanThe number of columns the cell should span.

Member Function Documentation

◆ alignment() [1/2]

Alignment Utils::Table::Cell::alignment ( ) const
inline

◆ alignment() [2/2]

void Utils::Table::Cell::alignment ( Alignment const & align)
inline

◆ col_span() [1/2]

integer Utils::Table::Cell::col_span ( ) const
inline

◆ col_span() [2/2]

void Utils::Table::Cell::col_span ( integer col_span)
inline

◆ height()

integer Utils::Table::Cell::height ( ) const

◆ line()

string Utils::Table::Cell::line ( integer idx) const

◆ maximum_line_width()

integer Utils::Table::Cell::maximum_line_width ( ) const

◆ render()

string Utils::Table::Cell::render ( integer line,
integer col ) const

◆ trim_line()

static void Utils::Table::Cell::trim_line ( std::string & line)
static

◆ value() [1/2]

string_view Utils::Table::Cell::value ( ) const
inline

◆ value() [2/2]

void Utils::Table::Cell::value ( string_view val)
inline

◆ width()

integer Utils::Table::Cell::width ( integer col) const

The documentation for this class was generated from the following file: