HIPO  4.3.0
High Performance Output data format for experimental physics
ascii::Style Class Reference

Combines foreground, background, and text decorations into a terminal style. More...

#include <style.h>

Public Member Functions

 Style ()
 Default constructor. Initializes with reset colors and no decorations. More...
 
Stylefg (Foreground fg)
 Set the foreground color for this style. More...
 
Stylebg (Background bg)
 Set the background color for this style. More...
 
StyleAddDecoration (Decoration decoration)
 Add a text decoration to this style. More...
 

Friends

std::ostream & operator<< (std::ostream &os, const Style &val)
 Output the style escape sequences to an output stream. Outputs all decorations first, then foreground and background colors. More...
 

Detailed Description

Combines foreground, background, and text decorations into a terminal style.

A Style encapsulates the visual properties for terminal output, including the foreground color, background color, and any text decorations (bold, italic, underline, etc.). Provides a fluent interface for chaining method calls.

Definition at line 19 of file style.h.

Constructor & Destructor Documentation

◆ Style()

ascii::Style::Style ( )
inline

Default constructor. Initializes with reset colors and no decorations.

Definition at line 22 of file style.h.

Member Function Documentation

◆ AddDecoration()

Style& ascii::Style::AddDecoration ( Decoration  decoration)
inline

Add a text decoration to this style.

Parameters
decorationthe Decoration to add (bold, italic, underline, etc.)
Returns
a reference to this Style for method chaining

Definition at line 51 of file style.h.

◆ bg()

Style& ascii::Style::bg ( Background  bg)
inline

Set the background color for this style.

Parameters
bgthe Background color to apply
Returns
a reference to this Style for method chaining

Definition at line 41 of file style.h.

◆ fg()

Style& ascii::Style::fg ( Foreground  fg)
inline

Set the foreground color for this style.

Parameters
fgthe Foreground color to apply
Returns
a reference to this Style for method chaining

Definition at line 31 of file style.h.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const Style val 
)
friend

Output the style escape sequences to an output stream. Outputs all decorations first, then foreground and background colors.

Parameters
osthe output stream
valthe Style to output
Returns
the output stream

Definition at line 61 of file style.h.


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