#ifndef INCLUDED_BOBCAT_OHEXSTREAMBUF_
#define INCLUDED_BOBCAT_OHEXSTREAMBUF_

#include <iosfwd>

#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;                                // .f

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

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

#include "size.f"

} // FBB        
#endif





