termstyle 1.0.0-pre.3
An open-source C++ header file that enables developers to easily define and apply customizable style presets for terminal outputs such as warnings, infos, and errors.
Loading...
Searching...
No Matches
termstyle::OnExit Class Reference

The OnExit class is a helper class that performs an action when it goes out of scope. More...

#include <termstyle.hpp>

Public Member Functions

 ~OnExit ()
 Destructor for the OnExit class.
 

Detailed Description

The OnExit class is a helper class that performs an action when it goes out of scope.

This class is designed to be used with the RAII (Resource Acquisition Is Initialization) idiom. When an object of the OnExit class is created, it performs the specified action in its destructor when it goes out of scope, regardless of how the scope is exited (e.g., normal exit, exception, etc.).

In this specific implementation, the OnExit class is used to restore the terminal style by printing the restore code when the object goes out of scope.

Constructor & Destructor Documentation

◆ ~OnExit()

termstyle::OnExit::~OnExit ( )
inline

Destructor for the OnExit class.

This destructor is responsible for performing the specified action when the OnExit object goes out of scope. In this implementation, it prints the restore code to restore the terminal style.


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