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-2025 cpp-terminal
6*
7* SPDX-License-Identifier: MIT
8*/
9
11
18
19std::string Term::Terminal::clear() const noexcept { return "\u001b[3J"; }
20
22
23#ifdef _WIN32
24 #pragma warning(push)
25 #pragma warning(disable : 4297)
26#endif
27
29try
30{
32 setMode(); //Save the default cpp-terminal mode done in store_and_restore();
34}
35catch(...)
36{
38}
39
41try
42{
43 clean();
44}
45catch(...)
46{
48}
49
50#ifdef _WIN32
51 #pragma warning(pop)
52#endif
53
63
void setMode() const
Set mode raw/cooked.
static void set_unset_utf8()
static void store_and_restore() noexcept
Store and restore the default state of the terminal.
void applyOptions() const
Terminal() noexcept
std::string clear() const noexcept
static std::size_t unsetMouseEvents()
~Terminal() noexcept
Term::Options getOptions() const noexcept
Term::Options m_options
static std::size_t unsetFocusEvents()
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).
Definition options.hpp:26
@ NoCursor
Hide the cursor (and restore its states when the program stops).
Definition options.hpp:31
std::string cursor_off()
Definition cursor.cpp:24
@ Reset
resets all attributes (styles and colors)
Definition style.hpp:26
std::string cursor_move(const std::size_t &row, const std::size_t &column)
Definition cursor.cpp:28
std::string screen_load()
Definition screen.cpp:27
std::string cursor_on()
Definition cursor.cpp:26