FBB::OHexStreambuf(3bobcat)

Write hex values
(libbobcat-dev_4.09.00-x.tar.gz)

2005-2019

NAME

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

SYNOPSIS

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

DESCRIPTION

OHexStreambuf is a specialization of FBB::OFilterStreambuf 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 OHexStreambuf 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::OFilterStreambuf

CONSTRUCTOR

The destructor writes any buffered information to the destination stream and will then flushes the destination stream.

MEMBER FUNCTIONS

All members of FBB::OFilterStreambuf, in particular its out() and open() members are available, as FBB::OHexStreambuf inherits from this class.

STATIC MEMBER

EXAMPLE


    #include <iostream>
    #include <bobcat/ohexstreambuf>
    
    using namespace std;
    using namespace FBB;
    
    int main()
    {   
        OHexStreambuf ohex(cout, 40);
        ostream out(&ohex);
        out << cin.rdbuf();
        if (ohex.size())
            cout << '\n';
    }
            

FILES

bobcat/ohexstreambuf - defines the class interface

SEE ALSO

bobcat(7), ofilterstreambuf(3bobcat)

BUGS

None Reported.

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