Portals0.7.0 · dev (544a5c68c72e · 2026-11-28 UTC)
Loading...
Searching...
No Matches
portals::CellFormat< T > Class Template Reference

Owning single-value formatter for the existing table callback contract. More...

#include <text_format.hpp>

Public Member Functions

 CellFormat (std::format_string< const T & > pattern, WidthPolicy policy={})
GraphemeText operator() (const T &value) const

Detailed Description

template<class T>
class portals::CellFormat< T >

Owning single-value formatter for the existing table callback contract.

Template Parameters
TStandard-formattable field type, borrowed as const T & during invocation. The format string and policy are owned. Direct calls propagate formatting/allocation exceptions and bad_expected_access<TextError>; table preparation retains its existing CALLBACK_FAILED translation. Use formatText for explicit TextError handling instead.

Constructor & Destructor Documentation

◆ CellFormat()

template<class T>
portals::CellFormat< T >::CellFormat ( std::format_string< const T & > pattern,
WidthPolicy policy = {} )
inlineexplicit
Parameters
patternFormat specification checked at compile time for const T &.
policyCaptured display policy, which must match the receiving table.

Member Function Documentation

◆ operator()()

template<class T>
GraphemeText portals::CellFormat< T >::operator() ( const T & value) const
inline
Parameters
valueField borrowed for this synchronous invocation; never retained.
Returns
Independent formatted and validated text.
Exceptions
std::bad_expected_access<TextError>If formatted bytes fail text validation.
std::format_errorIf a custom standard formatter fails.
std::bad_allocIf formatting or text allocation fails.

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