A simple file streambuf using a "file descriptor" and three function pointers for read, write and close operations.
More...
|
| fbuf (read_fn_t, write_fn_t, close_fn_t) |
| Constructor. Use open() to initialise.
|
|
| fbuf (T file, read_fn_t, write_fn_t, close_fn_t) |
| Constructor passed an open file descriptor.
|
|
| ~fbuf () override |
| Destructor. Closes the file. More...
|
|
void | open (T file) |
| Installs the given file descriptor. More...
|
|
T | file () const |
| Returns the current file descriptor. More...
|
|
| fbuf (const fbuf< T, N > &)=delete |
|
| fbuf (fbuf< T, N > &&)=delete |
|
fbuf< T, N > & | operator= (const fbuf< T, N > &)=delete |
|
fbuf< T, N > & | operator= (fbuf< T, N > &&)=delete |
|
template<typename T, int N>
class G::fbuf< T, N >
A simple file streambuf using a "file descriptor" and three function pointers for read, write and close operations.
The file descriptor type is templated to allow for non-integer file descriptors, such as std::FILE. Does not support seeking.
Eg:
std::ostream stream( &
fbuf ) ;
stream.clear( std::ios_base::failbit ) ;
stream << "hello, world!\n" ;
A simple file streambuf using a "file descriptor" and three function pointers for read,...
void open(T file)
Installs the given file descriptor.
fbuf(read_fn_t, write_fn_t, close_fn_t)
Constructor. Use open() to initialise.
The implementation inherits from std::streambuf, overriding overflow(), underflow() and sync() to operate the internal character buffer and file descriptor.
Definition at line 55 of file gfbuf.h.