FBB::OHexBuf(3bobcat)

Write hex values
(libbobcat-dev_6.02.02)

2005-2022

NAME

FBB::OHexBuf - Writes characters written to an ostream as hex values

SYNOPSIS

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

DESCRIPTION

OHexBuf is a specialization of FBB::OFilterBuf inserting all the characters it receives to a destination file as 2-character wide hexadecimal values. Optionally a maximum linelength can be specified.

Note that all information received by an OHexBuf object is inserted as (a series of) hexadecimal values, not only plain characters. E.g., when inserting the value 123 the characters '1', '2' and '3' are successively inserted and so this will result in the string 313233 being inserted into the destination stream.

NAMESPACE

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

INHERITS FROM

FBB::OFilterBuf

CONSTRUCTOR

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

The destructor writes any buffered information to the destination stream and then flushes the destination stream. Finally, the destructor restores the original formatting flags of the receiving ostream.

MEMBER FUNCTIONS

All members of FBB::OFilterBuf, in particular its out() and reset members are available, as FBB::OHexBuf inherits from this class.

MANIPULATOR

STATIC MEMBER

EXAMPLE


    #include <iostream>
    #include <bobcat/ohexbuf>

    using namespace std;
    using namespace FBB;

    int main()
    {
        OHexBuf ohex(cout, 40);
        ostream out(&ohex);
        out << cin.rdbuf();
        if (ohex.size())
            cout << '\n';
    }
            

FILES

bobcat/ohexbuf - defines the class interface

SEE ALSO

bobcat(7), ofilterbuf(3bobcat)

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