16 #ifndef FILEWRITER_HPP
17 #define FILEWRITER_HPP
19 #include "Athena/IStreamWriter.hpp"
29 FileWriter(
const std::string& filename,
bool overwrite =
true);
32 void setEndian(Endian endian);
33 Endian endian()
const;
34 bool isBigEndian()
const;
35 bool isLittleEndian()
const;
36 void open(
bool overwrite =
true);
39 void seek(atInt64 pos, SeekOrigin origin = SeekOrigin::Current);
40 inline void seekAlign32() {seek(ROUND_UP_32(position()), SeekOrigin::Begin);}
42 atUint64 position()
const;
43 atUint64 length()
const;
45 void writeBit(
bool val);
46 void seekBit(
int bit);
47 void writeUByte(atUint8 val);
48 void writeByte(atInt8 val);
49 void writeUBytes(atUint8* data, atUint64 len);
50 void writeBytes(atInt8* data, atUint64 len);
51 void writeUint16(atUint16 val);
52 void writeInt16(atInt16 val);
53 void writeUint32(atUint32 val);
54 void writeInt32(atInt32 val);
55 void writeUint64(atUint64 val);
56 void writeInt64(atInt64 val);
57 void writeDouble(
double val);
58 void writeFloat(
float val);
59 void writeBool(
bool val);
60 void writeString(
const std::string& val);
61 void writeUnicode(
const std::string& str);
62 void fill(atInt8 byte, atUint64 len);
63 void fill(atUint8 byte, atUint64 len);
65 std::string m_filename;
68 atUint8 m_currentByte;
69 atUint64 m_bytePosition;
76 #ifndef FILEWRITER_BASE
77 #define FILEWRITER_BASE() \
79 typedef Athena::io::FileWriter base;
81 #endif // FILEWRITER_BASE
82 #endif // FILEWRITER_HPP