This is the documentation for Enlighten.

module Serialisation

Classes

Name Description
Geo::GeoBufferedFileStream

Simple IGeoStream implementation that saves/loads data into/from memory and performs all read/write operations on this copy.

Geo::GeoFileStream

Simple IGeoStream implementation that saves/loads data from a file.

Geo::GeoMemoryStream

Simple IGeoStream implementation that saves/loads data to a block of memory.

Geo::GeoZLibFileStream

IGeoStream implementation that saves/loads data from a zlib compressed file.

Geo::IffReader

An IffReader allows you to use an IGeoStream to read Iff format binary files easily.

Geo::IffWriter

An IffWriter allows you to use an IGeoStream to create Iff format binary files easily.

Geo::IGeoInputStream

An IGeoInputStream allows you to read memory/files in a consistent manner, and is an extension point for users wishing to control where data is stored.

Geo::IGeoReleasable

A class implementing IGeoReleasable is usually created by the Enlighten libraries and so must have Release() called in order to return the memory.

Geo::IGeoSerialisable

A class implementing IGeoSerialisable adds the ability to save and load instances of the type from an IGeoStream.

Geo::IGeoStream

An IGeoStream allows you to read/write memory/files in a consistent manner, and is an extension point for users wishing to control where data is stored.

Geo::WriteRangePolicy

Policy to write pointers as a range with the given element count.

Geo::ZeroedPadding

Defines an N-byte block of padding which is zeroed on construction.

Functions

Name Description
~GeoZLibFileStream()

Closes current file, if open.

CheckPaddingZeroed(const T &)

Checks if the given object has all it's 'padding' fields set to zero.

Close()

Close current file, if any.

Compatibility_ReadWideString(IffReader &, GeoString< char > &, Geo::s32)

Read a type that used to be GeoString<wchar_t>, and is now GeoString<char>

CompressStream(GeoMemoryStream &, GeoMemoryStream &)

Compress the input stream with the ZLib library, placing the result in the output stream.

CopyStreamToStream(IGeoStream &, GeoMemoryStream &)

Copy the contents of the source IGeoStream (src) to the destination GeoMemoryStream (dst).

GeoZLibFileStream()

Create with no attached file.

GetFilename()

Return the filename with which this stream was opened (not available if created with FILE*)

GetPosition()

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

IsEof()

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

IsOk()

Tests if the stream is valid.

LoadInterface(const char *, u32, bool)

Load a Precompute interface from disk, using the given filename.

LoadInterface(IGeoInputStream &, u32)

Load an Interface object from a stream. Interface must have same functional API as an IGeoSerialisable.

LoadInterfaceCompressed(const char *, u32, bool)

Load an IGeoSerialisable interface from disk, using the given compressed or uncompressed file.

MakeFileStream(const char *, IGeoStream::EStreamMode, GeoFileStream::EStreamFormat)

Factory method to create appropriate file stream like object.

Open(char const *, EStreamMode)

Close current file, if any, and open filename.

Read(void *, size_t, size_t)

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

ReadArray(IGeoInputStream &, GeoArray< T > &)

Helper function to read a GeoArray from an IGeoInputStream, with all memory issues monitored and errors reported to GeoPrintf.

ReadMap(IGeoInputStream &, GeoMap< K, T > &)

Helper function to read a GeoMap from an IGeoInputStream, with all memory issues monitored and errors reported to GeoPrintf.

ReadObject(IGeoInputStream &, Geo::GeoArray< T > &)

ReadObject adapter for ReadArray.

ReadObject(Reader &, T &)

default implementation of overloadable reader function

ReadObject(IGeoInputStream &, bool &)

Ensure that boolean values are read/written 'efficiently' and portably.

SaveInterface(const Interface *, const char *, Geo::u32)

Save an IGeoSerialisable interface to disk, using the given filename.

SaveInterfaceCompressed(const Interface *, const char *, Geo::u32)

Save an IGeoSerialisable interface to disk in compressed format, using the given filename.

SaveInterfaceIfChanged(const Interface *, const char *, Geo::u32)

Save an IGeoSerialisable interface to disk, using the given filename.

SetPosition(u64)

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

UncompressStream(GeoMemoryStream &, GeoMemoryStream &)

Uncompress a stream created by the CompressStream function above into a new stream.

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 T &)

Write a single object, returning true on success.

WriteArray(IGeoStream &, const GeoArray< T > &)

Helper function to write a GeoArray to an IGeoStream. Deals with arrays of values.

WriteArray(IGeoStream &, const GeoImmutableArray< T > &)

Helper function to write a GeoImmutableArray to an IGeoStream. Deals with arrays of values.

WriteArray(IGeoStream &, const GeoArray< T * > &)

Helper function to write a GeoArray to an IGeoStream.

WriteArrayImpl(Writer &, const T *, const T *)

Write an array to the stream.

WriteFileIfChanged(GeoMemoryStream &, const char *)

Save a GeoMemoryStream to disk, modifying the file only if the contents change (or the file didn't exist).

WriteMap(IGeoStream &, const GeoMap< K, T > &)

Helper function to write a GeoMap to an IGeoStream.

WriteObject(IGeoStream &, const Geo::GeoArray< T > &)

WriteObject adapter for WriteArray.

WriteObject(IGeoStream &, const Geo::GeoImmutableArray< T > &)

WriteObject adapter for WriteArray.

WriteObject(IGeoStream &, ArrayRange< T >)

Write a blittable range object to the stream.

WriteObject(IGeoStream &, bool const &)

Ensure that boolean values are read/written 'efficiently' and portably.

WriteObject(IGeoStream &, const Geo::GeoPair< T1, T2 > &)

Write a GeoPair that is not blittable because it contains padding.

WriteObject(Writer &, const T &)

default implementation of overloadable writer function

WriteProperty(Geo::IGeoStream &, const char *, const T &, bool)

Write a blittable property.

WriteProperty(IGeoStream &, const char *, ArrayRange< T >)

Write a range property to the stream.

WriteRange(IGeoStream &, Iterator, Iterator)

Write a range property to the stream.

WriteRange(IGeoStream &, ArrayRange< T >)

Write a blittable range object to the stream.

WriteRangeImpl(Writer &, const T *, const T *, GeoStd::FalseType)

Write a non-blittable range to the stream.


Geo::GeoZLibFileStream::~GeoZLibFileStream


public: ~GeoZLibFileStream()


Closes current file, if open.


void Geo::CheckPaddingZeroed


public: void CheckPaddingZeroed
(
    const T & object
)


Checks if the given object has all it's 'padding' fields set to zero.

Padding fields are identified by their name.


bool Geo::GeoZLibFileStream::Close


public: bool Close()


Close current file, if any.


bool Geo::Compatibility_ReadWideString


public: bool Compatibility_ReadWideString
(
    IffReader & reader,
    GeoString< char > & object,
    Geo::s32 lastWideVersion
)


Read a type that used to be GeoString<wchar_t>, and is now GeoString<char>


bool GEO_CALL Geo::CompressStream


public: bool GEO_CALL CompressStream
(
    GeoMemoryStream & input,
    GeoMemoryStream & output
)


Compress the input stream with the ZLib library, placing the result in the output stream.


bool GEO_CALL Geo::CopyStreamToStream


public: bool GEO_CALL CopyStreamToStream
(
    IGeoStream & src,
    GeoMemoryStream & dst
)


Copy the contents of the source IGeoStream (src) to the destination GeoMemoryStream (dst).


Geo::GeoZLibFileStream::GeoZLibFileStream


public: GeoZLibFileStream()


Create with no attached file.


const char * Geo::GeoZLibFileStream::GetFilename


public: const char * GetFilename() const


Return the filename with which this stream was opened (not available if created with FILE*)


u64 Geo::GeoZLibFileStream::GetPosition


public: virtual u64 GetPosition() const


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


bool Geo::GeoZLibFileStream::IsEof


public: virtual 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)


bool Geo::GeoZLibFileStream::IsOk


public: virtual bool IsOk() const


Tests if the stream is valid.


Interface* Geo::LoadInterface


public: Interface * LoadInterface
(
    const char * filename,
    u32 section,
    bool warnError
)


Load a Precompute interface from disk, using the given filename.


Interface* Geo::LoadInterface


public: Interface * LoadInterface
(
    IGeoInputStream & stream,
    u32 section
)


Load an Interface object from a stream. Interface must have same functional API as an IGeoSerialisable.


Interface * Geo::LoadInterfaceCompressed


public: Interface * LoadInterfaceCompressed
(
    const char * filename,
    u32 section,
    bool warnError
)


Load an IGeoSerialisable interface from disk, using the given compressed or uncompressed file.


IGeoStream* Geo::MakeFileStream


public: IGeoStream * MakeFileStream
(
    const char * filename,
    IGeoStream::EStreamMode mode,
    GeoFileStream::EStreamFormat format
)


Factory method to create appropriate file stream like object.


bool Geo::GeoZLibFileStream::Open


public: bool Open
(
    char const * filename,
    EStreamMode mode
)


Close current file, if any, and open filename.


size_t Geo::GeoZLibFileStream::Read


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


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


bool Geo::ReadArray


public: bool ReadArray
(
    IGeoInputStream & reader,
    GeoArray< T > & objects
)


Helper function to read a GeoArray from an IGeoInputStream, with all memory issues monitored and errors reported to GeoPrintf.

Deals with arrays of values, the contained type must be considered blittable (see IsBlittable<T>).


bool Geo::ReadMap


public: bool ReadMap
(
    IGeoInputStream & reader,
    GeoMap< K, T > & map
)


Helper function to read a GeoMap from an IGeoInputStream, with all memory issues monitored and errors reported to GeoPrintf.

Deals with arrays of values, the contained type must be considered blittable (see IsBlittable<T>).


void Geo::ReadObject


public: void ReadObject
(
    IGeoInputStream & reader,
    Geo::GeoArray< T > & objects
)


ReadObject adapter for ReadArray.


void Geo::ReadObject


public: void ReadObject
(
    Reader & ,
    T &
)


default implementation of overloadable reader function


void Geo::ReadObject


public: void ReadObject
(
    IGeoInputStream & stream,
    bool & object
)


Ensure that boolean values are read/written 'efficiently' and portably.


bool Geo::SaveInterface


public: bool SaveInterface
(
    const Interface * pInterface,
    const char * filename,
    Geo::u32 section
)


Save an IGeoSerialisable interface to disk, using the given filename.


bool Geo::SaveInterfaceCompressed


public: bool SaveInterfaceCompressed
(
    const Interface * pInterface,
    const char * filename,
    Geo::u32 section
)


Save an IGeoSerialisable interface to disk in compressed format, using the given filename.


bool Geo::SaveInterfaceIfChanged


public: bool SaveInterfaceIfChanged
(
    const Interface * pInterface,
    const char * filename,
    Geo::u32 section
)


Save an IGeoSerialisable interface to disk, using the given filename.


bool Geo::GeoZLibFileStream::SetPosition


public: virtual bool SetPosition
(
    u64 pos
)


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


bool GEO_CALL Geo::UncompressStream


public: bool GEO_CALL UncompressStream
(
    GeoMemoryStream & input,
    GeoMemoryStream & output
)


Uncompress a stream created by the CompressStream function above into a new stream.


bool Geo::IGeoStream::Write


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


size_t Geo::GeoZLibFileStream::Write


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


Write data (prototype matches fwrite). Prefer to use the templated Write methods.


GEO_FORCE_INLINE bool Geo::IGeoStream::Write


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


bool Geo::WriteArray


public: bool WriteArray
(
    IGeoStream & writer,
    const GeoArray< T > & objects
)


Helper function to write a GeoArray to an IGeoStream. Deals with arrays of values.


bool Geo::WriteArray


public: bool WriteArray
(
    IGeoStream & writer,
    const GeoImmutableArray< T > & objects
)


Helper function to write a GeoImmutableArray to an IGeoStream. Deals with arrays of values.


bool Geo::WriteArray


public: bool WriteArray
(
    IGeoStream & writer,
    const GeoArray< T * > & objects
)


Helper function to write a GeoArray to an IGeoStream.

Deals with arrays of pointers, the storage type must implement IGeoSerialisable (or at least have same function prototype)


bool Geo::WriteArrayImpl


public: bool WriteArrayImpl
(
    Writer & writer,
    const T * first,
    const T * last
)


Write an array to the stream.


bool GEO_CALL Geo::WriteFileIfChanged


public: bool GEO_CALL WriteFileIfChanged
(
    GeoMemoryStream & ms,
    const char * filename
)


Save a GeoMemoryStream to disk, modifying the file only if the contents change (or the file didn't exist).


bool Geo::WriteMap


public: bool WriteMap
(
    IGeoStream & writer,
    const GeoMap< K, T > & map
)


Helper function to write a GeoMap to an IGeoStream.

Deals with arrays of values, the contained type must be considered blittable (see IsBlittable<T>).


void Geo::WriteObject


public: void WriteObject
(
    IGeoStream & writer,
    const Geo::GeoArray< T > & objects
)


WriteObject adapter for WriteArray.


void Geo::WriteObject


public: void WriteObject
(
    IGeoStream & writer,
    const Geo::GeoImmutableArray< T > & objects
)


WriteObject adapter for WriteArray.


void Geo::WriteObject


public: void WriteObject
(
    IGeoStream & stream,
    ArrayRange< T > range
)


Write a blittable range object to the stream.


void Geo::WriteObject


public: void WriteObject
(
    IGeoStream & stream,
    bool const & object
)


Ensure that boolean values are read/written 'efficiently' and portably.


void Geo::WriteObject


public: void WriteObject
(
    IGeoStream & stream,
    const Geo::GeoPair< T1, T2 > & p
)


Write a GeoPair that is not blittable because it contains padding.


void Geo::WriteObject


public: void WriteObject
(
    Writer & ,
    const T &
)


default implementation of overloadable writer function


void Geo::WriteProperty


public: void WriteProperty
(
    Geo::IGeoStream & stream,
    const char * name,
    const T & value,
    bool isFlaky
)


Write a blittable property.


void Geo::WriteProperty


public: void WriteProperty
(
    IGeoStream & stream,
    const char * name,
    ArrayRange< T > range
)


Write a range property to the stream.


void Geo::WriteRange


public: void WriteRange
(
    IGeoStream & stream,
    Iterator first,
    Iterator last
)


Write a range property to the stream.


void Geo::WriteRange


public: void WriteRange
(
    IGeoStream & stream,
    ArrayRange< T > range
)


Write a blittable range object to the stream.


bool Geo::WriteRangeImpl


public: bool WriteRangeImpl
(
    Writer & writer,
    const T * first,
    const T * last,
    GeoStd::FalseType isBlittable
)


Write a non-blittable range to the stream.

Write a blittable range to the stream.