70 return Read(destination,
sizeof(T), elementCount) /
sizeof(T);
157 void Init()
override;
T * Data()
Definition Array.hpp:131
void Resize(uint16 size)
Definition Array.hpp:79
Definition Stream.hpp:146
uint32 Write(void *source, uint16 elementSize, uint32 elementCount) override
Write data to the stream.
Definition Stream.cpp:50
uint32 Tell() override
Get the current position of the stream.
Definition Stream.cpp:63
void Destroy() override
Run the destruction logic of this class. This also frees its memory.
Definition Stream.cpp:89
void Seek(EStreamSeekOrigin origin, int32 offset) override
Move the position relative to the specified origin.
Definition Stream.cpp:68
void Init() override
Run the initialization logic of this object. Should be overriden by deriving classes.
Definition Stream.cpp:83
uint32 Size() override
Get the byte-size of this stream.
Definition Stream.cpp:58
Interface that reads and writes data to and from a stream.
Definition Stream.hpp:21
virtual uint32 Write(void *source, uint16 elementSize, uint32 elementCount)=0
Write data to the stream.
virtual uint32 Tell()=0
Get the current position of the stream.
void Destroy() override
Run the destruction logic of this class. This also frees its memory.
Definition Stream.cpp:26
DataStreamCopy * OpenCopy()
Definition Stream.cpp:19
void AddCopy(DataStream *otherStream)
Definition Stream.cpp:31
uint32 Read(T *destination, uint32 elementCount)
Read data from the stream.
Definition Stream.hpp:68
void Close()
Close the stream. This also releases it from memory.
Definition Stream.cpp:13
Array< T > ReadToArray()
Read the data to an array of elements.
Definition Stream.hpp:92
virtual uint32 Size()=0
Get the byte-size of this stream.
virtual uint32 Read(void *destination, uint16 elementSize, uint32 elementCount)=0
Read data from the stream.
T Read()
Read en element from the stream.
Definition Stream.hpp:79
virtual void Seek(EStreamSeekOrigin origin, int32 offset)=0
Move the position relative to the specified origin.
String ReadToString()
Read the data to a stream.
Definition Stream.cpp:7
void RemoveCopy(DataStream *otherStream)
Definition Stream.cpp:36
uint32 copies
Definition Stream.hpp:138
uint32 Write(T *source, uint32 elementCount)
Write data to the stream.
Definition Stream.hpp:115
void Write(T value)
Write an element to the stream.
Definition Stream.hpp:126
Base class for dynamically allocated objects.
Definition Object.hpp:7
int32_t int32
Definition Primitives.hpp:13
uint16_t uint16
Definition Primitives.hpp:9
uint32_t uint32
Definition Primitives.hpp:12
EStreamSeekOrigin
Origin point of a seek operation.
Definition Stream.hpp:13
@ SSO_Start
Seek relative to the beginning of a stream.
Definition Stream.hpp:14
@ SSO_End
Seek relative to the end of a stream.
Definition Stream.hpp:15
@ SSO_Current
Seek relative to the current position.
Definition Stream.hpp:16