FBB...Buf(3bobcat)
π NAME π
FBB::IQuotedPrintableBuf β okay so bestie, this is an input filtering stream buffer that does quoted printable conversions. That's it, that's the gig π
(Also, hi, you're reading the FBB...Buf(3bobcat) page, welcome to the group chat β¨)
β¨ SYNOPSIS β¨
#include <bobcat/iquotedprintablebuf>
Linking option, don't forget it or it's giving linker tears: -lbobcat
π¦ DESCRIPTION π¦
So the tea is: the info you get out of IQuotedPrintableBuf objects is either quoted-printable encoded or decoded, periodt. And the info that needs converting? It gets read in through std::istream objects. That's the whole vibe. π
IQuotedPrintableBuf is a class template, and it takes a FBB::CryptType non-type template parameter. So:
FBB::IQuotedPrintableBuf<FBB::ENCODE>objects encode the info they receive π«ΆFBB::IQuotedPrintableBuf<FBB::DECODE>objects decode the info they receive
(There's an ENUMERATION section below if you want the full rundown, iykyk.)
Quoted-printable encoding gets used in e-mail attachments sometimes β see <https://en.wikipedia.org/wiki/Quoted-printable> and <https://www.ietf.org/rfc/rfc2045.txt> (section 6.7, bestie, section 6.7). Its main characteristics are:
- Lines are at most 76 characters long;
- Lines longer than 76 characters get split into sub-lines, using
=\ncombinations to indicatesoft line breaks. Lines that don't end in soft line breaks indicate true end of lines. - All printable characters, except for the
=character and (final) blank characters just before the end of lines, are copied as-is. Everything else gets escaped by writing=XXsequences, whereXXis the ascii-character representation of the hexadecimal value of the escaped character. For example: the=character is encoded as=3D, a final space before end-of-line is encoded as=20, a final tab as=09. Only capital letters are used when escaping characters. π₯
πΈ NAMESPACE πΈ
FBB
All constructors, members, operators and manipulators mentioned in this man-page are defined in the namespace FBB. No cap. π
π§ INHERITS FROM π§
FBB::IFilterBuf
π MEMBER FUNCTIONS π
All members of FBB::IFilterBuf are available, since IQuotedPrintableBuf inherits from this class. Inherited slay.
Overloaded move and/or copy assignment operators are not available. That's not me being dramatic, that's just how it is π
β ENUMERATION β
IQuotedPrintableBuf objects either encode or decode quoted-printable information:
- objects of the class
FBB::IQuotedPrintableBuf<FBB::ENCODE>encode the data they receive - objects of the class
FBB::IQuotedPrintableBuf<FBB::DECODE>decode the data they receive
The values ENCODE and DECODE are defined in the enum CryptType, defined in the FBB namespace. π
π CONSTRUCTOR π
IQuotedPrintableBuf<CryptType>(std::istream &in, size_t bufSize = 1000)β this constructor initializes the streambuf.IQuotedPrintableBuf<ENCODE>objects perform quoted-printable encoding;IQuotedPrintableBuf<DECODE>objects perform quoted-printable decoding;IQuotedPrintableBuf<CryptType>objects obtain the bytes to encode or decode fromstd::istream ∈- The
IFilterBufbase class is initialized with a buffer of sizebufSize, using a lower bound of 100 characters.
The constructor uses a configurable buffer size for reading. Characters read into the buffer which are not part of the actual quoted-printable encoded data are unavailable after completing the quoted-printable decoding. So if information beyond the quoted-printable input block should remain available, then specify a buffer size of 1. Yes, literally 1. Not a typo. π
Copy and move constructors (and assignment operators) are not available.
π EXAMPLE π
So the example shows how to construct IQuotedPrintableBuf<ENCODE> objects encode, which then get used to initialize a std::istream object. The information read from this istream is quoted-printable encoded. Iconic.
IQuotedPrintableBuf<DECODE> objects read quoted-printable encoded information from std::istream objects, decoding the information.
The std::istream din object is initialized with the IQuotedPrintableBuf<DECODE> object, and its content is sent to std::cout. The information that is presented at std::cin and that appears at std::cout should be identical. Vibe check passed. β
#include <iostream>
#include <istream>
#include <bobcat/iquotedprintablebuf>
using namespace std;
using namespace FBB;
int main(int argc, char **argv)
{
if (argc == 1)
{
cout << "Usage: " << argv[0] << " [edb] < infile > outfile\n"
"to quoted printable -e-ncode, -d-ecode or -b-oth\n";
return 0;
}
switch (argv[1][0])
{
case βeβ:
{
IQuotedPrintableBuf<ENCODE> encode(cin);
istream ein(&encode);
cout << ein.rdbuf();
}
break;
case βdβ:
{
IQuotedPrintableBuf<DECODE> decode(cin);
istream din(&decode);
cout << din.rdbuf();
}
break;
case βbβ:
{
IQuotedPrintableBuf<ENCODE> encode(cin);
istream ein(&encode);
IQuotedPrintableBuf<DECODE> decode(ein);
istream din(&decode);
cout << din.rdbuf();
}
break;
}
}
π FILES π
bobcat/iquotedprintablebuf β defines the class interface π
π¦ SEE ALSO π¦
bobcat(7), isymcryptstreambuf(3bobcat), iquotedprintablestream(3bobcat), ifilterbuf(3bobcat), ofilterbuf(3bobcat), std::streambuf.
π BUGS π
None reported. (We love a clean bug list, no notes π)
β 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β. π
π COPYRIGHT π
This is free software, distributed under the terms of the GNU General Public License (GPL).
β¨ AUTHOR β¨
Frank B. Brokken (f.b.brokken@rug.nl).
okay bestie that's the whole page, mwah π This was libbobcat-dev_6.15.01, dated 2005-2026, and it is officially the FBB...Buf(3bobcat) page. Go forth and encode, you main character π«Άβ¨
π¦ 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