.TH "FBB::IOBuf" "3bobcat" "2005\-2023" "libbobcat\-dev_6\&.04\&.00" "Streambuf doing I/O" .PP .SH "NAME" FBB::IOBuf \- streambuf allowing input and output operations .PP .SH "SYNOPSIS" \fB#include \fP .br Linking option: \fI\-lbobcat\fP .PP .SH "DESCRIPTION" This class implements a specialization of the \fBstd::streambuf\fP class, allowing input operations from and output operations to different files\&. It is intended to be used in combination with \fBFBB::IOStream\fP, thus allowing all stream\-based input and output operations using the same object without the need to use \fIseek\fP\-operations\&. Using an \fBFBB::IOStream\fP object it is, e\&.g\&., possible to construct two\-way communications using pipes, much like the facilities offered by sockets\&. .PP If the streams that will be associated with the \fBIOBuf\fP object support seeking, then the \fBIOBuf\fP will do so to\&. Seeking might also be available for a single stream (either the \fBstd::istream\fP or the \fBstd::ostream\fP)\&. .PP When the \fBIOBuf\fP object goes out of scope, its associated \fBstd::ostream\fP object is flushed\&. .PP .SH "NAMESPACE" \fBFBB\fP .br All constructors, members, operators and manipulators, mentioned in this man\-page, are defined in the namespace \fBFBB\fP\&. .PP .SH "INHERITS FROM" \fBstd::streambuf\fP .PP .SH "CONSTRUCTORS" .IP o \fBIOBuf()\fP: .br The default constructor results in a \fBIOBuf\fP object that cannot be immediately used\&. Its member \fBopen()\fP must be called first\&. .IP o \fBIOBuf(std::istream &in, std::ostream &out)\fP: .br This constructor associates the \fBIOBuf\fP object with a \fBstd::istream\fP and a \fBstd::ostream\fP\&. All output operations will be passed on to the \fBstd::ostream\fP, all input operations to the \fBstd::istream\fP\&. The streams passed to \fBIOBuf()\fP should outlive the \fBIOBuf\fP object\&. .PP Copy and move constructors (and assignment operators) are not available\&. .PP .SH "MEMBER FUNCTIONS" All members of \fBstd::streambuf\fP are available, as \fBFBB::IOBuf\fP inherits from these classes\&. .IP o \fBvoid open(std::istream &in, std::ostream &out)\fP: .br This member (re)associates the \fBIOBuf\fP object with a \fBstd::istream\fP and a \fBstd::ostream\fP\&. All output operations will be passed on to the \fBstd::ostream\fP, all input operations to the \fBstd::istream\fP\&. The streams passed to \fBIOBuf()\fP should outlive the \fBIOBuf\fP object\&. If this member is called for an \fBIOBuf\fP object already associated with an \fBstd::ostream\fP object, the already associated \fBstd::ostream\fP object is flushed before setting up the new association\&. .PP .SH "VIRTUAL PROTECTED MEMBER FUNCTIONS" .PP The following \fBstd::streambuf\fP member functions should only be called when the \fBFBB::Streambuf\fP object is associated with \fBstd::istream\fP and \fBstd::ostream\fP objects (i\&.e\&., they should not be called between the construction of a default \fBFBB:IOBuf\fP object and a subsequent call of \fBIOBuf::open()\fP): .PP The members listed in this section implement the tasks of comparably named virtual function in the class\(cq\&s private interface\&. This separates the redefinable interface from the user\-interface\&. The class \fBIOStreamBuf\fP can, in accordance with Liskov\(cq\&s Substitution Principle, be used as a \fIstd:streambuf\fP; but it also offers facilities for classes deriving from \fBIOStreamBuf\fP\&. These facilities are listed here\&. .PP .IP o \fBpos_type pSeekoff(off_type offset, std::ios::seekdir way, std::ios::openmode mode = std::ios::in | std::ios::out)\fP: .br With seekable streams, repositions the associated \fBstd::istream\fP or \fBstd::ostream\fP is repositioned to offset \fIoffset\fP, relative to \fIway\fP\&. .IP .IP o \fBpos_type pSeekpos(off_type offset, std::ios::openmode mode = std::ios::in | std::ios::out)\fP: .br With seekable streams, repositions the associated \fBstd::istream\fP or \fBstd::ostream\fP is repositioned to offset \fIoffset\fP, relative to .IP .IP o \fBstd::streamsize pXsputn(char const *buffer, std::streamsize n)\fP: .br This member inserts \fIn\fP characters from \fIbuffer\fP into the associated \fBstd::ostream\fP stream\&. .PP .SH "EXAMPLE" See the example provided with \fBprocess\fP(3bobcat)\&. .PP .SH "FILES" \fIbobcat/iobuf\fP \- defines the class interface .PP .SH "SEE ALSO" \fBbobcat\fP(7), \fBiostream\fP(3bobcat), \fBprocess\fP(3bobcat) .PP .SH "BUGS" None reported\&. .PP .SH "BOBCAT PROJECT FILES" .PP .IP o \fIhttps://fbb\-git\&.gitlab\&.io/bobcat/\fP: gitlab project page; .IP o \fIbobcat_6\&.04\&.00\-x\&.dsc\fP: detached signature; .IP o \fIbobcat_6\&.04\&.00\-x\&.tar\&.gz\fP: source archive; .IP o \fIbobcat_6\&.04\&.00\-x_i386\&.changes\fP: change log; .IP o \fIlibbobcat1_6\&.04\&.00\-x_*\&.deb\fP: debian package containing the libraries; .IP o \fIlibbobcat1\-dev_6\&.04\&.00\-x_*\&.deb\fP: debian package containing the libraries, headers and manual pages; .PP .SH "BOBCAT" Bobcat is an acronym of `Brokken\(cq\&s Own Base Classes And Templates\(cq\&\&. .PP .SH "COPYRIGHT" This is free software, distributed under the terms of the GNU General Public License (GPL)\&. .PP .SH "AUTHOR" Frank B\&. Brokken (\fBf\&.b\&.brokken@rug\&.nl\fP)\&. .PP