Athena IO Library
IStream.hpp
1 // This file is part of libAthena.
2 //
3 // libAthena is free software: you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation, either version 3 of the License, or
6 // (at your option) any later version.
7 //
8 // libAthena is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with libAthena. If not, see <http://www.gnu.org/licenses/>
15 
16 #ifndef STREAM_HPP
17 #define STREAM_HPP
18 
19 #include "Global.hpp"
20 #include "Athena/NotImplementedException.hpp"
21 
22 namespace Athena
23 {
24 namespace io
25 {
26 std::ostream& operator<<(std::ostream& os, Endian& endian);
27 
28 class IStream
29 {
30 public:
31  virtual ~IStream() {}
32 
33  virtual void setEndian(Endian) = 0;
34  virtual Endian endian() const = 0;
35  virtual bool isBigEndian() const = 0;
36  virtual bool isLittleEndian()const = 0;
37  virtual bool isOpen() const = 0;
38  virtual void seek(atInt64, SeekOrigin) = 0;
39  virtual bool atEnd() const = 0;
40  virtual atUint64 position() const = 0;
41  virtual atUint64 length() const = 0;
42  virtual void seekBit(int) = 0;
43 };
44 }
45 }
46 #endif // STREAM_HPP