#ifndef INCLUDED_BOBCAT_IOSTREAM_
#define INCLUDED_BOBCAT_IOSTREAM_

#include <bobcat/iobuf>

namespace FBB
{

class IOStream: private IOBuf, public std::istream, public std::ostream
{
    public:
        IOStream();                                         // 1.f
        IOStream(std::istream &in, std::ostream &out);      // 2.f

        void clear();
        void open(std::istream &in, std::ostream &out);     // .f
};

inline IOStream::IOStream()
:
    std::istream(this),
    std::ostream(this)
{}
inline IOStream::IOStream(std::istream &in, std::ostream &out)
:
    std::istream(this),
    std::ostream(this)
{
    open(in, out);
}
inline void IOStream::open(std::istream &in, std::ostream &out)
{
    IOBuf::reset(in, out);
}

} // namespace FBB

#endif
