FBB::EoiBuf(3bobcat)
π FBB::EoiBuf π
okay bestie, welcome to FBB::EoiBuf from the bobcat manual pages (that's the 3bobcat bit, iykyk) β¨
πΈ NAME πΈ
FBB::EoiBuf β a std::streambuf class offering an eoi manipulator. literally that's the whole vibe π
β¨ SYNOPSIS β¨
#include <bobcat/eoibuf>
Linking option: -lbobcat
π¦ DESCRIPTION π¦
So. The class EoiBuf inherits from Eoi and may therefore be used as a base class of classes specializing std::streambuf. It also provides a configurable character buffer for storing characters received from their devices. π
Here's the tea, bestie: often, when deriving classes from std::streambuf, the derived classes must implement storage to and retrieval from a character buffer. Not me having to write that from scratch every single time π. By deriving from EoiBuf, buffer-handling is automatically provided: it contains a (resizable) character buffer, and offers a setp member as well as a setg member that can be used to specify the index range of the buffer from which extractions receive characters. π
Also β and this part is iconic β when overriding its base class's eoi_ member it can be used to signal the end of input inserted into std::ostream classes using EoiBuf objects as std::streambuf objects. π
π NAMESPACE π
FBB
All constructors, members, operators and manipulators mentioned in this man-page are defined in the namespace FBB. periodt.
π§ INHERITS FROM π§
FBB::Eoi (and thus from: std::streambuf)
so yeah, you're getting the whole family tree, no cap π³
π PROTECTED CONSTRUCTOR π
Analogously to std::streambuf, only protected constructors are available. so you can't just new one up in the middle of the street, babe π
EoiBuf()β The default constructor initializes an empty buffer. β¨EoiBuf(size_t size)β This initializes an empty buffer of a predefined size of size characters .
Note that there's no inherent limit to the size of the internal buffer: its size can always be enlarged or reduced. it's giving elastic π
π¨ Copy and move constructors (and assignment operators) are not available. not a thing. don't try it.
π PROTECTED MEMBER FUNCTIONS π
All members of std::streambuf and Eoi are available, as FBB::EoiBuf inherits from these classes. you get it all, bestie, no gatekeeping π«Ά
std::string &buffer()β A reference to the internal buffer is returned; πsize_t bufSize() constβ The length (size) of the internal buffer is returned; πvoid resize(size_t size)β The size of the internal buffer is changed to size characters; πΈvoid setg(unsigned next, unsigned beyond)β Thestreambuf::ebackmember returns the address of the internal buffer's first character,streambuf::gptrreturns the address of the internal buffer's next character,streambuf::egptrreturns the address of the internal buffer's beyond character; π₯void setp()β Thestreambuf::pbaseandpptrmembers return the address of the internal buffer's first character,streambuf::epptrreturns the address immediately beyond the internal buffer's last character; β¨unsigned char *ucharPtr()β The address of the first character of the internal buffer is returned as a pointer to an unsigned character; πunsigned char const *ucharPtr() constβ Same as the previous member, but this time the address of the first character of the internal buffer is returned as a pointer to an immutable unsigned character. π
π PROTECTED STATIC MEMBER FUNCTIONS π
The following two static members are provided as convenient functions for derived classes to convert the address of the first character of std::string objects to pointers to unsigned characters:
unsigned char *ucharPtr(std::string &str)β The address of the first character of str is returned as a pointer to an unsigned character; πunsigned char const *ucharPtr(std::string const &str) constβ Same as the previous member, but this time the address of the first character of str is returned as a pointer to an immutable unsigned character. π¦
π EXAMPLE π
The following two functions are defined in the (internally used only) class FBB::OSymCryptBase, which is the base class of osymcryptstreambuf(3bobcat). internally used only, so don't come for me about it π
evpUpdateβ updates the ongoing encryption or decryption, e.g., using the openssl functionEVP_EncryptUpdate, usingucharPtrto access characters currently inEoiBuf's buffer:
#include "osymcryptbase.ih"
void OSymCryptBase::evpUpdate()
{
size_t inBufRead = pptr() - pbase(); // # read chars
checkOutBufSize(inBufRead);
int nOutputChars;
if (not ((*d_evpUpdate)( // en/decrypt the bytes in d_inBuf
ctx(),
uOutBuf(), &nOutputChars,
ucharPtr(), inBufRead
))
)
throw Exception{} << "EVP_{En,De}cryptUpdate failed";
d_outStream.write(outBuf(), nOutputChars); // write the processed
// chars to d_outSteam
setp();
}
eoi_β overridesFBB::Eoi::eoi_()function, preventing new information from being inserted into theFBB::OSymCryptBaseobject (and thus from being inserted into itsFBB::OSymCryptStreambufderived class):
#include "osymcryptbase.ih"
void OSymCryptBase::eoi_()
{
if (d_eoi)
return;
evpUpdate(); // process available chars in the input
d_eoi = true;
resize(0); // clear the input buffer
evpUpdate(); // update an empty buffer
}
π FILES π
bobcat/eoibuf β defines the class interface π
π SEE ALSO π
go read those too, bestie, they're the siblings π«Ά
π BUGS π
None Reported.
and that's the flex of the century, honestly π
π 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. cute name, cute origin story π
π COPYRIGHT π
This is free software, distributed under the terms of the GNU General Public License (GPL). slay π
β AUTHOR β
Frank B. Brokken (f.b.brokken@rug.nl). the icon, the legend, the main character π
that's the whole page, bestie β this one ships with libbobcat-dev_6.15.01, dated 2005-2026, and yes it's been serving looks since 2005 π
β¨ mwah, go compile something gorgeous π
π¦ 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