FBB::OHexStreambuf(3bobcat) | Write hex values | FBB::OHexStreambuf(3bobcat) |
FBB::OHexStreambuf - Writes characters written to an ostream as hex values
#include <bobcat/ohexstreambuf>
Linking option: -lbobcat
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.
FBB
All constructors, members, operators and manipulators, mentioned in this
man-page, are defined in the namespace FBB.
FBB::OFilterStreambuf
The destructor writes any buffered information to the destination stream and will then flushes the destination stream.
All members of FBB::OFilterStreambuf, in particular its out() and open() members are available, as FBB::OHexStreambuf inherits from this class.
The member listed in this section implements the tasks of the comparably named virtual function in the class’s private interface. This separates the redefinable interface from the user-interface. The class OHexStreambuf can, in accordance with Liskov’s Substitution Principle, be used as a std:streambuf; but it also offers a facility for classes deriving from OHexStreambuf. This facility is listed here.
#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’;
}
bobcat/ohexstreambuf - defines the class interface
None Reported.
Bobcat is an acronym of `Brokken’s Own Base Classes And Templates’.
This is free software, distributed under the terms of the GNU General Public License (GPL).
Frank B. Brokken (f.b.brokken@rug.nl).
2005-2018 | libbobcat-dev_4.08.06-x.tar.gz |