Page MenuHomePhorge

terminal_colors.h
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

terminal_colors.h

//===-- rosa/support/terminal_colors.h --------------------------*- C++ -*-===//
//
// The RoSA Framework
//
// Distributed under the terms and conditions of the Boost Software License 1.0.
// See accompanying file LICENSE.
//
// If you did not receive a copy of the license file, see
// http://www.boost.org/LICENSE_1_0.txt.
//
//===----------------------------------------------------------------------===//
///
/// \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 \c rosa::terminal::Color values
};
/// Handles \c rosa::terminal::Color values sent to output streams.
///
/// The operator sends terminal commands through \p os to the
/// associated terminal to change text color to \p color.
///
/// \note If \p os is not a terminal output, the terminal commands simply appear
/// as text in the stream.
///
/// \param [in,out] os \c std::ostream to apply \p color to
/// \param color \c rosa::terminal::Color to apply for \p os
///
/// \return \p os after applying \p color to it
///
/// \pre \p color is valid:\code
/// color != Color::NumColors
/// \endcode
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
Sun, Mar 1, 9:38 PM (1 d, 22 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
284747
Default Alt Text
terminal_colors.h (1 KB)

Event Timeline