Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
xstream::fd::streambuf Class Reference

file descriptor streambuf More...

#include <fd.h>

+ Inheritance diagram for xstream::fd::streambuf:

Public Member Functions

 streambuf (int fd, bool close=true)
 construct specifying the file descriptor More...
 
 ~streambuf ()
 closes the streambuf stream More...
 

Protected Member Functions

std::streamsize available () const
 remaining characters in the buffer More...
 
std::streamsize taken () const
 number of characters in the buffer More...
 

Private Member Functions

int sync ()
 flush as much data as possible (overloaded from streambuf) More...
 
int overflow (int c)
 write a character that surpasses buffer end (overloaded from streambuf) More...
 
std::streamsize xsputn (const char *buffer, std::streamsize n)
 write an entire buffer (overloaded from streambuf) More...
 
std::streamsize xsgetn (char *buffer, std::streamsize n)
 reads n characters to buffer (overloaded from streambuf) More...
 
int underflow ()
 requests that input buffer be reloaded (overloaded from streambuf) More...
 
void reset_write ()
 
void flush_write ()
 

Private Attributes

xstream::buffer rbuf
 
xstream::buffer wbuf
 

Detailed Description

file descriptor streambuf

allows to use a streambuf to read/write data to/from a file descriptor

Todo:
implement seek operation when possible

Definition at line 33 of file fd.h.

Constructor & Destructor Documentation

xstream::fd::streambuf::streambuf ( int  fd,
bool  close = true 
)

construct specifying the file descriptor

Parameters
fdfiledescriptor
closeif true closes the file descriptor at destruction
xstream::fd::streambuf::~streambuf ( )

closes the streambuf stream

Member Function Documentation

std::streamsize xstream::ostreambuf::available ( ) const
inlineprotectedinherited

remaining characters in the buffer

Definition at line 28 of file common.h.

Referenced by xstream::base64::ostreambuf::~ostreambuf().

void xstream::fd::streambuf::flush_write ( )
private
int xstream::fd::streambuf::overflow ( int  c)
private

write a character that surpasses buffer end (overloaded from streambuf)

void xstream::fd::streambuf::reset_write ( )
private
int xstream::fd::streambuf::sync ( )
private

flush as much data as possible (overloaded from streambuf)

std::streamsize xstream::ostreambuf::taken ( ) const
inlineprotectedinherited

number of characters in the buffer

Definition at line 36 of file common.h.

Referenced by xstream::digest::stream::xsputn().

int xstream::fd::streambuf::underflow ( )
private

requests that input buffer be reloaded (overloaded from streambuf)

std::streamsize xstream::fd::streambuf::xsgetn ( char *  buffer,
std::streamsize  n 
)
private

reads n characters to buffer (overloaded from streambuf)

std::streamsize xstream::fd::streambuf::xsputn ( const char *  buffer,
std::streamsize  n 
)
private

write an entire buffer (overloaded from streambuf)

Member Data Documentation

xstream::buffer xstream::fd::streambuf::rbuf
private

were read data is stored

Definition at line 36 of file fd.h.

xstream::buffer xstream::fd::streambuf::wbuf
private

were data to be written is stored

Definition at line 37 of file fd.h.


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