FBB::IOBuf(3bobcat)
π FBB::IOBuf β the streambuf that does BOTH π
okay bestie, welcome to FBB::IOBuf(3bobcat), the manual page with Streambuf doing I/O energy. This is the Bobcat library's take on a streambuf that lets you read AND write, and honestly? it's giving two-way communication realness. let's get into it π¦
β¨ NAME β¨
FBB::IOBuf β a streambuf that lets you do input and output operations
β¨ SYNOPSIS β¨
#include <bobcat/iobuf>
Linking option: -lbobcat
β¨ DESCRIPTION β¨
so this class implements a specialization of the std::streambuf class, and what it does is let you do input operations from and output operations to different files. yes bestie, different. it's meant to be used together with FBB::IOStream, which means you get all the stream-based input and output operations using the same object, and you don't have to mess with seek-operations. using an FBB::IOStream object you can, for example, construct two-way communications using pipes β lowkey the same kind of facilities that sockets offer. iconic behavior fr fr π
if the streams that will be associated with the IOBuf object support seeking, then the IOBuf will do so too. seeking might also be available for a single stream (either the std::istream or the std::ostream).
when the IOBuf object goes out of scope, its associated std::ostream object is flushed. that's self-care, periodt β¨
β¨ NAMESPACE β¨
FBB
all constructors, members, operators and manipulators, mentioned in this man-page, are defined in the namespace FBB.
β¨ INHERITS FROM β¨
std::streambuf
β¨ CONSTRUCTORS β¨
IOBuf()β the default constructor. it results in anIOBufobject that cannot be immediately used π. its memberopen()must be called first, bestie.IOBuf(std::istream &in, std::ostream &out)β this constructor associates theIOBufobject with astd::istreamand astd::ostream. all output operations will be passed on to thestd::ostream, and all input operations to thestd::istream. the streams passed toIOBuf()should outlive theIOBufobject.
heads up π«Ά β copy and move constructors (and assignment operators) are not available. not on the menu, not in the building.
β¨ MEMBER FUNCTIONS β¨
all members of std::streambuf are available, because FBB::IOBuf inherits from these classes. inherit the whole menu, slay π
void open(std::istream &in, std::ostream &out)β this member (re)associates theIOBufobject with astd::istreamand astd::ostream. all output operations will be passed on to thestd::ostream, and all input operations to thestd::istream. the streams passed toIOBuf()should outlive theIOBufobject. and if this member is called for anIOBufobject that's already associated with anstd::ostreamobject, that already-associatedstd::ostreamobject gets flushed before the new association is set up. clean transition, no drama π
β¨ VIRTUAL PROTECTED MEMBER FUNCTIONS β¨
β οΈ bestie listen β the followingstd::streambufmember functions should only be called when theFBB::Streambufobject is associated withstd::istreamandstd::ostreamobjects. that is, they should not be called between the construction of a defaultFBB:IOBufobject and a subsequent call ofIOBuf::open().
the members listed in this section implement the tasks of comparably named virtual functions in the class's private interface. this separates the redefinable interface from the user-interface. the class IOStreamBuf can, in accordance with Liskov's Substitution Principle, be used as a std:streambuf; but it also offers facilities for classes deriving from IOStreamBuf. these facilities are listed right here, so you don't have to go looking π
pos_type pSeekoff(off_type offset, std::ios::seekdir way, std::ios::openmode mode = std::ios::in | std::ios::out)β with seekable streams, repositions the associatedstd::istreamorstd::ostreamis repositioned to offset offset, relative to way.pos_type pSeekpos(off_type offset, std::ios::openmode mode = std::ios::in | std::ios::out)β with seekable streams, repositions the associatedstd::istreamorstd::ostreamis repositioned to offset offset, relative tostd::streamsize pXsputn(char const *buffer, std::streamsize n)β this member inserts n characters from buffer into the associatedstd::ostreamstream.
not the pSeekpos description just... stopping, mid-sentence, "relative to" and then nothing π that's literally how the original page reads, bestie, i'm not fixing it, i'm just reporting it fr fr.
β¨ EXAMPLE β¨
see the example provided with process(3bobcat).
β¨ FILES β¨
bobcat/iobufβ defines the class interface
β¨ SEE ALSO β¨
bobcat(7), iostream(3bobcat), process(3bobcat)
β¨ BUGS β¨
none reported. (iconic, we love a clean record πβ¨)
β¨ BOBCAT PROJECT FILES β¨
https://fbb-git.gitlab.io/bobcat/: gitlab project page;
Debian Bobcat project files:
libbobcat6: debian package containing the shared library, changelog and copyright note;libbobcat-dev: debian package containing the static library, headers, manual pages, and developer info;
β¨ BOBCAT β¨
Bobcat is an acronym of Brokken's Own Base Classes And Templates. yes it's a backronym, and yes it ate π
β¨ COPYRIGHT β¨
this is free software, distributed under the terms of the GNU General Public License (GPL). free as in freedom, bestie π¦
β¨ AUTHOR β¨
Frank B. Brokken (f.b.brokken@rug.nl).
and that's the whole vibe check, bestie π this page is libbobcat-dev_6.15.01, living its life from 2005-2026, and it's still serving FBB::IOBuf(3bobcat) realness. go forth and open some streams π«ΆπΈ
π¦ where this page comes from
- ubuntu stonking: libbobcat-dev 6.15.01-1 Β· GPL-3.0-or-later WITH OpenSSL exception
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms