CGAL 6.0.2 - IO Streams

Loading...
Searching...
No Matches
Modules | Classes | Functions
I/O Streams Reference

##

Andreas Fabri, Geert-Jan Giezeman, and Lutz Kettner
All classes in the CGAL kernel provide input and output operators for I/O 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-25b
License: LGPL

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.

## Classified Reference Pages

## Enum

- `CGAL::IO::Mode`

## Classes

- `CGAL::IO::Color`
- `CGAL::Istream_iterator<T,Stream>`
- `CGAL::Ostream_iterator<T,Stream>`
- `CGAL::Verbose_ostream`
- `CGAL::Input_rep<T,F>`
- `CGAL::Output_rep<T,F>`

## Functions

- `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()`

## I/O Functions

- `CGAL::IO::read_polygon_soup()`
- `CGAL::IO::write_polygon_soup()`
- I/O for STL files
- I/O for PLY files
- I/O for OBJ files
- I/O for OFF files
- I/O for GOCAD files
- I/O for VTK files
- I/O for 3MF files
- I/O for WKT files

## 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::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...
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...

## Functions
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.

## Function Documentation

## ◆ get_mode()

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

`#include <CGAL/IO/io.h>`

returns the printing mode of the IO stream `s`.

`CGAL::IO::Mode`

See also
  `CGAL::IO::set_mode()`
  `CGAL::IO::set_ascii_mode()`
  `CGAL::IO::set_binary_mode()`
  `CGAL::IO::set_pretty_mode()`
  `CGAL::IO::is_ascii()`
  `CGAL::IO::is_binary()`
  `CGAL::IO::is_pretty()`

## ◆ is_ascii()

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

`#include <CGAL/IO/io.h>`

checks if the IO stream `s` is in `ASCII` mode.

`CGAL::IO::Mode`

See also
  `CGAL::IO::set_mode()`
  `CGAL::IO::set_ascii_mode()`
  `CGAL::IO::set_binary_mode()`
  `CGAL::IO::set_pretty_mode()`
  `CGAL::IO::get_mode()`
  `CGAL::IO::is_binary()`
  `CGAL::IO::is_pretty()`

## ◆ is_binary()

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

`#include <CGAL/IO/io.h>`

checks if the IO stream `s` is in `BINARY` mode.

`CGAL::IO::Mode`

See also
  `CGAL::IO::set_mode()`
  `CGAL::IO::set_ascii_mode()`
  `CGAL::IO::set_binary_mode()`
  `CGAL::IO::set_pretty_mode()`
  `CGAL::IO::get_mode()`
  `CGAL::IO::is_ascii()`
  `CGAL::IO::is_pretty()`

## ◆ is_pretty()

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

`#include <CGAL/IO/io.h>`

checks if the IO stream `s` is in `PRETTY` mode.

`CGAL::IO::Mode`

See also
  `CGAL::IO::set_mode()`
  `CGAL::IO::set_ascii_mode()`
  `CGAL::IO::set_binary_mode()`
  `CGAL::IO::set_pretty_mode()`
  `CGAL::IO::get_mode()`
  `CGAL::IO::is_ascii()`
  `CGAL::IO::is_binary()`

## ◆ oformat() [1/2]

template<class T >

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`.

## ◆ oformat() [2/2]

template<class T , class F >

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.

## ◆ set_ascii_mode()

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`.

`CGAL::IO::Mode`

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

## ◆ set_binary_mode()

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`.

`CGAL::IO::Mode`

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

## ◆ set_mode()

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

`#include <CGAL/IO/io.h>`

sets the printing mode of the IO stream `s`.

`CGAL::IO::Mode`

See also
  `CGAL::IO::set_ascii_mode()`
  `CGAL::IO::set_binary_mode()`
  `CGAL::IO::set_pretty_mode()`
  `CGAL::IO::get_mode()`
  `CGAL::IO::is_ascii()`
  `CGAL::IO::is_binary()`
  `CGAL::IO::is_pretty()`

## ◆ set_pretty_mode()

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`.

`CGAL::IO::Mode`

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