xtd 0.2.0
Loading...
Searching...
No Matches
background_color.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "console.hpp"
6#include "object.hpp"
7
9namespace xtd {
24 class background_color final : public object {
25 public:
27
35 explicit background_color(console_color color) : color(color) {}
37
39 friend std::ostream& operator <<(std::ostream& os, const background_color& color) {
40 if (!console::is_output_redirected() && os.rdbuf() == console::out.rdbuf())
41 console::background_color(color.color);
42 return os;
43 }
45
46 private:
47 console_color color ;
48 };
49}
Represent background color output manipulator class.
Definition background_color.hpp:24
background_color(console_color color)
Sets the background color of the console.
Definition background_color.hpp:35
static console_color background_color()
Gets the background color of the console.
static std::ostream out
Gets the standard output stream. A std::basic_ostream<char_t> that represents the standard output str...
Definition console.hpp:52
static bool is_output_redirected()
Gets a value that indicates whether the output stream has been redirected from the standard output st...
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:42
Contains xtd::console class.
console_color
Specifies constants that define foreground and background colors for the console.
Definition console_color.hpp:20
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10
Contains xtd::object class.