FBB::OFdStream(3bobcat)

πŸ’– FBB::OFdStream β€” the bobcat manual page πŸ’–

okay bestie, welcome to FBB::OFdStream(3bobcat) β€” the File Descriptor Output Stream page from the bobcat manual. buckle up, it's giving "C++ streams but make it raw OS file descriptor" and honestly? iconic. 🫢


✨ NAME ✨

FBB::Ofdstream β€” an Output Stream initialized by a File Descriptor. no cap, that's literally the whole name.


🌸 SYNOPSIS 🌸

#include <bobcat/ofdstream>

πŸ¦‹ DESCRIPTION πŸ¦‹

so the tea is this: FBB::OFdStream objects let you insert information into a device whose file descriptor is available. that's the whole vibe. πŸ’…

now, file descriptors are not defined within the context of C++, bestie β€” like, C++ doesn't know her β€” but they can be used on operating systems that support the concept. and the moment you do, realize that using file descriptors introduces operating system dependencies. so it's giving portable-ish but not really. πŸ™ˆ

and one more lil thing you need to know: sockets can be used as file descriptors. yes ma'am. 🧚


πŸ‘‘ NAMESPACE πŸ‘‘

FBB

all constructors, members, operators and manipulators mentioned in this man-page are defined in the namespace FBB. periodt.


🌈 INHERITS FROM 🌈

std::ostream

she learned it from her mother, and her mother is legendary.


πŸ’œ CONSTRUCTORS πŸ’œ

  • OFdStream(int fd, size_t n = 1) β€” this constructor initializes the object to write to descriptor fd, using a buffer of size n, which by default has size 1. so yes, default buffer is one single byte, she's small but she's fierce. πŸŽ€
not me about to say the saddest sentence in the whole page: copy and move constructors (and assignment operators) are not available. no copying. no moving. she does not do that. πŸ’€

⭐ MEMBER FUNCTIONS ⭐

all members of std::ostream are available, because FBB::OFdStream inherits from this class. there are no additional members. that's it. that's the section. she's lowkey minimal and highkey perfect. πŸ’…


πŸ“ EXAMPLE πŸ“

see the clientsocket(3bobcat) man-page for an example showing how to use OFdStream. go read it bestie, it's right there. πŸ“–


πŸ’– FILES πŸ’–

  • bobcat/ofdstream β€” defines the class interface

πŸ”₯ SEE ALSO πŸ”₯


πŸ’€ BUGS πŸ’€

okay so this is the part where we get real, and it's a little chaotic:

the OFdStream object uses an OFdBuf for its std::streambuf. this buffer is associated with the file descriptor passed to OFdStream's constructor. and here's the kicker β€” when the OFdStream object goes out of scope, the device (file, socket, etc.) to which the file descriptor that was passed to OFdStream's constructor is not closed.

🚨 so if you were expecting her to clean up after herself when she leaves the party… she does not. the device stays open. plan accordingly, bestie. 😭

🌟 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. iykyk. ate and left no crumbs. πŸŽ€


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). we stan a legend fr fr. 🫢


and that's the whole page, babes! this one shipped as part of libbobcat-dev_6.15.01, dated 2005-2026 β€” two decades of bobcat and still serving looks. πŸ’…βœ¨ bye bestie, go write to a file descriptor responsibly! πŸ’–πŸ¦‹πŸŽ€

πŸ“¦ where this page comes from