OTest2
A C++ testing framework
Classes | Public Member Functions | List of all members
OTest2::TerminalDriver Class Reference

Terminal driver. More...

#include <terminaldriver.h>

Classes

struct  Impl
 

Public Member Functions

 TerminalDriver (const TerminalDriver &)=delete
 
TerminalDriveroperator= (const TerminalDriver &)=delete
 
 TerminalDriver (int handle_)
 Ctor. More...
 
 ~TerminalDriver ()
 Dtor. More...
 
void setForeground (std::streambuf &buffer_, Color color_)
 Change the foreground color of the text. More...
 
void setBackground (std::streambuf &buffer_, Color color_)
 Set background color. More...
 
void setTextStyle (std::streambuf &buffer_, Style style_)
 Change the text style. More...
 
void cleanAttributes (std::streambuf &buffer_)
 Clean all previously set terminal attributes. More...
 

Detailed Description

Terminal driver.

This is a driver object which allows manipulation with terminal attributes like text color or boldness.

Definition at line 34 of file terminaldriver.h.

Constructor & Destructor Documentation

◆ TerminalDriver() [1/2]

OTest2::TerminalDriver::TerminalDriver ( const TerminalDriver )
delete

◆ TerminalDriver() [2/2]

OTest2::TerminalDriver::TerminalDriver ( int  handle_)
explicit

Ctor.

Parameters
handle_File handle of the output stream. The handle is used to detect whether the output is a terminal and for initialization of the terminfo library.

Definition at line 350 of file terminaldriver.cpp.

◆ ~TerminalDriver()

OTest2::TerminalDriver::~TerminalDriver ( )

Dtor.

Definition at line 356 of file terminaldriver.cpp.

Member Function Documentation

◆ cleanAttributes()

void OTest2::TerminalDriver::cleanAttributes ( std::streambuf &  buffer_)

Clean all previously set terminal attributes.

Parameters
buffer_A stream buffer which the control sequence is written into.

Definition at line 378 of file terminaldriver.cpp.

◆ operator=()

TerminalDriver& OTest2::TerminalDriver::operator= ( const TerminalDriver )
delete

◆ setBackground()

void OTest2::TerminalDriver::setBackground ( std::streambuf &  buffer_,
Color  color_ 
)

Set background color.

Parameters
buffer_A buffer which the control sequence is written into.
color_The new background color

Definition at line 366 of file terminaldriver.cpp.

◆ setForeground()

void OTest2::TerminalDriver::setForeground ( std::streambuf &  buffer_,
Color  color_ 
)

Change the foreground color of the text.

Parameters
buffer_A stream buffer which the control sequence is written into.
color_The new color of the text

Definition at line 360 of file terminaldriver.cpp.

◆ setTextStyle()

void OTest2::TerminalDriver::setTextStyle ( std::streambuf &  buffer_,
Style  style_ 
)

Change the text style.

Parameters
buffer_A stream buffer which the control sequence is written into.

Definition at line 372 of file terminaldriver.cpp.


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