#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 () |
Implements the IODevice concept c.f. to Concept of IO Device required by Image libraries like libjpeg and libpng.
This implementation is based on FILE*.
|
inline |
Constructor
|
inline |
Constructor
|
inline |
Constructor
|
inline |
Constructor
|
inline |
Constructor
|
inline |