4 #include "athena/IStreamWriter.hpp" 14 FileWriter(
const std::string& filename,
bool overwrite =
true,
bool globalErr=
true);
15 FileWriter(
const std::wstring& filename,
bool overwrite =
true,
bool globalErr=
true);
18 inline std::string filename()
const 21 return utility::wideToUtf8(m_filename);
26 inline std::wstring wfilename()
const 31 return utility::utf8ToWide(m_filename);
35 void open(
bool overwrite =
true);
37 inline bool isOpen()
const 38 {
return m_fileHandle != NULL;}
39 void seek(atInt64 pos, SeekOrigin origin = SeekOrigin::Current);
42 void writeUBytes(
const atUint8* data, atUint64 len);
44 FILE* _fileHandle() {
return m_fileHandle;}
47 std::wstring m_filename;
49 std::string m_filename;
52 atUint8 m_currentByte;
53 atUint64 m_bytePosition;
59 #ifndef FILEWRITER_BASE 60 #define FILEWRITER_BASE() \ 62 typedef athena::io::FileWriter base; 64 #endif // FILEWRITER_BASE 65 #endif // FILEWRITER_HPP void seek(atInt64 pos, SeekOrigin origin=SeekOrigin::Current)
Sets the buffers position relative to the specified position. It seeks relative to the current posit...
atUint64 position() const
Returns the current position in the stream.
void writeUBytes(const atUint8 *data, atUint64 len)
Writes the given buffer with the specified length, buffers can be bigger than the length however it's...
atUint64 length() const
Returns whether or not the stream is at the end.