|
CGAL 6.2 - IO Streams
|
#include <CGAL/IO/Color_ostream.h>
RAII helper class for temporarily installing a color streambuf on a stream.
This class automatically restores the original streambuf when it goes out of scope. It provides a convenient way to add colors to output streams within a specific scope.
| StreamT | The stream type (e.g., std::ostream, std::wostream) |
Public Types | |
| using | char_type = typename StreamT::char_type |
| Character type. | |
| using | traits_type = typename StreamT::traits_type |
| Character traits type. | |
| using | streambuf_type = Basic_color_streambuf< char_type, traits_type > |
| Type of the color streambuf. | |
| using | wrapped_streambuf_type = std::basic_streambuf< char_type, traits_type > |
| Type of the wrapped streambuf. | |
| using | string = std::basic_string< char_type > |
| String type matching character type. | |
Public Member Functions | |
| template<typename... AnsiColors> | |
| Basic_color_stream_guard (StreamT &stream, AnsiColors... colors) | |
| constructs and installs a color streambuf with one or more colors. | |
| ~Basic_color_stream_guard () | |
| Destructor - restores the original streambuf. | |
|
explicit |
constructs and installs a color streambuf with one or more colors.
| AnsiColors | Variadic list of Ansi_color values |
| stream | The stream to modify |
| colors | One or more colors to combine (e.g., Ansi_color::Bold, Ansi_color::Red) |