#ifndef INCLUDED_BOBCAT_OHEXSTREAMBUF_
#define INCLUDED_BOBCAT_OHEXSTREAMBUF_

#include <iosfwd>

//#include <iosfwd>
//#include <string>
//#include <openssl/evp.h>
//#include <streambuf>
//#include <ostream>
#include <bobcat/errno>

#include <bobcat/ofilterstreambuf>

namespace FBB
{

class OHexStreambuf: public OFilterStreambuf
{
    std::ios::fmtflags d_current;
    char d_padding;
    size_t d_width;
    size_t d_count;

    public:
        OHexStreambuf(std::ostream &out, size_t width = 0);
        virtual ~OHexStreambuf();
        size_t size() const;

        static std::string text2bin(std::string const &in); // length and 
                                                            // contents not
                                                            // checked

    private:
        virtual int overflow(int ch);
        virtual int sync();
};

inline size_t OHexStreambuf::size() const
{
    return d_count;
}

} // FBB        
#endif





