Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

class Geo::IffReader

    └>Geo::IGeoInputStream

An IffReader allows you to use an IGeoStream to read 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 function name 'BeginFile' the underlying stream can be of any type.

Functions

NameDescription
~IGeoInputStream()

Deleting a stream should behave like a close operation.

BeginFile()

Step into the main FORM chunk, extract the file type tag.

Fail()

Put the reader directly into a fail state.

GetChunkSize()

Return the size of the current chunk.

GetFileType()

Return the file type tag that was stored in IffReader::BeginFile()

GetFileVersion()

Return the file version code that was stored in IffReader::BeginFile()

GetNextChunk(bool)

The method of reading Iff files is to iterate over the chunks by calling 'GetNextChunk' until the function returns Iff::EOFTag.

GetPosition()

Wrap the IGeoStream::GetPosition function.

GetPosition()

Return the position of the read/write pointer within the stream (prototype matches ftell)

IffReader(IGeoInputStream &)

Construct an IffReader with a pre-existing IGeoStream.

IsEof()

Wrap the IGeoStream::IsEof function.

IsEof()

Is the read pointer at the end of the file (as with feof, only returns true if you have read past end)

IsOk()

Wrap the IGeoStream::IsOk function, returning status of the IffWriter also.

IsOk()

Tests if the stream is valid.

IsReaderOk()

Return status of the reader Note: Prefer to use the IGeoStream::IsOk() method.

NonCopyable(NonCopyable &&)

Defaulted to allow move.

operator=(NonCopyable &&)

Defaulted to allow move.

Read(void *, size_t, size_t)

Wrap the IGeoStream::Read function, tracking the return code.

Read(void *, size_t, size_t)

Read data (prototype matches fread). Prefer to use the templated Read methods.

Read(TIter, TIter)

Read a collection of objects, returning true on success.

Read(T(&))

Read a fixed size array.

Read(T &)

Read a single object, returning true on success.

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(u64)

Wrap the IGeoStream::SetPosition function, be careful when jumping around inside IffReader.

SetPosition(Geo::u64)

Set the position of the read/write pointer within the stream (prototype matches fseek)


Anchor
ae01b40e7a8901409e456597b1c47ae68
ae01b40e7a8901409e456597b1c47ae68

virtual Geo::IGeoInputStream::~IGeoInputStream

...

public: virtual ~IGeoInputStream()

...

Deleting a stream should behave like a close operation.


Anchor
a2ef6ea047ae5eed34057d72a7a6ff4e6
a2ef6ea047ae5eed34057d72a7a6ff4e6

bool Geo::IffReader::BeginFile

...

public: bool BeginFile()

...

Step into the main FORM chunk, extract the file type tag.

From there, read the first chunk (which should be VERS) and then the version code. Leaves the IffReader ready to iterate on


Anchor
a5c387ed590f4d664ee826106b97d7126
a5c387ed590f4d664ee826106b97d7126

void Geo::IffReader::Fail

...

public: void Fail()

...

Put the reader directly into a fail state.


Anchor
a811ca376e3ae0b1d27667ba8378e7529
a811ca376e3ae0b1d27667ba8378e7529

size_t Geo::IffReader::GetChunkSize

...

public: size_t GetChunkSize() const

...

Return the size of the current chunk.


Anchor
a98d602ab07e3b4c976b36d07f72dd2de
a98d602ab07e3b4c976b36d07f72dd2de

u32 Geo::IffReader::GetFileType

...

public: u32 GetFileType() const

...

Return the file type tag that was stored in IffReader::BeginFile()


Anchor
a32b3f12c89f6af8aafc70a05d93a0f9e
a32b3f12c89f6af8aafc70a05d93a0f9e

s32 Geo::IffReader::GetFileVersion

...

public: s32 GetFileVersion() const

...

Return the file version code that was stored in IffReader::BeginFile()


Anchor
a93cb9973b6fe9ffb608aa7fc5c13b8c8
a93cb9973b6fe9ffb608aa7fc5c13b8c8

u32 Geo::IffReader::GetNextChunk

...

public: u32 GetNextChunk
(
    bool stepIntoChunk
)

...

The method of reading Iff files is to iterate over the chunks by calling 'GetNextChunk' until the function returns Iff::EOFTag.

stepIntoChunk Chunks are usually on the same level, but if you wish to arrange them in a hierarchy the reader will have to pass 'true' for this parameter when first looking for child chunks.When the list of child chunks is exhausted, the function will return EOFTag. If stepIntoChunk is set to true and an EOFTag is returned, GetNextChunk has to be called again with stepIntoChunk set to false to actually proceed reading the file.


Anchor
a2a8ef85fec2761bb4a3938939c6584d0
a2a8ef85fec2761bb4a3938939c6584d0

virtual u64 Geo::IffReader::GetPosition

...

public: virtual u64 GetPosition() const

...

Wrap the IGeoStream::GetPosition function.


Anchor
abb2da2774c474f504e4e483e96437b75
abb2da2774c474f504e4e483e96437b75

virtual Geo::u64 Geo::IGeoInputStream::GetPosition

...

public: Geo::u64 GetPosition() const

...

Return the position of the read/write pointer within the stream (prototype matches ftell)


Anchor
acb78fcbe547f16802b60a089dbc985af
acb78fcbe547f16802b60a089dbc985af

Geo::IffReader::IffReader

...

public: IffReader
(
    IGeoInputStream & stream
)

...

Construct an IffReader with a pre-existing IGeoStream.


Anchor
a037ceaee099a99210489de7008f00e2b
a037ceaee099a99210489de7008f00e2b

virtual bool Geo::IffReader::IsEof

...

public: virtual bool IsEof() const

...

Wrap the IGeoStream::IsEof function.


Anchor
a1d5d6429a25d9275e1b77c2390222f73
a1d5d6429a25d9275e1b77c2390222f73

virtual bool Geo::IGeoInputStream::IsEof

...

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)


Anchor
ad00d21be90e243cae3d1e90506d57aaf
ad00d21be90e243cae3d1e90506d57aaf

virtual bool Geo::IffReader::IsOk

...

public: virtual bool IsOk() const

...

Wrap the IGeoStream::IsOk function, returning status of the IffWriter also.


Anchor
a1ffb27baedd5eab9e075389fd4a45263
a1ffb27baedd5eab9e075389fd4a45263

virtual bool Geo::IGeoInputStream::IsOk

...

public: bool IsOk() const

...

Tests if the stream is valid.


Anchor
ad12c1ba075619c85cf8369e1c3a89db7
ad12c1ba075619c85cf8369e1c3a89db7

bool Geo::IffReader::IsReaderOk

...

public: bool IsReaderOk() const

...

Return status of the reader Note: Prefer to use the IGeoStream::IsOk() method.


Anchor
adaed81b4c59f263dcb4e78c4126f4683
adaed81b4c59f263dcb4e78c4126f4683

Geo::NonCopyable::NonCopyable

...

public: NonCopyable
(
    NonCopyable &&
)

...

Defaulted to allow move.


Anchor
a6abc781e23b8f4864e0b868806e0acbf
a6abc781e23b8f4864e0b868806e0acbf

NonCopyable& Geo::NonCopyable::operator=

...

public: NonCopyable & operator=
(
    NonCopyable &&
)

...

Defaulted to allow move.


Anchor
a429967f3501e227a6e48388fcdd8b684
a429967f3501e227a6e48388fcdd8b684

virtual size_t Geo::IffReader::Read

...

public: virtual size_t Read
(
    void * pData,
    size_t size,
    size_t count
)

...

Wrap the IGeoStream::Read function, tracking the return code.


Anchor
a2bdc1ec2ed234832370c8e5f1dcc923c
a2bdc1ec2ed234832370c8e5f1dcc923c

virtual size_t Geo::IGeoInputStream::Read

...

public: size_t Read
(
    void * pData,
    size_t size,
    size_t count
)

...

Read data (prototype matches fread). Prefer to use the templated Read methods.


Anchor
a7564a03e0ebbee028920a1770ccc5cdd
a7564a03e0ebbee028920a1770ccc5cdd

bool Geo::IGeoInputStream::Read

...

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.


Anchor
a8873e5418d057d093fbdd0c69cc383f2
a8873e5418d057d093fbdd0c69cc383f2

bool Geo::IGeoInputStream::Read

...

public: bool Read
(
    T(&) a
)

...

Read a fixed size array.


Anchor
aa299ffca66c6b0cf5a4cdeedcebf4cf4
aa299ffca66c6b0cf5a4cdeedcebf4cf4

GEO_FORCE_INLINE bool Geo::IGeoInputStream::Read

...

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>).


Anchor
a95aa1b762401c201b68c020cb20a0e34
a95aa1b762401c201b68c020cb20a0e34

bool Geo::IGeoInputStream::ReadImpl

...

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>).


Anchor
a85890dac322ac71c33ec6049ff351000
a85890dac322ac71c33ec6049ff351000

bool Geo::IGeoInputStream::ReadImpl

...

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>).


Anchor
ad1748f884ed4358b4b42d8c8fc7b3fb7
ad1748f884ed4358b4b42d8c8fc7b3fb7

virtual Geo::GeoArray<char> Geo::IGeoInputStream::ReadToEnd

...

public: virtual Geo::GeoArray< char > ReadToEnd()

...

Reads the stream to its end and returns the data as a char array.


Anchor
a26b16e145cede271ea7b816650150377
a26b16e145cede271ea7b816650150377

virtual bool Geo::IffReader::SetPosition

...

public: virtual bool SetPosition
(
    u64 pos
)

...

Wrap the IGeoStream::SetPosition function, be careful when jumping around inside IffReader.


Anchor
aaedb05f09c0b2f105e77388160aa9541
aaedb05f09c0b2f105e77388160aa9541

virtual bool Geo::IGeoInputStream::SetPosition

...

public: bool SetPosition
(
    Geo::u64 pos
)

...

Set the position of the read/write pointer within the stream (prototype matches fseek)