Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F386238
terminal_colors.h
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Size
1 KB
Referenced Files
None
Subscribers
None
terminal_colors.h
View Options
/***************************************************************************//**
*
* \file rosa/support/terminal_colors.h
*
* \author David Juhasz (david.juhasz@tuwien.ac.at)
*
* \date 2017
*
* \brief Facility for printing colorized text to terminals supporting it.
*
******************************************************************************/
#ifndef ROSA_SUPPORT_TERMINAL_COLORS_H
#define ROSA_SUPPORT_TERMINAL_COLORS_H
#include
<ostream>
namespace
rosa
{
/// Encloses entities related to terminal I/O.
namespace
terminal
{
/// Text colors for colorizable terminals.
enum
class
Color
{
Default
,
Black
,
Red
,
Green
,
Yellow
,
Blue
,
Magenta
,
Cyan
,
Lightgrey
,
Darkgrey
,
Lightred
,
Lightgreen
,
Lightyellow
,
Lightblue
,
LightMagenta
,
Lightcyan
,
White
,
NumColors
///< Number of `rosa::terminal::Color` values
};
/// Handles `rosa::terminal::Color` values sent to output streams.
///
/// The operator sends terminal commands through `os` to the
/// associated terminal to change text color to `color`.
///
/// \note If `os` is not a terminal output, the terminal commands simply appear
/// as text in the stream.
///
/// \param [inout] os `ostream` to apply `color` to
/// \param color `Color` to apply for `os`
///
/// \pre `color` is valid:\code
/// color != Color::NumColors
/// \endcoed
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
Color
color
);
}
// End namespace terminal
}
// End namespace rosa
#endif
// ROSA_SUPPORT_TERMINAL_COLORS_H
File Metadata
Details
Attached
Mime Type
text/x-c++
Expires
Wed, Jul 2, 12:23 AM (4 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
157098
Default Alt Text
terminal_colors.h (1 KB)
Attached To
Mode
R20 SoC_Rosa_repo
Attached
Detach File
Event Timeline
Log In to Comment