athena/include/Athena/IStream.hpp

34 lines
756 B
C++
Raw Normal View History

2015-03-01 20:42:39 +00:00
#ifndef STREAM_HPP
#define STREAM_HPP
#include "Global.hpp"
namespace Athena
{
namespace io
{
std::ostream& operator<<(std::ostream& os, Endian& endian);
class IStream
{
public:
2015-07-22 20:40:22 +00:00
IStream() : m_hasError(false) {}
2015-03-01 20:42:39 +00:00
virtual ~IStream() {}
virtual void setEndian(Endian) = 0;
2015-05-19 03:24:56 +00:00
virtual Endian endian() const = 0;
virtual bool isBigEndian() const = 0;
virtual bool isLittleEndian()const = 0;
virtual void seek(atInt64, SeekOrigin) = 0;
virtual bool atEnd() const = 0;
virtual atUint64 position() const = 0;
virtual atUint64 length() const = 0;
2015-07-22 20:40:22 +00:00
bool hasError() const { return m_hasError; }
protected:
void setError() { m_hasError = true; }
bool m_hasError;
2015-03-01 20:42:39 +00:00
};
}
}
#endif // STREAM_HPP