|
CGAL 6.2 - IO Streams
|
All classes in the CGAL kernel provide input and output operators for I/O streams. CGAL provides three different printing mode, defined in the enum IO::Mode , as well as different functions to set and get the printing mode.
CGAL::IO::ColorCGAL::IO::Basic_color_streambuf<CharT,Traits>CGAL::IO::Color_streambufCGAL::IO::Color_wstreambufCGAL::IO::Basic_color_stream_guard<StreamT>CGAL::IO::Color_stream_guardCGAL::IO::Color_wstream_guardCGAL::IO::Basic_indenting_streambuf<CharT,Traits>CGAL::IO::Indenting_streambufCGAL::IO::Indenting_wstreambufCGAL::IO::Basic_indenting_stream_guard<StreamT>CGAL::IO::Indenting_stream_guardCGAL::IO::Indenting_wstream_guardCGAL::Istream_iterator<T,Stream>CGAL::Ostream_iterator<T,Stream>CGAL::Verbose_ostreamCGAL::Input_rep<T,F>CGAL::Output_rep<T,F>CGAL::IO::make_color_guards()CGAL::IO::stream_supports_color()CGAL::IO::make_indenting_guards()CGAL::IO::get_mode()CGAL::IO::is_ascii()CGAL::IO::is_binary()CGAL::IO::is_pretty()CGAL::IO::set_mode()CGAL::IO::set_ascii_mode()CGAL::IO::set_binary_mode()CGAL::IO::set_pretty_mode()CGAL::operator>>() CGAL::operator<<() CGAL::IO::iformat()CGAL::IO::oformat()CGAL::IO::read_polygon_soup()CGAL::IO::write_polygon_soup()Modules | |
| Stream Operators | |
| I/O Functions | |
| I/O Enums | |
Classes | |
| class | CGAL::IO::Color |
An object of the class Color is a color available for drawing operations in many CGAL output streams. More... | |
| class | CGAL::IO::Basic_color_streambuf< CharT, Traits > |
The class template Basic_color_streambuf wraps another basic_streambuf and automatically adds ANSI color codes to the output. More... | |
| class | CGAL::IO::Basic_color_stream_guard< StreamT > |
| RAII helper class for temporarily installing a color streambuf on a stream. More... | |
| class | CGAL::IO::Basic_indenting_streambuf< CharT, Traits > |
The class template Basic_indenting_streambuf wraps another basic_streambuf and automatically adds indentation at the beginning of each line. More... | |
| class | CGAL::IO::Basic_indenting_stream_guard< StreamT > |
| RAII helper class for temporarily installing an indenting streambuf on a stream. More... | |
| class | CGAL::Output_rep< T, F > |
The purpose of Output_rep is to provide a way to control output formatting that works independently of the object's stream output operator. More... | |
| class | CGAL::Input_rep< T > |
The definition of Input_rep is completely symmetric to Output_rep. More... | |
| class | CGAL::Istream_iterator< T, Stream > |
The class Istream_iterator is an input iterator adaptor for the input stream class Stream and value type T. More... | |
| class | CGAL::Ostream_iterator< T, Stream > |
The class Ostream_iterator is an output iterator adaptor for the output stream class Stream and value type T. More... | |
| class | CGAL::Verbose_ostream |
The class Verbose_ostream can be used as an output stream. More... | |
Typedefs | |
| using | CGAL::IO::Color_streambuf = Basic_color_streambuf< char > |
Type alias for Basic_color_streambuf<char> | |
| using | CGAL::IO::Color_wstreambuf = Basic_color_streambuf< wchar_t > |
Type alias for Basic_color_streambuf<wchar_t> | |
| using | CGAL::IO::Color_stream_guard = Basic_color_stream_guard< std::ostream > |
Type alias for Basic_color_stream_guard<std::ostream> | |
| using | CGAL::IO::Color_wstream_guard = Basic_color_stream_guard< std::wostream > |
Type alias for Basic_color_stream_guard<std::wostream> | |
| using | CGAL::IO::Indenting_streambuf = Basic_indenting_streambuf< char > |
Type alias for Basic_indenting_streambuf<char> | |
| using | CGAL::IO::Indenting_wstreambuf = Basic_indenting_streambuf< wchar_t > |
Type alias for Basic_indenting_streambuf<wchar_t> | |
| using | CGAL::IO::Indenting_stream_guard = Basic_indenting_stream_guard< std::ostream > |
Type alias for basic_indenting_stream_guard<std::ostream> | |
| using | CGAL::IO::Indenting_wstream_guard = Basic_indenting_stream_guard< std::wostream > |
Type alias for basic_indenting_stream_guard<std::wostream> | |
Functions | |
| template<typename... Streams> | |
| auto | CGAL::IO::make_color_guards (Ansi_color color, Streams &... streams) |
| creates color guards for multiple streams simultaneously. | |
| template<typename... Streams> | |
| auto | CGAL::IO::make_color_guards (const std::vector< Ansi_color > &colors, Streams &... streams) |
| creates color guards for multiple streams with multiple colors. | |
| template<typename CharT , typename Traits > | |
| bool | CGAL::IO::stream_supports_color (const std::basic_ostream< CharT, Traits > &stream) |
| checks if a stream is attached to a terminal that supports colors. | |
| template<typename... Streams> | |
| auto | CGAL::IO::make_indenting_guards (int spaces_per_level, Streams &... streams) |
| creates indenting guards for multiple streams simultaneously. | |
| template<typename... Streams> | |
| auto | CGAL::IO::make_indenting_guards (const std::string &indent_string, Streams &... streams) |
| creates indenting guards for multiple streams with a custom indent string. | |
| template<class T > | |
| Output_rep< T > | CGAL::IO::oformat (const T &t) |
Convenience function to construct an output representation (Output_rep) for type T. | |
| template<class T , class F > | |
| Output_rep< T, F > | CGAL::IO::oformat (const T &t, F format) |
Convenience function to construct an output representation (Output_rep) for type T. | |
| template<class T > | |
| Input_rep< T > | CGAL::IO::iformat (T &t) |
The definition of this function is completely symmetric to oformat(). | |
| Mode | CGAL::IO::get_mode (std::ios &s) |
returns the printing mode of the IO stream s. | |
| Mode | CGAL::IO::set_ascii_mode (std::ios &s) |
sets the mode of the IO stream s to be the ASCII mode. | |
| Mode | CGAL::IO::set_binary_mode (std::ios &s) |
sets the mode of the IO stream s to be the BINARY mode. | |
| Mode | CGAL::IO::set_pretty_mode (std::ios &s) |
sets the mode of the IO stream s to be the PRETTY mode. | |
| Mode | CGAL::IO::set_mode (std::ios &s, Mode m) |
sets the printing mode of the IO stream s. | |
| bool | CGAL::IO::is_pretty (std::ios &s) |
checks if the IO stream s is in PRETTY mode. | |
| bool | CGAL::IO::is_ascii (std::ios &s) |
checks if the IO stream s is in ASCII mode. | |
| bool | CGAL::IO::is_binary (std::ios &s) |
checks if the IO stream s is in BINARY mode. | |
| Mode CGAL::IO::get_mode | ( | std::ios & | s | ) |
#include <CGAL/IO/io.h>
returns the printing mode of the IO stream s.
| bool CGAL::IO::is_ascii | ( | std::ios & | s | ) |
#include <CGAL/IO/io.h>
checks if the IO stream s is in ASCII mode.
| bool CGAL::IO::is_binary | ( | std::ios & | s | ) |
#include <CGAL/IO/io.h>
checks if the IO stream s is in BINARY mode.
| bool CGAL::IO::is_pretty | ( | std::ios & | s | ) |
#include <CGAL/IO/io.h>
checks if the IO stream s is in PRETTY mode.
| auto CGAL::IO::make_color_guards | ( | Ansi_color | color, |
| Streams &... | streams | ||
| ) |
#include <CGAL/IO/Color_ostream.h>
creates color guards for multiple streams simultaneously.
This helper function creates Basic_color_stream_guard objects for multiple streams at once. All streams will use the same color settings, and their original streambufs will be automatically restored when the guards go out of scope. The guards are returned in a tuple.
| Streams | The stream types (deduced from arguments) |
| color | The color to apply |
| streams | The streams to apply colors to |
Example usage:
| auto CGAL::IO::make_color_guards | ( | const std::vector< Ansi_color > & | colors, |
| Streams &... | streams | ||
| ) |
#include <CGAL/IO/Color_ostream.h>
creates color guards for multiple streams with multiple colors.
This overload allows specifying multiple colors to combine (e.g., bold + red).
| Streams | The stream types (deduced from arguments) |
| colors | Vector of colors to combine |
| streams | The streams to apply colors to |
| auto CGAL::IO::make_indenting_guards | ( | const std::string & | indent_string, |
| Streams &... | streams | ||
| ) |
#include <CGAL/IO/Indenting_ostream.h>
creates indenting guards for multiple streams with a custom indent string.
This overload allows specifying a custom indentation string instead of a number of spaces.
| Streams | The stream types (deduced from arguments) |
| indent_string | The indentation string to use |
| streams | The streams to apply indentation to |
| auto CGAL::IO::make_indenting_guards | ( | int | spaces_per_level, |
| Streams &... | streams | ||
| ) |
#include <CGAL/IO/Indenting_ostream.h>
creates indenting guards for multiple streams simultaneously.
This helper function creates Basic_indenting_stream_guard objects for multiple streams at once. All streams will use the same indentation settings, and their original streambufs will be automatically restored when the guards go out of scope. The guards are returned in a tuple.
| Streams | The stream types (deduced from arguments) |
| spaces_per_level | Number of spaces per indentation level |
| streams | The streams to apply indentation to |
Example usage:
| Output_rep< T > CGAL::IO::oformat | ( | const T & | t | ) |
#include <CGAL/IO/io.h>
Convenience function to construct an output representation (Output_rep) for type T.
Generic IO for type T.
| Output_rep< T, F > CGAL::IO::oformat | ( | const T & | t, |
| F | format | ||
| ) |
#include <CGAL/IO/io.h>
Convenience function to construct an output representation (Output_rep) for type T.
Generic IO for type T with formatting tag.
| Mode CGAL::IO::set_ascii_mode | ( | std::ios & | s | ) |
#include <CGAL/IO/io.h>
sets the mode of the IO stream s to be the ASCII mode.
Returns the previous mode of s.
| Mode CGAL::IO::set_binary_mode | ( | std::ios & | s | ) |
#include <CGAL/IO/io.h>
sets the mode of the IO stream s to be the BINARY mode.
Returns the previous mode of s.
#include <CGAL/IO/io.h>
sets the printing mode of the IO stream s.
| Mode CGAL::IO::set_pretty_mode | ( | std::ios & | s | ) |
#include <CGAL/IO/io.h>
sets the mode of the IO stream s to be the PRETTY mode.
Returns the previous mode of s.
| bool CGAL::IO::stream_supports_color | ( | const std::basic_ostream< CharT, Traits > & | stream | ) |
#include <CGAL/IO/Color_ostream.h>
checks if a stream is attached to a terminal that supports colors.
This function checks if the given output stream is connected to a terminal (TTY) that can display ANSI color codes. It performs the following checks:
isatty()TERM environment variable indicates color supportNO_COLOR environment variable (if set, colors are disabled)CLICOLOR_FORCE environment variable (if set, colors are enabled)| stream | The output stream to check (e.g., std::cout, std::cerr) |
true if the stream supports color output, false otherwiseExample usage: