includefile(include/header)

COMMENT(manpage, section, releasedate, archive, short name)
manpage(FBB::OHexStreambuf)(3bobcat)(_CurYrs_)
    (libbobcat-dev__CurVers_-x.tar.gz)(Write hex values)

manpagename(FBB::OHexStreambuf)(Writes characters written to an ostream as hex
values)

manpagesynopsis()
    bf(#include <bobcat/ohexstreambuf>)nl()
    Linking option: tt(-lbobcat) 

manpagedescription()

    bf(OHexStreambuf) is a specialization of tt(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 tt(OHexStreambuf) object is inserted
as (a series of) hexadecimal values, not only plain characters. E.g., when
inserting the value 123 the characters tt('1', '2') and tt('3') are
successively inserted and so this will result in the string tt(313233) being
inserted into the destination stream.

includefile(include/namespace)

manpagesection(INHERITS FROM)
    FBB::OFilterStreambuf


manpagesection(CONSTRUCTOR)
    itemization(
    itb(OFoldStreambuf(std::ostream &stream, size_t width = 0))
    The hexadecimal characters produced by the tt(OFoldStreambuf) object will
be inserted into tt(stream). Optionally the maximum line width (in number of
characters) may be specified using tt(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.

manpagesection(MEMBER FUNCTIONS)
     All members of bf(FBB::OFilterStreambuf), in particular its tt(out()) and
tt(open()) members are available, as bf(FBB::OHexStreambuf) inherits from
this class.
    itemization(
    itb(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
tt(size()) does not return 0 then the last line inserted was not terminated by
a tt('\n') character. See also the example below.

    This member's return value is undefined if  no maximum line length was
requested. 
    )

manpagesection(PROTECTED MEMBER FUNCTION)

    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 bf(OHexStreambuf)
can, in accordance with Liskov's Substitution Principle, be used as a
tt(std:streambuf); but it also offers a facility for classes deriving from
bf(OHexStreambuf). This facility is listed here.
    itemization(
    itb(int pSync())
        The contents of the bf(OHexStreambuf)'s internal buffer is flushed.
    )

manpagesection(STATIC MEMBER)
    itemization(
    itb(std::string text2bin(std::string const &in))
        This static member can be used to convert a series of hexadecimal
characters generated by a tt(OHexStreambuf) object back to their binary
form. E.g, when called as tt(OHexStreambuf::text2bin("736d616c6c206976")) then
the returned tt(std::string) will contain 8 characters, having respectively
the binary values 0x73, 0x6d, 0x61, 0x6c, 0x6c, 0x20, 0x69, and 0x76.

    This function does em(not) verify whether its argument is properly
formed. A properly formed argument consists of an even number of hexadecimal
number characters ('0' until '9', 'a' until 'f' (or uppercase)). For
improperly formed arguments the return value is undefined.

    )

manpagesection(EXAMPLE)
        verb(
    #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';
    }
            )

manpagefiles()
    em(bobcat/ohexstreambuf) - defines the class interface

manpageseealso()
    bf(bobcat)(7), bf(ofilterstreambuf)(3bobcat)

manpagebugs()
    None Reported.

includefile(include/trailer)
