FBB::OFdStreambuf objects may be used as a std::streambuf of
std::ostream objects to allow extractions from a file descriptor.
File descriptors are not defined within the context of C++,
but they can be used on operating systems that support the concept. Realize
that using file descriptors introduces operating system dependencies.
NAMESPACE
FBB
All constructors, members, operators and manipulators, mentioned in this
man-page, are defined in the namespace FBB.
INHERITS FROM
std::streambuf
ENUMERATION
The public enumeration Mode defined in the class FBB::OFdStreamBuf
has the following values:
CLOSE_FD, indicating that the file descriptor used by the object
must be closed;
KEEP_FD (the default) indicating that the file descriptor used by
the object must not be closed.
CONSTRUCTORS
Ofdstreambuf():
This constructor initializes the streambuf, without associating it to
a file descriptor, and without using buffering. The member open() can be
used to associate the object later on with a file descriptor and optionally a
buffer size. When the object is destroyed or if the mode-less overloaded
version of the open member is called, the file descriptor will be closed.
Ofdstreambuf(Mode mode):
This constructor initializes the streambuf, without associating it to
a file descriptor, and without using buffering. The member open() can be
used to associate the object later on with a file descriptor and optionally a
buffer size. When the object is destroyed or if the mode-less
overloaded version of the open member is called, the Mode argument
determines whether the file descriptor will be closed or will remain open.
OFdStreambuf(int fd, size_t n = 1):
This constructor initializes the streambuf, associating it to file
descriptor fd, and an optional unget buffer size (by default having size
1). When open is called subsequently, or if the object is destroyed
the provided file descriptor will be closed.
OFdStreambuf(int fd, size_t n = 1):
This constructor initializes the streambuf, associating it to file
descriptor fd, and an optional unget buffer size (by default having size
1). When the object is destroyed or if the mode-less overloaded version of
the open member is called, the file descriptor will be closed.
OFdStreambuf(int fd, Mode mode, size_t n = 1):
This constructor initializes the streambuf, associating it to file
descriptor fd, and an optional unget buffer size (by default having size
1). When the object is destroyed or if the mode-less overloaded version of
the open member is called, the Mode argument determines whether the
file descriptor will be closed or will remain open.
There is no copy constructor.
MEMBER FUNCTIONS
All members of std::streambuf are
available, as FBB::OFdStreambuf inherits from this class. Some of the
std::streambuf's member are overridden by FBB::OFdStreambuf, see
below.
void open(int xfd, size_t n = 1):
This member (re)initializes the streambuf, using file
descriptor fd, and an optional unget buffer size (by default having size
1). When called repeatedly, the Mode specification used whem the object
was constructed determines whether the file descriptor will be closed or will
remain open.
void open(int xfd, Mode mode, size_t n = 1):
This member (re)initializes the streambuf, using file
descriptor fd, a file descriptor closing parameter and an optional unget
buffer size (by default having size 1). Depending on the Mode argument the
object's currently used file descriptor will be closed or will remain open.
int overflow(int c):
This member overrides the std::streambuf member. It is
called by std::ostream objects using OFdStreambuf. It calls
sync(), an then it puts the next available character into the buffer. It
returns the inserted character.
int sync(): :
This member overrides the std::streambuf member. It writes
the buffer to the device associated with the file descriptor, and returns 0.
Note that there is no overloaded assignment operator available for this
class.
Starting with bobcat version 1.7.0, open file descriptors will be closed
when the object is destroyed or if the object is re-opened. Note that this
differs from earlier implementations, in which the file descriptor remained
open.
DISTRIBUTION FILES
bobcat_2.02.03-x.dsc: detached signature;
bobcat_2.02.03-x.tar.gz: source archive;
bobcat_2.02.03-x_i386.changes: change log;
libbobcat1_2.02.03-x_*.deb: debian package holding the
libraries;
libbobcat1-dev_2.02.03-x_*.deb: debian package holding the
libraries, headers and manual pages;
http://sourceforge.net/projects/bobcat: public archive location;
BOBCAT
Bobcat is an acronym of `Brokken's Own Base Classes And Templates'.
COPYRIGHT
This is free software, distributed under the terms of the
GNU General Public License (GPL).