OTest2
A C++ testing framework
terminaldriver.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 Ondrej Starek
3  *
4  * This file is part of OTest2.
5  *
6  * OTest2 is free software: you can redistribute it and/or modify it under
7  * the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation, either version 3 of the License,
9  * or (at your option) any later version.
10  *
11  * OTest2 is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14  * License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with OTest2. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef OTest2__INCLUDE_OTEST2_TERMINALDRIVER_H_
21 #define OTest2__INCLUDE_OTEST2_TERMINALDRIVER_H_
22 
23 #include <iosfwd>
25 
26 namespace OTest2 {
27 
35  private:
36  struct Impl;
37  Impl* pimpl;
38 
39  public:
40  /* -- avoid copying */
42  const TerminalDriver&) = delete;
44  const TerminalDriver&) = delete;
45 
53  explicit TerminalDriver(
54  int handle_);
55 
60 
68  void setForeground(
69  std::streambuf& buffer_,
70  Color color_);
71 
78  void setBackground(
79  std::streambuf& buffer_,
80  Color color_);
81 
88  void setTextStyle(
89  std::streambuf& buffer_,
90  Style style_);
91 
98  void cleanAttributes(
99  std::streambuf& buffer_);
100 };
101 
102 } /* namespace OTest2 */
103 
104 #endif /* OTest2__INCLUDE_OTEST2_TERMINALDRIVER_H_ */
OTest2::Style
Style
Style of shown text.
Definition: reporterattributes.h:44
OTest2::TerminalDriver::cleanAttributes
void cleanAttributes(std::streambuf &buffer_)
Clean all previously set terminal attributes.
Definition: terminaldriver.cpp:378
OTest2::TerminalDriver::setTextStyle
void setTextStyle(std::streambuf &buffer_, Style style_)
Change the text style.
Definition: terminaldriver.cpp:372
OTest2::TerminalDriver::~TerminalDriver
~TerminalDriver()
Dtor.
Definition: terminaldriver.cpp:356
OTest2::TerminalDriver::TerminalDriver
TerminalDriver(const TerminalDriver &)=delete
OTest2::TerminalDriver::operator=
TerminalDriver & operator=(const TerminalDriver &)=delete
OTest2::TerminalDriver
Terminal driver.
Definition: terminaldriver.h:34
OTest2::Color
Color
List of colors supported by the reporters.
Definition: reporterattributes.h:30
OTest2
Definition: assertbean.h:25
OTest2::TerminalDriver::setBackground
void setBackground(std::streambuf &buffer_, Color color_)
Set background color.
Definition: terminaldriver.cpp:366
reporterattributes.h
OTest2::TerminalDriver::setForeground
void setForeground(std::streambuf &buffer_, Color color_)
Change the foreground color of the text.
Definition: terminaldriver.cpp:360