xtd.console - Reference Guide  0.0.1
Modern c++17 library to manage terminal on Windows, macOS and Linux.
foreground_color.hpp
Go to the documentation of this file.
1 #pragma once
4 #include "basic_console.hpp"
5 
7 namespace xtd {
10  class foreground_color final {
11  public:
12  explicit foreground_color(console_color color) : color_(color) {}
13 
15  template<typename char_t>
16  friend std::basic_ostream<char_t>& operator <<(std::basic_ostream<char_t>& os, const foreground_color& color) {
17  if (os.rdbuf() == __get_out_rdbuf<char_t>() || os.rdbuf() == __get_err_rdbuf<char_t>())
19  return os;
20  }
22 
23  private:
24  console_color color_;
25  };
26 }
Represent foreground color output manipulator class.
Definition: foreground_color.hpp:10
console_color
Specifies constants that define foreground and background colors for the console. ...
Definition: console_color.hpp:11
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: background_color.hpp:7
Contains xtd::basic_console class.
static console_color foreground_color() noexcept
Gets the foreground color of the console.
Definition: basic_console.hpp:193