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 an IOBuf object that cannot be immediately used 😭. its member open() must be called first, bestie.
  • IOBuf(std::istream &in, std::ostream &out) β€” this constructor associates the IOBuf object with a std::istream and a std::ostream. all output operations will be passed on to the std::ostream, and all input operations to the std::istream. the streams passed to IOBuf() should outlive the IOBuf object.
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 the IOBuf object with a std::istream and a std::ostream. all output operations will be passed on to the std::ostream, and all input operations to the std::istream. the streams passed to IOBuf() should outlive the IOBuf object. and if this member is called for an IOBuf object that's already associated with an std::ostream object, that already-associated std::ostream object gets flushed before the new association is set up. clean transition, no drama πŸ’…

✨ VIRTUAL PROTECTED MEMBER FUNCTIONS ✨

⚠️ bestie listen β€” the following std::streambuf member functions should only be called when the FBB::Streambuf object is associated with std::istream and std::ostream objects. that is, they should not be called between the construction of a default FBB:IOBuf object and a subsequent call of IOBuf::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 associated std::istream or std::ostream is 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 associated std::istream or std::ostream is repositioned to offset offset, relative to
  • std::streamsize pXsputn(char const *buffer, std::streamsize n) β€” this member inserts n characters from buffer into the associated std::ostream stream.
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 ✨

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 πŸŽ€


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