This is the documentation for Enlighten.
class Geo GeoMemoryStream
class Geo::GeoMemoryStream
└>Geo::IGeoStream
└>Geo::IGeoInputStream
Simple IGeoStream implementation that saves/loads data to a block of memory.
Functions
Name | Description |
---|---|
~IGeoInputStream() | Deleting a stream should behave like a close operation. |
~IGeoStream() | Deleting a stream should behave like a close operation. |
BeginType(TypeId, u32) | Provide information about the typed data written to the stream. |
Close() | free current memory, if any |
EndType(u32) | Provide information about the typed data written to the stream. |
GetMemoryPtr() | Return the memory pointer. |
GetMemoryPtr() | Return the memory pointer. |
GetMemorySize() | Returns the current allocation size of the GeoMemoryStream. |
GetPosition() | Return the position of the read/write pointer within the stream (prototype matches ftell) |
GetPosition() | Return the position of the read/write pointer within the stream (prototype matches ftell) |
GetPosition() | Return the position of the read/write pointer within the stream (prototype matches ftell) |
GetUsedMemorySize() | Returns the current usage of the GeoMemoryStream. |
IsEof() | Is the read pointer at the end of the file (as with feof, only returns true if you have read past end) |
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/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. |
IsOk() | Tests if the stream is valid. |
IsOk() | Tests if the stream is valid. |
Open(size_t) | free current memory, if any, and start new block |
Open(char *, size_t) | free current memory, if any, and open existing block |
Read(T &) | Read a single object, returning true on success. |
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(void *, size_t, size_t) | Read data (prototype matches fread). Prefer to use the templated Read methods. |
Read(T(&)) | Read a fixed size array. |
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) | 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(Geo::u64) | Set the position of the read/write pointer within the stream (prototype matches fseek) |
SetUsedMemorySize(size_t) | Set the current usage of the GeoMemoryStream. |
ShrinkBuffer() | Crop the buffer to the current cursor position. |
Write(const T(&)) | Write a fixed size array. |
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. |
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. |
Enums
Name | Description |
---|---|
EStreamMode | An IGeoStream is open in either esmRead or esmWrite mode. |
virtual Geo::IGeoInputStream::~IGeoInputStream
public: virtual ~IGeoInputStream()
Deleting a stream should behave like a close operation.
virtual Geo::IGeoStream::~IGeoStream
public: virtual ~IGeoStream()
Deleting a stream should behave like a close operation.
virtual u32 Geo::IGeoStream::BeginType
public: virtual u32 BeginType
(
TypeId type,
u32 count
)
Provide information about the typed data written to the stream.
void Geo::GeoMemoryStream::Close
public: void Close()
free current memory, if any
virtual void Geo::IGeoStream::EndType
public: virtual void EndType
(
u32 index
)
Provide information about the typed data written to the stream.
const char* Geo::GeoMemoryStream::GetMemoryPtr
public: const char * GetMemoryPtr() const
Return the memory pointer.
char* Geo::GeoMemoryStream::GetMemoryPtr
public: char * GetMemoryPtr()
Return the memory pointer.
size_t Geo::GeoMemoryStream::GetMemorySize
public: size_t GetMemorySize() const
Returns the current allocation size of the GeoMemoryStream.
virtual u64 Geo::GeoMemoryStream::GetPosition
public: virtual u64 GetPosition() const
Return the position of the read/write pointer within the stream (prototype matches ftell)
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)
virtual u64 Geo::IGeoStream::GetPosition
public: u64 GetPosition() const
Return the position of the read/write pointer within the stream (prototype matches ftell)
size_t Geo::GeoMemoryStream::GetUsedMemorySize
public: size_t GetUsedMemorySize() const
Returns the current usage of the GeoMemoryStream.
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)
virtual bool Geo::IGeoStream::IsEof
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)
virtual bool Geo::GeoMemoryStream::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)
virtual bool Geo::IGeoInputStream::IsOk
public: bool IsOk() const
Tests if the stream is valid.
virtual bool Geo::GeoMemoryStream::IsOk
public: virtual bool IsOk() const
Tests if the stream is valid.
virtual bool Geo::IGeoStream::IsOk
public: bool IsOk() const
Tests if the stream is valid.
bool Geo::GeoMemoryStream::Open
public: bool Open
(
size_t startSize
)
free current memory, if any, and start new block
bool Geo::GeoMemoryStream::Open
public: bool Open
(
char * data,
size_t startSize
)
free current memory, if any, and open existing block
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>).
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.
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.
virtual size_t Geo::GeoMemoryStream::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::IGeoInputStream::Read
public: bool Read
(
T(&) a
)
Read a fixed size array.
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>).
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>).
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.
virtual bool Geo::GeoMemoryStream::SetPosition
public: virtual bool SetPosition
(
u64 pos
)
Set the position of the read/write pointer within the stream (prototype matches fseek)
virtual bool Geo::IGeoStream::SetPosition
public: bool SetPosition
(
u64 pos
)
Set the position of the read/write pointer within the stream (prototype matches fseek)
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)
void Geo::GeoMemoryStream::SetUsedMemorySize
public: void SetUsedMemorySize
(
size_t newSize
)
Set the current usage of the GeoMemoryStream.
If you want to create a buffer of a known size and use other methids to fill it, call Open(x) with the requested size 'x', fill with data and then if successful call SetUsedMemorySize(x) to tell the GeoMemoryStream that this memory has been written to.
bool Geo::GeoMemoryStream::ShrinkBuffer
public: bool ShrinkBuffer()
Crop the buffer to the current cursor position.
bool Geo::IGeoStream::Write
public: bool Write
(
const T(&) a
)
Write a fixed size array.
virtual size_t Geo::IGeoStream::Write
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.
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::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>).
virtual size_t Geo::GeoMemoryStream::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.
EStreamMode
public: enum EStreamMode
{
esmWrite,
esmRead
}
An IGeoStream is open in either esmRead or esmWrite mode.
enumerators
esmWrite | |
esmRead |