wibble::stream::PosixBuf Class Reference

#include <posix.h>

List of all members.

Public Member Functions

 PosixBuf ()
 PosixBuf (int fd, size_t bufsize=4096)
 ~PosixBuf ()
void attach (int fd, size_t bufsize=4096)
 Attach the stream to a file descriptor, using the given stream size.
int detach ()
 Sync the PosixBuf and detach it from the file descriptor.
int fd () const
 Access the underlying file descriptor.
int overflow (int c)
int sync ()

Constructor & Destructor Documentation

wibble::stream::PosixBuf::PosixBuf (  )  [inline]
wibble::stream::PosixBuf::PosixBuf ( int  fd,
size_t  bufsize = 4096 
) [inline]

References attach().

wibble::stream::PosixBuf::~PosixBuf (  )  [inline]

References sync().


Member Function Documentation

void wibble::stream::PosixBuf::attach ( int  fd,
size_t  bufsize = 4096 
) [inline]

Attach the stream to a file descriptor, using the given stream size.

Management of the file descriptor will be taken over by the PosixBuf, and the file descriptor will be closed with PosixBuf goes out of scope.

Referenced by PosixBuf().

int wibble::stream::PosixBuf::detach (  )  [inline]

Sync the PosixBuf and detach it from the file descriptor.

PosixBuf will not touch the file descriptor anymore, and it is the responsibility of the caller to close it.

Returns:
The file descriptor

References sync().

int wibble::stream::PosixBuf::fd (  )  const [inline]

Access the underlying file descriptor.

int wibble::stream::PosixBuf::overflow ( int  c  )  [inline]

References sync().

int wibble::stream::PosixBuf::sync (  )  [inline]

Referenced by detach(), overflow(), and ~PosixBuf().


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

Generated on Mon Jan 4 21:35:41 2010 for wibble by  doxygen 1.6.1