└>Geo::IGeoStream
└>Geo::IGeoInputStream
An IffWriter allows you to use an IGeoStream to create Iff format binary files easily.
It is passed an IGeoStream in its constructor and also implements IGeoStream, thus making it like an Adaptor pattern. Although the class uses the terms 'BeginFile' and 'EndFile' the underlying stream can be of any type.
Name | Description |
---|---|
~IffWriter() | Note: Does not close the underlying IGeoStream (so you can write multiple Iff files to one IGeoStream) |
~IGeoInputStream() | Deleting a stream should behave like a close operation. |
~IGeoStream() | Deleting a stream should behave like a close operation. |
BeginChunk(u32) | Begin a new Iff chunk. |
BeginFile(u32, s32) | Write the Iff preamble and leave space to go back and fill in block data sizes, etc. |
BeginType(TypeId, u32) | Provide information about the typed data written to the stream. |
EndChunk() | Close the most recent chunk (note that the position of the stream when this is called determines the size of the chunk, be careful when jumping around inside IffWriter not to leave your current chunk) |
EndFile() | Close all open chunks, going back and filling in the chunk sizes before this point. |
EndType(u32) | Provide information about the typed data written to the stream. |
Fail() | Put the writer directly into a fail state. |
GetPosition() | Return the position of the read/write pointer within the stream (prototype matches ftell) |
GetPosition() | Wrap the IGeoStream::GetPosition function. |
GetPosition() | Return the position of the read/write pointer within the stream (prototype matches ftell) |
IffWriter(IGeoStream &) | Construct an IffWriter with a pre-existing IGeoStream. |
IsEof() | Is the read/write pointer at the end of the file (as with feof, only returns true if you have read past end) |
IsEof() | Is the read pointer at the end of the file (as with feof, only returns true if you have read past end) |
IsEof() | Wrap the IGeoStream::IsEof function (not expected to be used) |
IsOk() | Tests if the stream is valid. |
IsOk() | Tests if the stream is valid. |
IsOk() | Wrap the IGeoStream::IsOk function, returning status of the IffWriter also. |
IsWriterOk() | Return status of the writer. |
Read(T &) | Read a single object, returning true on success. |
Read(T(&)) | Read a fixed size array. |
Read(void *, size_t, size_t) | Wrap the IGeoStream::Read function, making it invalid. |
Read(TIter, TIter) | Read a collection of objects, returning true on success. |
Read(void *, size_t, size_t) | Read data (prototype matches fread). Prefer to use the templated Read methods. |
ReadImpl(T &, GeoStd::TrueType) | Read a single object, returning true on success. |
ReadImpl(T &, GeoStd::FalseType) | Read a single object, returning true on success. |
ReadToEnd() | Reads the stream to its end and returns the data as a char array. |
SetPosition(Geo::u64) | Set the position of the read/write pointer within the stream (prototype matches fseek) |
SetPosition(u64) | Set the position of the read/write pointer within the stream (prototype matches fseek) |
SetPosition(u64) | Wrap the IGeoStream::SetPosition function, be careful when jumping around inside IffWriter. |
Write(const T(&)) | Write a fixed size array. |
Write(TIter, TIter) | Write a collection of objects, in range [begin, end) as STL-style classes support. |
Write(const void *, size_t, size_t) | Write data (prototype matches fwrite). Prefer to use the templated Write methods. |
Write(const void *, size_t, size_t) | Wrap the IGeoStream::Write function, tracking the return code. |
Write(const T &) | Write a single object, returning true on success. |
Name | Description |
---|---|
EStreamMode | An IGeoStream is open in either esmRead or esmWrite mode. |
public: ~IffWriter()
Note: Does not close the underlying IGeoStream (so you can write multiple Iff files to one IGeoStream)
public: virtual ~IGeoInputStream()
Deleting a stream should behave like a close operation.
public: virtual ~IGeoStream()
Deleting a stream should behave like a close operation.
public: bool BeginChunk
(
u32 type
)
Begin a new Iff chunk.
These are used to allow selective loading (and to skip data that is not expected)
public: bool BeginFile
(
u32 fileType,
s32 fileVersion
)
Write the Iff preamble and leave space to go back and fill in block data sizes, etc.
You are encouraged to make the Iff tag public and somewhere that other code can access.
public: virtual u32 BeginType
(
TypeId type,
u32 count
)
Provide information about the typed data written to the stream.
public: bool EndChunk()
Close the most recent chunk (note that the position of the stream when this is called determines the size of the chunk, be careful when jumping around inside IffWriter not to leave your current chunk)
public: bool EndFile()
Close all open chunks, going back and filling in the chunk sizes before this point.
Does not close the underlying IGeoStream.
public: virtual void EndType
(
u32 index
)
Provide information about the typed data written to the stream.
public: void Fail()
Put the writer directly into a fail state.
public: u64 GetPosition() const
Return the position of the read/write pointer within the stream (prototype matches ftell)
public: virtual u64 GetPosition() const
Wrap the IGeoStream::GetPosition function.
public: Geo::u64 GetPosition() const
Return the position of the read/write pointer within the stream (prototype matches ftell)
public: IffWriter
(
IGeoStream & stream
)
Construct an IffWriter with a pre-existing IGeoStream.
public: bool IsEof() const
Is the read/write pointer at the end of the file (as with feof, only returns true if you have read past end)
public: bool IsEof() const
Is the read pointer at the end of the file (as with feof, only returns true if you have read past end)
public: virtual bool IsEof() const
Wrap the IGeoStream::IsEof function (not expected to be used)
public: bool IsOk() const
Tests if the stream is valid.
public: bool IsOk() const
Tests if the stream is valid.
public: virtual bool IsOk() const
Wrap the IGeoStream::IsOk function, returning status of the IffWriter also.
public: bool IsWriterOk() const
Return status of the writer.
Deprecated
Prefer to use the IGeoStream::IsOk() method
public: GEO_FORCE_INLINE bool Read
(
T & object
)
Read a single object, returning true on success.
There must either be a ReadObject overload for T, or T be considered blittable (see IsBlittable<T>).
public: bool Read
(
T(&) a
)
Read a fixed size array.
public: virtual size_t Read
(
void * pData,
size_t size,
size_t count
)
Wrap the IGeoStream::Read function, making it invalid.
public: bool Read
(
TIter begin,
TIter end
)
Read a collection of objects, returning true on success.
Object must be considered blittable (see IsBlittable<T>). Note that the storage must have been pre-allocated as it will write directly to the iterators provided. Given that we do not have the STL-style 'back-inserter' classes, for GeoArrays you should use the ReadArray helper function.
public: size_t Read
(
void * pData,
size_t size,
size_t count
)
Read data (prototype matches fread). Prefer to use the templated Read methods.
public: bool ReadImpl
(
T & object,
GeoStd::TrueType
)
Read a single object, returning true on success.
There must either be a ReadObject overload for T, or T be considered blittable (see IsBlittable<T>).
public: bool ReadImpl
(
T & object,
GeoStd::FalseType
)
Read a single object, returning true on success.
There must either be a ReadObject overload for T, or T be considered blittable (see IsBlittable<T>).
public: virtual Geo::GeoArray< char > ReadToEnd()
Reads the stream to its end and returns the data as a char array.
public: bool SetPosition
(
Geo::u64 pos
)
Set the position of the read/write pointer within the stream (prototype matches fseek)
public: bool SetPosition
(
u64 pos
)
Set the position of the read/write pointer within the stream (prototype matches fseek)
public: virtual bool SetPosition
(
u64 pos
)
Wrap the IGeoStream::SetPosition function, be careful when jumping around inside IffWriter.
public: bool Write
(
const T(&) a
)
Write a fixed size array.
public: bool Write
(
TIter begin,
TIter end
)
Write a collection of objects, in range [begin, end) as STL-style classes support.
Objects have same requirements single object Write (see IsBlittable<T>).
public: size_t Write
(
const void * pData,
size_t size,
size_t count
)
Write data (prototype matches fwrite). Prefer to use the templated Write methods.
public: virtual size_t Write
(
const void * pData,
size_t size,
size_t count
)
Wrap the IGeoStream::Write function, tracking the return code.
public: GEO_FORCE_INLINE bool Write
(
const T & object
)
Write a single object, returning true on success.
There must either be a WriteObject overload for T, or T must be blittable (see IsBlittable<T>).
public: enum EStreamMode
{
esmWrite,
esmRead
}
An IGeoStream is open in either esmRead or esmWrite mode.
esmWrite | |
esmRead |