cpp-terminal 1.0.0
Small C++ library for writing multiplatform terminal applications
Loading...
Searching...
No Matches
terminal_impl.cpp
Go to the documentation of this file.
1/*
2* cpp-terminal
3* C++ library for writing multi-platform terminal applications.
4*
5* SPDX-FileCopyrightText: 2019-2024 cpp-terminal
6*
7* SPDX-License-Identifier: MIT
8*/
9
11
18#include "cpp-terminal/terminal.hpp" //FIXME avoid recursion
19
21
23try
24{
25 store_and_restore();
26 setMode(); //Save the default cpp-terminal mode done in store_and_restore();
27 set_unset_utf8();
28}
29catch(...)
30{
32}
33
35{
36 unsetFocusEvents();
37 unsetMouseEvents();
38 if(getOptions().has(Option::NoCursor)) { Term::Private::out.write(cursor_on()); }
40 set_unset_utf8();
41 store_and_restore();
42}
43
45try
46{
47 clean();
48}
49catch(...)
50{
52}
53
55{
57 if(getOptions().has(Option::NoCursor)) { Term::Private::out.write(cursor_off()); }
58 setMode();
59}
std::size_t write(const std::string &str) const
Definition file.cpp:101
void applyOptions() const
Terminal() noexcept
~Terminal() noexcept
Term::Options getOptions() const noexcept
Term::Options m_options
OutputFileHandler & out
Definition file.cpp:44
std::string screen_save()
Definition screen.cpp:22
std::string style(const Term::Style &style)
Definition style.cpp:12
@ ClearScreen
Clear the screen (and restore its states when the program stops).
@ NoCursor
Hide the cursor (and restore its states when the program stops).
std::string cursor_off()
Definition cursor.cpp:28
@ Reset
resets all attributes (styles and colors)
std::string cursor_move(const std::size_t &row, const std::size_t &column)
Definition cursor.cpp:32
std::string screen_load()
Definition screen.cpp:27
std::string cursor_on()
Definition cursor.cpp:30
std::string clear_buffer()
Definition terminal.cpp:23