Page MenuHomePhorge

terminal_colors.h
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

terminal_colors.h

/***************************************************************************//**
*
* \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

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)

Event Timeline