Generic Image Library: file_stream_device< FormatTag > Class Template Reference

###  | #  |

Classes | Public Types | Public Member Functions | List of all members
file_stream_device< FormatTag > Class Template Reference

`#include <device.hpp>`

## Classes
struct | read_tag
| Used to overload the constructor. More...

## Public Types
using | format_tag_t = FormatTag

## Public Member Functions
| file_stream_device (const std::string &file_name, read_tag tag=read_tag())
| file_stream_device (const char *file_name, read_tag=read_tag())
| file_stream_device (const std::string &file_name, write_tag tag)
| file_stream_device (const char *file_name, write_tag)
| file_stream_device (FILE *file)
auto | get () -> FILE *
auto | get () const -> FILE const *
int | getc_unchecked ()
char | getc ()
auto | read (byte_t *data, std::size_t count) -> std::size_t
template<typename T , int N>
void | read (T(&buf)[N])
| Reads array.
uint8_t | read_uint8 ()
| Reads byte.
uint16_t | read_uint16 ()
| Reads 16 bit little endian integer.
uint32_t | read_uint32 ()
| Reads 32 bit little endian integer.
template<typename T >
auto | write (T const *buf, std::size_t count) -> std::size_t
| Writes number of elements from a buffer.
template<typename T , std::size_t N>
void | write (const T(&buf)[N])
| Writes array.
void | write_uint8 (uint8_t x)
| Writes byte.
void | write_uint16 (uint16_t x)
| Writes 16 bit little endian integer.
void | write_uint32 (uint32_t x)
| Writes 32 bit little endian integer.
void | seek (long count, int whence=SEEK_SET)
long int | tell ()
void | flush ()
void | print_line (const std::string &line)
| Prints formatted ASCII text.
int | error ()

## Detailed Description

template<typename FormatTag>
class boost::gil::detail::file_stream_device< FormatTag >

Implements the IODevice concept c.f. to Concept of IO Device required by Image libraries like libjpeg and libpng.

Todo
  switch to a sane interface as soon as there is something good in boost. I.E. the IOChains library would fit very well here.

This implementation is based on FILE*.

## Constructor & Destructor Documentation

## ◆ file_stream_device() [1/5]

template<typename FormatTag >

file_stream_device | ( | const std::string & | file_name,
|  | read_tag | tag = read_tag() )
| inline

Constructor

## ◆ file_stream_device() [2/5]

template<typename FormatTag >

file_stream_device | ( | const char * | file_name,
|  | read_tag | = read_tag() )
| inline

Constructor

## ◆ file_stream_device() [3/5]

template<typename FormatTag >

file_stream_device | ( | const std::string & | file_name,
|  | write_tag | tag )
| inline

Constructor

## ◆ file_stream_device() [4/5]

template<typename FormatTag >

file_stream_device | ( | const char * | file_name,
|  | write_tag | )
| inline

Constructor

## ◆ file_stream_device() [5/5]

template<typename FormatTag >

file_stream_device | ( | FILE * | file | ) |
| inline

Constructor

## Member Function Documentation

## ◆ read()

template<typename FormatTag >

auto read | ( | byte_t * | data,
|  | std::size_t | count ) -> std::size_t
| inline

Todo
  : change byte_t* to void*

Todo
  : add compiler symbol to turn error checking on and off.

The documentation for this class was generated from the following file:

- device.hpp