cpp-terminal
1.0.0
Small C++ library for writing multiplatform terminal applications
Loading...
Searching...
No Matches
terminal.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
10
#include "
cpp-terminal/terminal.hpp
"
11
12
#include <array>
13
14
namespace
15
{
16
std::array<char,
sizeof
(
Term::Terminal
)> terminal_buffer;
//NOLINT(fuchsia-statically-constructed-objects)
17
}
// namespace
18
19
Term::Terminal
&
Term::terminal
=
reinterpret_cast<
Term::Terminal
&
>
(::terminal_buffer);
//NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)
20
21
std::string
Term::terminal_title
(
const
std::string& title) {
return
"\u001b]0;"
+ title +
'\a'
; }
22
23
std::string
Term::clear_buffer
() {
return
"\u001b[3J"
; }
Term::Terminal
Definition
terminal_impl.hpp:22
Term::terminal
Term::Terminal & terminal
Definition
terminal.cpp:19
Term::terminal_title
std::string terminal_title(const std::string &title)
Definition
terminal.cpp:21
Term::clear_buffer
std::string clear_buffer()
Definition
terminal.cpp:23
terminal.hpp
cpp-terminal
terminal.cpp
Generated by
1.11.0