16 #ifndef FILESTREAM_HPP
17 #define FILESTREAM_HPP
19 #include "Athena/IStreamReader.hpp"
32 std::string filename()
const;
34 void setEndian(Endian endian);
35 Endian endian()
const;
36 bool isBigEndian()
const;
37 bool isLittleEndian()
const;
42 void seek(atInt64 pos, SeekOrigin origin = SeekOrigin::Current);
43 inline void seekAlign32() {seek(ROUND_UP_32(position()), SeekOrigin::Begin);}
45 atUint64 position()
const;
46 atUint64 length()
const;
53 atUint8* readUBytes(atUint64 len);
54 atInt8* readBytes(atUint64 len);
55 atUint64 readBytesToBuf(
void* buf, atUint64 len) {
return readUBytesToBuf(buf, len);}
56 atUint64 readUBytesToBuf(
void* buf, atUint64 len);
57 atUint16 readUint16();
59 atUint32 readUint32();
61 atUint64 readUint64();
66 std::string readString(atInt32 maxlen = -1);
67 std::string readUnicode(atInt32 maxlen = -1);
69 std::string m_filename;
72 atUint8 m_currentByte;
79 #ifndef FILEREADER_BASE
80 #define FILEREADER_BASE() \
82 typedef Athena::io::FileReader base
84 #endif // FILEREADER_BASE
86 #endif // FILESTREAM_HPP