.TH "FBB::IOStreambuf" "3bobcat" "2005\-2018" "libbobcat\-dev_4\&.08\&.06\-x\&.tar\&.gz" "Streambuf doing I/O" .PP .SH "NAME" FBB::IOStreambuf \- 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 \fBIOStreambuf\fP object support seeking, then the \fBIOStreambuf\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 \fBIOStreambuf\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 \fBIOStreambuf()\fP: .br The default constructor results in a \fBIOStreambuf\fP object that cannot be immediately used\&. Its member \fBopen()\fP must be called first\&. .IP o \fBIOStreambuf(std::istream &in, std::ostream &out)\fP: .br This constructor associates the \fBIOStreambuf\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 \fBIOStreambuf()\fP should outlive the \fBIOStreambuf\fP object\&. Copy and move constructors is not available\&. .PP .SH "MEMBER FUNCTIONS" All members of \fBstd::streambuf\fP are available, as \fBFBB::IOStreambuf\fP inherits from these classes\&. .IP o \fBvoid open(std::istream &in, std::ostream &out)\fP: .br This member (re)associates the \fBIOStreambuf\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 \fBIOStreambuf()\fP should outlive the \fBIOStreambuf\fP object\&. If this member is called for an \fBIOStreambuf\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:IOStreambuf\fP object and a subsequent call of \fBIOStreambuf::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 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 the beginning of the stream\&. .IP o \fBint pSync()\fP: .br This member flushes the associated \fBstd::ostream\fP object\&. .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/iostreambuf\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 "DISTRIBUTION FILES" .IP o \fIbobcat_4\&.08\&.06\-x\&.dsc\fP: detached signature; .IP o \fIbobcat_4\&.08\&.06\-x\&.tar\&.gz\fP: source archive; .IP o \fIbobcat_4\&.08\&.06\-x_i386\&.changes\fP: change log; .IP o \fIlibbobcat1_4\&.08\&.06\-x_*\&.deb\fP: debian package holding the libraries; .IP o \fIlibbobcat1\-dev_4\&.08\&.06\-x_*\&.deb\fP: debian package holding the libraries, headers and manual pages; .IP o \fIhttp://sourceforge\&.net/projects/bobcat\fP: public archive location; .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