Bugz Door Project
Public Member Functions | Public Attributes | Private Attributes | List of all members
door::Render Class Reference

Rendering a string with ANSIColor. More...

#include <door.h>

Public Member Functions

 Render (const std::string txt)
 
void append (ANSIColor color, int len=1)
 
void output (std::ostream &os)
 

Public Attributes

std::vector< ColorOutputoutputs
 Vector of ColorOutput object.
 

Private Attributes

std::string text
 Complete text to be rendered.
 

Detailed Description

Rendering a string with ANSIColor.

This holds the string, and a vector that contains ColorOutput parts.

See also
Render::output()

Constructor & Destructor Documentation

◆ Render()

door::Render::Render ( const std::string  txt)

Construct a new Render:: Render object

Render consists of constant text, and vector of ColorOutput

Parameters
txtText

Member Function Documentation

◆ append()

void door::Render::append ( ANSIColor  color,
int  len = 1 
)

Create render output.

Call this for each section you want to colorize.

Parameters
color
len

◆ output()

void door::Render::output ( std::ostream &  os)

Output the Render.

This consists of going through the vector, getting the fragment (from pos and len), and outputting the color and fragment.

Parameters
os

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