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 =\n combinations to indicate soft 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 =XX sequences, where XX is 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 from std::istream &in;
    • The IFilterBuf base class is initialized with a buffer of size bufSize, 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 ⭐

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’. πŸ’…


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