
#ifndef __WFX_IO_ENDIANAWAREINPUTSTREAM_H__
#define __WFX_IO_ENDIANAWAREINPUTSTREAM_H__

#include <WFX/WFXIncludes.h>
#include <WFX/io/InputStreamDecorator.h>
#include <WFX/util/EndianConvert.h>

namespace WFX {

    namespace io {

        /**
         * Inputstream decorator base class
         */
        class EndianAwareInputStream : public InputStreamDecorator {
            public:
                /** Ctor */
                EndianAwareInputStream(InputStream* s);
                virtual ~EndianAwareInputStream();

                /** output operators */
                void operator >>(Int& i);
                void operator >>(UInt& i);
                void operator >>(Long& i);
                void operator >>(ULong& i);
                void operator >>(Short& i);
                void operator >>(UShort& i);
                void operator >>(Char& i);
                void operator >>(UChar& i);
                void operator >>(Real& r);
                
            protected:
            private:
                /** Endianess converter */
                WFX::util::EndianConvert* Converter;
        };

    }

}

#endif //include guard


