FBB::...e64Buf(3bobcat)

πŸ’… FBB::...e64Buf β€” like, the whole vibe (from the bobcat manual, section 3)

okay bestie, sit down, hydrate, because we're talking about FBB::...e64Buf β€” the Base64 converting Stream Buffer β€” and honestly? she's iconic. it lives in the bobcat manual (section 3, the library-functions girlies), and this whole page is about her little sister FBB::IBase64Buf, the input filtering stream buffer that does base64 conversion. no cap. πŸŽ€


✨ NAME ✨

FBB::IBase64Buf β€” an Input Filtering stream buffer whose whole entire job is doing base64 conversion. she filters, she converts, she slays. πŸ’–


✨ SYNOPSIS ✨

#include <bobcat/ibase64buf>
Linking option: -lbobcat

that's it. that's the whole thing. go off. πŸ¦‹


✨ DESCRIPTION ✨

so here's the tea β˜• β€” the info that IBase64Buf objects hand you has already been through base64 encoding or decoding. the stuff that needs converting gets delivered to your IBase64Buf object through std::istream objects. that's the pipeline. she's a middleman and she loves it.

okay and now the plot twist: IBase64Buf is a class template, and it takes an FBB::CryptType template non-type parameter. meaning:

  • objects of the class FBB::IBase64Buf<FBB::ENCRYPT> base64 encode whatever they receive πŸ’«
  • objects of the class FBB::IBase64Buf<FBB::DECRYPT> base64 decode whatever they receive πŸ”“

also go peek at the ENUMERATION section below, she explains more. iykyk.


✨ NAMESPACE ✨

FBB

literally every constructor, member, operator and manipulator mentioned in this man-page lives in the namespace FBB. all of them. together. one big happy namespace. πŸ’œ


✨ INHERITS FROM ✨

FBB::IFilterBuf

she gets it from her mama. 🫢


✨ ENUMERATION ✨

IBase64Buf objects either base64 encode or decode information β€” pick a lane, she contains multitudes:

  • IBase64Buf objects of the class FBB::IBase64Buf<FBB::ENCRYPT> base64 encode the data they receive
  • IBase64Buf objects of the class FBB::IBase64Buf<FBB::DECRYPT> base64 decode the data they receive

the values ENCRYPT and DECRYPT are defined in the enum CryptType, which is defined in the FBB namespace. so yes, you write FBB::ENCRYPT and FBB::DECRYPT and it just works. periodt. ✨


✨ CONSTRUCTOR ✨

  • IBase64Buf<CryptType>(std::istream &in, size_t bufSize = 1000) β€” this constructor initializes the streambuf. the streambuf! initialized! πŸ’…

and now the deets, one by one, because details are the main character:

  • IBase64Buf<ENCRYPT> objects perform base64 encoding;
  • IBase64Buf<DECRYPT> objects perform base64 decoding;
  • IBase64Buf<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. so don't get cute with 0 bestie, there's a floor. πŸ™ˆ

the constructor uses a configurable buffer size for reading. now listen β€” this part is important:

characters that were read into the buffer but are not part of the actual base64 encoded data are unavailable after completing the base64 decrypting. gone. ghosted. if information beyond the base64 input block should remain available, then specify a buffer size of 1.

and one more thing, and I need you to hear me:

Copy and move constructors (and assignment operators) are not available.

like, at all. don't try it. she said no. πŸ’€


✨ MEMBER FUNCTIONS ✨

all members of FBB::IFilterBuf are available, because IBase64Buf inherits from this class. inheriting = free stuff. we love that for her. πŸ‘‘


✨ EXAMPLE ✨

okay so this example shows the construction of IBase64Buf<ENCRYPT> objects β€” encode β€” which are used to initialize a std::istream object. the information read from this istream is base64 encoded. cute, right? πŸŽ€

IBase64Buf<DECRYPT> objects β€” decode β€” read base64 encoded information from std::istream objects and decode it again. reverse uno. πŸ”„

the std::istream din object is initialized with the IBase64Buf<DECRYPT> 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. round trip, queen. ✨

#include <iostream>
#include <istream>

#include <bobcat/ibase64buf>

using namespace std;
using namespace FBB;

int main(int argc, char **argv)
{
    switch (argv[1][0])
    {
        case ’e’:
        {
            IBase64Buf<ENCRYPT> encode(cin);
            istream ein(&encode);
            cout << ein.rdbuf();
        }
        break;

        case ’d’:
        {
            IBase64Buf<DECRYPT> decode(cin);
            istream din(&decode);
            cout << din.rdbuf();
        }
        break;

        case ’b’:
        {
            IBase64Buf<ENCRYPT> encode(cin);
            istream ein(&encode);

            IBase64Buf<DECRYPT> decode(ein);
            istream din(&decode);
            cout << din.rdbuf();
        }
        break;

        default:
            cout << "Usage: " << argv[0] << " [edb] < infile > outfile\n"
                    "to base64 -e-ncode, -d-ecode or -b-oth\n";
        break;
    }
}

e for encode, d for decode, b for both. it's giving command-line simplicity. 🌸


✨ FILES ✨

  • bobcat/ibase64buf β€” defines the class interface

✨ SEE ALSO ✨

bobcat(7), isymcryptstreambuf(3bobcat), ibase64stream(3bobcat), ifilterbuf(3bobcat), ofilterbuf(3bobcat), std::streambuf.

the whole friend group. go say hi. πŸ¦‹


✨ BUGS ✨

None reported.

a clean record. she's unproblematic. we stan. πŸ’–


✨ 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.

acronym reveal of the century. πŸ”₯


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).

the icon. the legend. the moment. πŸ‘‘


and that's the whole page, bestie!! πŸŽ€βœ¨ this was libbobcat-dev_6.15.01, dated 2005-2026, straight from the FBB::...e64Buf(3bobcat) manual. go forth and base64 responsibly. mwah. πŸ’…πŸ’–

πŸ“¦ where this page comes from