\( \newcommand{\E}{\mathrm{E}} \) \( \newcommand{\A}{\mathrm{A}} \) \( \newcommand{\R}{\mathrm{R}} \) \( \newcommand{\N}{\mathrm{N}} \) \( \newcommand{\Q}{\mathrm{Q}} \) \( \newcommand{\Z}{\mathrm{Z}} \) \( \def\ccSum #1#2#3{ \sum_{#1}^{#2}{#3} } \def\ccProd #1#2#3{ \sum_{#1}^{#2}{#3} }\)
CGAL 4.12 - IO Streams
IO Streams Reference

io.png
Andreas Fabri, Geert-Jan Giezeman, and Lutz Kettner
All classes in the CGAL kernel provide input and output operators for IO streams. The basic task of such an operator is to produce a representation of an object that can be written as a sequence of characters on devices as a console, a file, or a pipe. In CGAL we distinguish between a raw ascii, a raw binary and a pretty printing format.


Introduced in: CGAL 1.0
BibTeX: cgal:fgk-ios-12-18a
License: LGPL

All classes in the CGAL kernel provide input and output operators for IO 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.

Classified Reference Pages

Enum

Functions

Classes

Modules

 Stream Operators
 

Classes

class  CGAL::Color
 An object of the class Color is a color available for drawing operations in many CGAL output streams. More...
 
class  CGAL::Input_rep< T, F >
 The definition of Input_rep is completely symmetric to Output_rep. 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::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...
 

Enumerations

enum  CGAL::IO::Mode { CGAL::IO::ASCII = 0, CGAL::IO::BINARY, CGAL::IO::PRETTY }
 All classes in the CGAL Kernel provide input and output operators for IOStreams. More...
 

Functions

IO::Mode CGAL::get_mode (std::ios &s)
 returns the printing mode of the IO stream s. More...
 
IO::Mode CGAL::set_ascii_mode (std::ios &s)
 sets the mode of the IO stream s to be the IO::ASCII mode. More...
 
IO::Mode CGAL::set_binary_mode (std::ios &s)
 
IO::Mode CGAL::set_mode (std::ios &s, IO::Mode m)
 sets the printing mode of the IO stream s. More...
 
IO::Mode CGAL::set_pretty_mode (std::ios &s)
 sets the mode of the IO stream s to be the IO::PRETTY mode. More...
 
bool CGAL::is_ascii (std::ios &s)
 checks if the IO stream s is in IO::ASCII mode. More...
 
bool CGAL::is_binary (std::ios &s)
 checks if the IO stream s is in IO::BINARY mode. More...
 
bool CGAL::is_pretty (std::ios &s)
 checks if the IO stream s is in IO::PRETTY mode. More...
 
template<class T >
Output_rep< T > CGAL::oformat (const T &t)
 Convenience function to construct an output representation (Output_rep) for type T. More...
 
template<class T >
Input_rep< T > CGAL::iformat (const T &t)
 The definition of this function is completely symmetric to oformat().
 
template<class T , typename F >
Output_rep< T, F > CGAL::oformat (const T &t, F)
 Convenience function to construct an output representation (Output_rep) for type T. More...
 

Enumeration Type Documentation

◆ Mode

#include <CGAL/IO/io.h>

All classes in the CGAL Kernel provide input and output operators for IOStreams.

The basic task of such an operator is to produce a representation of an object that can be written as a sequence of characters on devices as a console, a file, or a pipe. The enum Mode distinguish between three different printing formats.

In ASCII mode, numbers e.g. the coordinates of a point or the coefficients of a line, are written in a machine independent format. In BINARY mode, data are written in a binary format, e.g. a double is represented as a sequence of four byte. The format depends on the machine. The mode PRETTY serves mainly for debugging as the type of the geometric object is written, as well as the data defining the object. For example for a point at the origin with Cartesian double coordinates, the output would be PointC2(0.0, 0.0). At the moment CGAL does not provide input operations for pretty printed data. By default a stream is in Ascii mode.

See also
CGAL::set_mode()
CGAL::set_ascii_mode()
CGAL::set_binary_mode()
CGAL::set_pretty_mode()
CGAL::get_mode()
CGAL::is_ascii()
CGAL::is_binary()
CGAL::is_pretty()
Enumerator
ASCII 
BINARY 
PRETTY 

Function Documentation

◆ get_mode()

IO::Mode CGAL::get_mode ( std::ios &  s)

◆ is_ascii()

bool CGAL::is_ascii ( std::ios &  s)

◆ is_binary()

bool CGAL::is_binary ( std::ios &  s)

◆ is_pretty()

bool CGAL::is_pretty ( std::ios &  s)

◆ oformat() [1/2]

template<class T >
Output_rep<T> CGAL::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.

◆ oformat() [2/2]

template<class T , typename F >
Output_rep<T,F> CGAL::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 with formatting tag.

◆ set_ascii_mode()

IO::Mode CGAL::set_ascii_mode ( std::ios &  s)

#include <CGAL/IO/io.h>

sets the mode of the IO stream s to be the IO::ASCII mode.

Returns the previous mode of s.

See also
CGAL::IO::Mode
CGAL::set_mode()
CGAL::set_binary_mode()
CGAL::set_pretty_mode()
CGAL::get_mode()
CGAL::is_ascii()
CGAL::is_binary()
CGAL::is_pretty()

◆ set_binary_mode()

IO::Mode CGAL::set_binary_mode ( std::ios &  s)

#include <CGAL/IO/io.h>

See also
CGAL::IO::Mode
CGAL::set_mode()
CGAL::set_ascii_mode()
CGAL::set_pretty_mode()
CGAL::get_mode()
CGAL::is_ascii()
CGAL::is_binary()
CGAL::is_pretty()

sets the mode of the IO stream s to be the IO::BINARY mode. Returns the previous mode of s.

◆ set_mode()

IO::Mode CGAL::set_mode ( std::ios &  s,
IO::Mode  m 
)

◆ set_pretty_mode()

IO::Mode CGAL::set_pretty_mode ( std::ios &  s)

#include <CGAL/IO/io.h>

sets the mode of the IO stream s to be the IO::PRETTY mode.

Returns the previous mode of s.

See also
CGAL::IO::Mode
CGAL::set_mode()
CGAL::set_ascii_mode()
CGAL::set_binary_mode()
CGAL::get_mode()
CGAL::is_ascii()
CGAL::is_binary()
CGAL::is_pretty()