Athena IO Library
athena::io::FileWriter Class Reference
Inheritance diagram for athena::io::FileWriter:
Inheritance graph
Collaboration diagram for athena::io::FileWriter:
Collaboration graph

Public Member Functions

 FileWriter (const std::string &filename, bool overwrite=true, bool globalErr=true)
 
 FileWriter (const std::wstring &filename, bool overwrite=true, bool globalErr=true)
 
std::string filename () const
 
std::wstring wfilename () const
 
void open (bool overwrite=true)
 
void close ()
 
bool isOpen () const
 
void seek (atInt64 pos, SeekOrigin origin=SeekOrigin::Current)
 Sets the buffers position relative to the specified position.
It seeks relative to the current position by default. More...
 
atUint64 position () const
 Returns the current position in the stream. More...
 
atUint64 length () const
 Returns whether or not the stream is at the end. More...
 
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 undefined behavior to try and write a buffer which is smaller than the given length. More...
 
FILE * _fileHandle ()
 
- Public Member Functions inherited from athena::io::IStreamWriter
void seekAlign32 ()
 Sets the buffers position relative to the next 32-byte aligned position.

 
bool atEnd () const
 Returns whether or not the stream is at the end. More...
 
void writeUByte (atUint8 val)
 Writes a byte at the current position and advances the position by one byte. More...
 
void writeVal (atUint8 val)
 
void writeValLittle (atUint8 val)
 
void writeValBig (atUint8 val)
 
void writeByte (atInt8 val)
 Writes a byte at the current position and advances the position by one byte. More...
 
void writeVal (atInt8 val)
 
void writeValLittle (atInt8 val)
 
void writeValBig (atInt8 val)
 
void writeBytes (const void *data, atUint64 len)
 Writes the given buffer with the specified length, buffers can be bigger than the length however it's undefined behavior to try and write a buffer which is smaller than the given length. More...
 
void writeInt16 (atInt16 val)
 Writes an Int16 to the buffer and advances the buffer. It also swaps the bytes depending on the platform and Stream settings. More...
 
void writeVal (atInt16 val)
 
void writeInt16Little (atInt16 val)
 Writes an Int16 to the buffer and advances the buffer. It also swaps the bytes against little depending on the platform. More...
 
void writeValLittle (atInt16 val)
 
void writeInt16Big (atInt16 val)
 Writes an Int16 to the buffer and advances the buffer. It also swaps the bytes against big depending on the platform. More...
 
void writeValBig (atInt16 val)
 
void writeUint16 (atUint16 val)
 Writes an Uint16 to the buffer and advances the buffer. It also swaps the bytes depending on the platform and Stream settings. More...
 
void writeVal (atUint16 val)
 
void writeUint16Little (atUint16 val)
 Writes an Uint16 to the buffer and advances the buffer. It also swaps the bytes against little depending on the platform. More...
 
void writeValLittle (atUint16 val)
 
void writeUint16Big (atUint16 val)
 Writes an Uint16 to the buffer and advances the buffer. It also swaps the bytes against big depending on the platform. More...
 
void writeValBig (atUint16 val)
 
void writeInt32 (atInt32 val)
 Writes an Int32 to the buffer and advances the buffer. It also swaps the bytes depending on the platform and Stream settings. More...
 
void writeVal (atInt32 val)
 
void writeInt32Little (atInt32 val)
 Writes an Int32 to the buffer and advances the buffer. It also swaps the bytes against little depending on the platform. More...
 
void writeValLittle (atInt32 val)
 
void writeInt32Big (atInt32 val)
 Writes an Int32 to the buffer and advances the buffer. It also swaps the bytes against big depending on the platform. More...
 
void writeValBig (atInt32 val)
 
void writeUint32 (atUint32 val)
 Writes an Uint32 to the buffer and advances the buffer. It also swaps the bytes depending on the platform and Stream settings. More...
 
void writeVal (atUint32 val)
 
void writeUint32Little (atUint32 val)
 Writes an Uint32 to the buffer and advances the buffer. It also swaps the bytes against little depending on the platform. More...
 
void writeValLittle (atUint32 val)
 
void writeUint32Big (atUint32 val)
 Writes an Uint32 to the buffer and advances the buffer. It also swaps the bytes against big depending on the platform. More...
 
void writeValBig (atUint32 val)
 
void writeInt64 (atInt64 val)
 Writes an Int64 to the buffer and advances the buffer. It also swaps the bytes depending on the platform and Stream settings. More...
 
void writeVal (atInt64 val)
 
void writeInt64Little (atInt64 val)
 Writes an Int64 to the buffer and advances the buffer. It also swaps the bytes against little depending on the platform. More...
 
void writeValLittle (atInt64 val)
 
void writeInt64Big (atInt64 val)
 Writes an Int64 to the buffer and advances the buffer. It also swaps the bytes against big depending on the platform. More...
 
void writeValBig (atInt64 val)
 
void writeUint64 (atUint64 val)
 Writes an Uint64 to the buffer and advances the buffer. It also swaps the bytes depending on the platform and Stream settings. More...
 
void writeVal (atUint64 val)
 
void writeUint64Little (atUint64 val)
 Writes an Uint64 to the buffer and advances the buffer. It also swaps the bytes against little depending on the platform. More...
 
void writeValLittle (atUint64 val)
 
void writeUint64Big (atUint64 val)
 Writes an Uint64 to the buffer and advances the buffer. It also swaps the bytes against big depending on the platform. More...
 
void writeValBig (atUint64 val)
 
void writeFloat (float val)
 Writes an float to the buffer and advances the buffer. It also swaps the bytes depending on the platform and Stream settings. More...
 
void writeVal (float val)
 
void writeFloatLittle (float val)
 Writes an float to the buffer and advances the buffer. It also swaps the bytes against little depending on the platform. More...
 
void writeValLittle (float val)
 
void writeFloatBig (float val)
 Writes an float to the buffer and advances the buffer. It also swaps the bytes against big depending on the platform. More...
 
void writeValBig (float val)
 
void writeDouble (double val)
 Writes an double to the buffer and advances the buffer. It also swaps the bytes depending on the platform and Stream settings. More...
 
void writeVal (double val)
 
void writeDoubleLittle (double val)
 Writes an double to the buffer and advances the buffer. It also swaps the bytes against little depending on the platform. More...
 
void writeValLittle (double val)
 
void writeDoubleBig (double val)
 Writes an double to the buffer and advances the buffer. It also swaps the bytes against big depending on the platform. More...
 
void writeValBig (double val)
 
void writeBool (bool val)
 Writes an bool to the buffer and advances the buffer. It also swaps the bytes depending on the platform and Stream settings. More...
 
void writeVal (bool val)
 
void writeValLittle (bool val)
 
void writeValBig (bool val)
 
void writeVec2f (const atVec2f &vec)
 Writes an atVec2f (8 bytes) to the buffer and advances the buffer. It also swaps the bytes depending on the platform and Stream settings. More...
 
void writeVal (const atVec2f &val)
 
void writeVec2fLittle (const atVec2f &vec)
 Writes an atVec2f (8 bytes) to the buffer and advances the buffer. It also swaps the bytes against little depending on the platform. More...
 
void writeValLittle (const atVec2f &val)
 
void writeVec2fBig (const atVec2f &vec)
 Writes an atVec2f (8 bytes) to the buffer and advances the buffer. It also swaps the bytes against big depending on the platform. More...
 
void writeValBig (const atVec2f &val)
 
void writeVec3f (const atVec3f &vec)
 Writes an atVec3f (12 bytes) to the buffer and advances the buffer. It also swaps the bytes depending on the platform and Stream settings. More...
 
void writeVal (const atVec3f &val)
 
void writeVec3fLittle (const atVec3f &vec)
 Writes an atVec3f (12 bytes) to the buffer and advances the buffer. It also swaps the bytes against little depending on the platform. More...
 
void writeValLittle (const atVec3f &val)
 
void writeVec3fBig (const atVec3f &vec)
 Writes an atVec3f (12 bytes) to the buffer and advances the buffer. It also swaps the bytes against big depending on the platform. More...
 
void writeValBig (const atVec3f &val)
 
void writeVec4f (const atVec4f &vec)
 Writes an atVec4f (16 bytes) to the buffer and advances the buffer. It also swaps the bytes depending on the platform and Stream settings. More...
 
void writeVal (const atVec4f &val)
 
void writeVec4fLittle (const atVec4f &vec)
 Writes an atVec4f (16 bytes) to the buffer and advances the buffer. It also swaps the bytes against little depending on the platform. More...
 
void writeValLittle (const atVec4f &val)
 
void writeVec4fBig (const atVec4f &vec)
 Writes an atVec4f (16 bytes) to the buffer and advances the buffer. It also swaps the bytes against big depending on the platform. More...
 
void writeValBig (const atVec4f &val)
 
void writeVec2d (const atVec2d &vec)
 Writes an atVec2d (16 bytes) to the buffer and advances the buffer. It also swaps the bytes depending on the platform and Stream settings. More...
 
void writeVal (const atVec2d &val)
 
void writeVec2dLittle (const atVec2d &vec)
 Writes an atVec2d (16 bytes) to the buffer and advances the buffer. It also swaps the bytes against little depending on the platform. More...
 
void writeValLittle (const atVec2d &val)
 
void writeVec2dBig (const atVec2d &vec)
 Writes an atVec2d (16 bytes) to the buffer and advances the buffer. It also swaps the bytes against big depending on the platform. More...
 
void writeValBig (const atVec2d &val)
 
void writeVec3d (const atVec3d &vec)
 Writes an atVec3d (24 bytes) to the buffer and advances the buffer. It also swaps the bytes depending on the platform and Stream settings. More...
 
void writeVal (const atVec3d &val)
 
void writeVec3dLittle (const atVec3d &vec)
 Writes an atVec3d (24 bytes) to the buffer and advances the buffer. It also swaps the bytes against little depending on the platform. More...
 
void writeValLittle (const atVec3d &val)
 
void writeVec3dBig (const atVec3d &vec)
 Writes an atVec3d (24 bytes) to the buffer and advances the buffer. It also swaps the bytes against big depending on the platform. More...
 
void writeValBig (const atVec3d &val)
 
void writeVec4d (const atVec4d &vec)
 Writes an atVec4d (32 bytes) to the buffer and advances the buffer. It also swaps the bytes depending on the platform and Stream settings. More...
 
void writeVal (const atVec4d &val)
 
void writeVec4dLittle (const atVec4d &vec)
 Writes an atVec4d (32 bytes) to the buffer and advances the buffer. It also swaps the bytes against little depending on the platform. More...
 
void writeValLittle (const atVec4d &val)
 
void writeVec4dBig (const atVec4d &vec)
 Writes an atVec4d (32 bytes) to the buffer and advances the buffer. It also swaps the bytes against big depending on the platform. More...
 
void writeValBig (const atVec4d &val)
 
void writeStringAsWString (const std::string &str, atInt32 fixedLen=-1)
 Converts a UTF8 string to a wide-char string in the buffer and advances the buffer. It also swaps the bytes depending on the platform and Stream settings. More...
 
void writeStringAsWStringLittle (const std::string &str, atInt32 fixedLen=-1)
 Converts a UTF8 string to a wide-char string in the buffer and advances the buffer. It also swaps the bytes depending on the platform and Stream settings. More...
 
void writeStringAsWStringBig (const std::string &str, atInt32 fixedLen=-1)
 Converts a UTF8 string to a wide-char string in the buffer and advances the buffer. It also swaps the bytes depending on the platform and Stream settings. More...
 
void writeString (const std::string &str, atInt32 fixedLen=-1)
 Writes an string to the buffer and advances the buffer. More...
 
void writeVal (const std::string &val)
 
void writeWString (const std::wstring &str, atInt32 fixedLen=-1)
 Writes an wstring to the buffer and advances the buffer. More...
 
void writeVal (const std::wstring &val)
 
void writeWStringLittle (const std::wstring &str, atInt32 fixedLen=-1)
 Writes an wstring to the buffer and advances the buffer. More...
 
void writeValLittle (const std::wstring &val)
 
void writeWStringBig (const std::wstring &str, atInt32 fixedLen=-1)
 Writes an wstring to the buffer and advances the buffer. More...
 
void writeValBig (const std::wstring &val)
 
void fill (atUint8 val, atUint64 length)
 
void fill (atInt8 val, atUint64 length)
 
template<class T >
void enumerate (const std::vector< T > &vector, typename std::enable_if< std::is_arithmetic< T >::value||std::is_same< T, atVec2f >::value||std::is_same< T, atVec3f >::value||std::is_same< T, atVec4f >::value >::type *=0)
 Performs automatic std::vector enumeration writes using numeric type T. More...
 
template<class T >
void enumerateLittle (const std::vector< T > &vector, typename std::enable_if< std::is_arithmetic< T >::value||std::is_same< T, atVec2f >::value||std::is_same< T, atVec3f >::value||std::is_same< T, atVec4f >::value >::type *=0)
 Performs automatic std::vector enumeration writes using numeric type T. More...
 
template<class T >
void enumerateBig (const std::vector< T > &vector, typename std::enable_if< std::is_arithmetic< T >::value||std::is_same< T, atVec2f >::value||std::is_same< T, atVec3f >::value||std::is_same< T, atVec4f >::value >::type *=0)
 Performs automatic std::vector enumeration writes using numeric type T. More...
 
template<class T >
void enumerate (const std::vector< T > &vector, typename std::enable_if<!std::is_arithmetic< T >::value &&!std::is_same< T, atVec2f >::value &&!std::is_same< T, atVec3f >::value &&!std::is_same< T, atVec4f >::value >::type *=0)
 Performs automatic std::vector enumeration writes using non-numeric type T. More...
 
- Public Member Functions inherited from athena::io::IStream
void setEndian (Endian endian)
 
Endian endian () const
 
bool isBigEndian () const
 
bool isLittleEndian () const
 
bool hasError () const
 

Additional Inherited Members

- Protected Member Functions inherited from athena::io::IStream
void setError ()
 
- Protected Attributes inherited from athena::io::IStream
bool m_hasError = false
 
Endian m_endian = BigEndian
 

Detailed Description

Definition at line 11 of file FileWriter.hpp.

Member Function Documentation

atUint64 athena::io::FileWriter::length ( ) const
virtual

Returns whether or not the stream is at the end.

Returns
True if at end; False otherwise.

Implements athena::io::IStreamWriter.

atUint64 athena::io::FileWriter::position ( ) const
virtual

Returns the current position in the stream.

Returns
The current position in the stream.

Implements athena::io::IStreamWriter.

void athena::io::FileWriter::seek ( atInt64  pos,
SeekOrigin  origin = SeekOrigin::Current 
)
virtual

Sets the buffers position relative to the specified position.
It seeks relative to the current position by default.

Parameters
positionwhere in the buffer to seek
originThe location to seek relative to

Implements athena::io::IStreamWriter.

void athena::io::FileWriter::writeUBytes ( const atUint8 *  data,
atUint64  len 
)
virtual

Writes the given buffer with the specified length, buffers can be bigger than the length however it's undefined behavior to try and write a buffer which is smaller than the given length.

Parameters
dataThe buffer to write
lengthThe amount to write

Implements athena::io::IStreamWriter.


The documentation for this class was generated from the following file: