FBB::OFdBuf(3bobcat)

File Descriptor Output Stream Buffer
(libbobcat-dev_6.02.02)

2005-2022

NAME

FBB::OFdBuf - Output stream buffer initialized by a file descriptor

SYNOPSIS

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

DESCRIPTION

FBB::OFdBuf objects may be used as a std::streambuf of std::ostream objects to allow insertions into a file descriptor.

File descriptors are not defined within the context of C++, but they can be used on operating systems that support the concept. Realize that using file descriptors introduces operating system dependencies.

NAMESPACE

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

INHERITS FROM

std::streambuf

ENUMERATION

The public enumeration Mode defined in the class FBB::OFdStreamBuf has the following values:

CONSTRUCTORS

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

MEMBER FUNCTIONS

All members of std::streambuf are available, as FBB::OFdBuf inherits from this class.

MANIPULATOR

EXAMPLE

#include <unistd.h>

#include <ostream>
#include <string>

#include "../ofdbuf"

using namespace std;
using namespace FBB;

int main(int argc, char **argv)
{
                           // define a streambuf of 20 or argv[1] characters
    OFdBuf buf{ STDOUT_FILENO, argc == 1 ? 20 : stoul(argv[1]) };

    ostream out{ &buf };

    out << "First line, just to start the insertions\n" <<
            argv[0] << endl <<          // using an explicit flush
            argc << "\n"
            "a long line to end this multiple-insertions statement\n";
}

FILES

bobcat/ofdbuf - defines the class interface

SEE ALSO

bobcat(7), ifdbuf(3bobcat), ofdstream(3bobcat), std::streambuf

BUGS

None reported

BOBCAT PROJECT FILES

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