//===-- rosa/support/terminal_colors.h --------------------------*- C++ -*-===//
//
//                                 The RoSA Framework
//
//===----------------------------------------------------------------------===//
///
/// \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
