cpp-terminal 1.0.0
Small C++ library for writing multiplatform terminal applications
Loading...
Searching...
No Matches
terminal_impl.hpp
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
10#pragma once
11
14
15#include <cstddef>
16#include <string>
17
18namespace Term
19{
20
21namespace Private {
22 class Signals;
23}
24
26{
27public:
28 friend class Private::Signals;
29 ~Terminal() noexcept;
30 Terminal() noexcept;
31 Terminal(const Terminal&) = delete;
32 Terminal(Terminal&&) = delete;
33 Terminal& operator=(Terminal&&) = delete;
34 Terminal& operator=(const Terminal&) = delete;
35 template<typename... Args> void setOptions(const Args&&... args)
36 {
37 m_options = {args...};
39 }
40 Term::Options getOptions() const noexcept;
41 // clear the screen and the scroll-back buffer
42 std::string clear() const noexcept;
43
44private:
48 static void store_and_restore() noexcept;
49
54 void setMode() const;
55
56 void setOptions();
57 void applyOptions() const;
58
59 static std::size_t setMouseEvents();
60 static std::size_t unsetMouseEvents();
61 static std::size_t setFocusEvents();
62 static std::size_t unsetFocusEvents();
63
64 static void set_unset_utf8();
66 void clean();
67};
68
69} // namespace Term
void setOptions(const Args &&... args)
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 setFocusEvents()
static std::size_t setMouseEvents()
static std::size_t unsetMouseEvents()
~Terminal() noexcept
Term::Options getOptions() const noexcept
Term::Options m_options
static std::size_t unsetFocusEvents()
Definition args.cpp:13