GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  OHEXSTREAMBUF (3)

NAME

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

CONTENTS

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 \(cq1\(cq, \(cq2\(cq and \(cq3\(cq 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

o OFoldStreambuf(std::ostream &stream, size_t width = 0):
The hexadecimal characters produced by the OFoldStreambuf object will be inserted into stream. Optionally the maximum line width (in number of characters) may be specified using width. The (default) value 0 indicates that no line breaks are requested.

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.
o size_t size() const:
This member returns the next column offset where the next hexadecimal character will appear. If a maximum line length is requested and size() does not return 0 then the last line inserted was not terminated by a \(cq\n\(cq character. See also the example below.
This member\(cqs return value is undefined if no maximum line length was requested.

PROTECTED MEMBER FUNCTION

The member listed in this section implements the tasks of the comparably named virtual function in the class\(cqs private interface. This separates the redefinable interface from the user-interface. The class OHexStreambuf can, in accordance with Liskov\(cqs Substitution Principle, be used as a std:streambuf; but it also offers a facility for classes deriving from OHexStreambuf. This facility is listed here.
o int pSync():
The contents of the OHexStreambuf\(cqs internal buffer is flushed.

STATIC MEMBER

o std::string text2bin(std::string const &in):
This static member can be used to convert a series of hexadecimal characters generated by a OHexStreambuf object back to their binary form. E.g, when called as OHexStreambuf::text2bin(\(dq736d616c6c206976\(dq) then the returned std::string will contain 8 characters, having respectively the binary values 0x73, 0x6d, 0x61, 0x6c, 0x6c, 0x20, 0x69, and 0x76.
This function does not verify whether its argument is properly formed. A properly formed argument consists of an even number of hexadecimal number characters (\(cq0\(cq until \(cq9\(cq, \(cqa\(cq until \(cqf\(cq (or uppercase)). For improperly formed arguments the return value is undefined.

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 << \(cq\n\(cq; }

FILES

bobcat/ohexstreambuf - defines the class interface

SEE ALSO

bobcat(7), ofilterstreambuf(3bobcat)

BUGS

None Reported.

DISTRIBUTION FILES

o bobcat_3.25.01-x.dsc: detached signature;
o bobcat_3.25.01-x.tar.gz: source archive;
o bobcat_3.25.01-x_i386.changes: change log;
o libbobcat1_3.25.01-x_*.deb: debian package holding the libraries;
o libbobcat1-dev_3.25.01-x_*.deb: debian package holding the libraries, headers and manual pages;
o http://sourceforge.net/projects/bobcat: public archive location;

BOBCAT

Bobcat is an acronym of ‘Brokken\(cqs Own Base Classes And Templates\(cq.

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

Search for    or go to Top of page |  Section 3 |  Main Index


libbobcat-dev_3&.25&.01-x&.tar&.gz FBB::OHEXSTREAMBUF (3bobcat) 2005-2015

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.