Faro Engine 0.0.0.b519570 (main)
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Faro::FileStream Class Referenceabstract

#include <FileStream.hpp>

Inheritance diagram for Faro::FileStream:
Faro::DataStream Faro::IObject

Public Member Functions

virtual bool IsOpen ()=0
 Check if the file stream was successfully opened.
 
virtual uint32 Read (void *destination, uint16 elementSize, uint32 elementCount)=0
 Read data from the stream.
 
template<typename T >
uint32 Read (T *destination, uint32 elementCount)
 Read data from the stream.
 
template<typename T >
Read ()
 Read en element from the stream.
 
virtual uint32 Write (void *source, uint16 elementSize, uint32 elementCount)=0
 Write data to the stream.
 
template<typename T >
uint32 Write (T *source, uint32 elementCount)
 Write data to the stream.
 
template<typename T >
void Write (T value)
 Write an element to the stream.
 
virtual uint32 Size ()=0
 Get the byte-size of this stream.
 
virtual uint32 Tell ()=0
 Get the current position of the stream.
 
virtual void Seek (EStreamSeekOrigin origin, int32 offset)=0
 Move the position relative to the specified origin.
 
template<typename T >
Array< TReadToArray ()
 Read the data to an array of elements.
 
String ReadToString ()
 Read the data to a stream.
 
void Close ()
 Close the stream. This also releases it from memory.
 
DataStreamCopyOpenCopy ()
 
virtual void Init ()
 Run the initialization logic of this object. Should be overriden by deriving classes.
 

Protected Member Functions

void Destroy () override
 Run the destruction logic of this class. This also frees its memory.
 
void AddCopy (DataStream *otherStream)
 
void RemoveCopy (DataStream *otherStream)
 

Protected Attributes

uint32 copies = 0
 

Member Function Documentation

◆ AddCopy()

void Faro::DataStream::AddCopy ( DataStream otherStream)
protectedinherited

◆ Close()

void Faro::DataStream::Close ( )
inherited

Close the stream. This also releases it from memory.

◆ Destroy()

void Faro::DataStream::Destroy ( )
overrideprotectedvirtualinherited

Run the destruction logic of this class. This also frees its memory.

Warning
When overriding, the super call must be performed last

Reimplemented from Faro::IObject.

Reimplemented in Faro::DataStreamCopy.

◆ Init()

void Faro::IObject::Init ( )
virtualinherited

◆ IsOpen()

virtual bool Faro::FileStream::IsOpen ( )
pure virtual

Check if the file stream was successfully opened.

Returns
true The stream is open
false The stream is not open

◆ OpenCopy()

DataStreamCopy * Faro::DataStream::OpenCopy ( )
inherited

◆ Read() [1/3]

template<typename T >
T Faro::DataStream::Read ( )
inlineinherited

Read en element from the stream.

Template Parameters
TElement type to read
Returns
T Element that was read

◆ Read() [2/3]

template<typename T >
uint32 Faro::DataStream::Read ( T *  destination,
uint32  elementCount 
)
inlineinherited

Read data from the stream.

Template Parameters
TElement type to read
Parameters
destinationDestination memory. This must be a valid pointer.
elementCountAmount of elements to read
Returns
uint32 Amount of elements read

◆ Read() [3/3]

virtual uint32 Faro::DataStream::Read ( void *  destination,
uint16  elementSize,
uint32  elementCount 
)
pure virtualinherited

Read data from the stream.

Parameters
destinationDestination memory. This must be a valid pointer.
elementSizeSize of a single element
elementCountAmount of elements to read
Returns
uint32 Amount of bytes read

Implemented in Faro::DataStreamCopy.

◆ ReadToArray()

template<typename T >
Array< T > Faro::DataStream::ReadToArray ( )
inlineinherited

Read the data to an array of elements.

Template Parameters
TElement type to read
Returns
Array<T> Array of elements read from the stream

◆ ReadToString()

String Faro::DataStream::ReadToString ( )
inherited

Read the data to a stream.

Returns
String String read from the stream

◆ RemoveCopy()

void Faro::DataStream::RemoveCopy ( DataStream otherStream)
protectedinherited

◆ Seek()

virtual void Faro::DataStream::Seek ( EStreamSeekOrigin  origin,
int32  offset 
)
pure virtualinherited

Move the position relative to the specified origin.

Parameters
originStart point of the seeking operation
offsetAmount of bytes to seek relative to the origin

Implemented in Faro::DataStreamCopy.

◆ Size()

virtual uint32 Faro::DataStream::Size ( )
pure virtualinherited

Get the byte-size of this stream.

Returns
uint32 Amount of bytes in this stream

Implemented in Faro::DataStreamCopy.

◆ Tell()

virtual uint32 Faro::DataStream::Tell ( )
pure virtualinherited

Get the current position of the stream.

Returns
uint32 Current position

Implemented in Faro::DataStreamCopy.

◆ Write() [1/3]

template<typename T >
uint32 Faro::DataStream::Write ( T source,
uint32  elementCount 
)
inlineinherited

Write data to the stream.

Template Parameters
TElement type to write
Parameters
sourceSource memory
elementCountAmount of elements to write
Returns
uint32 Amount of elements written

◆ Write() [2/3]

template<typename T >
void Faro::DataStream::Write ( T  value)
inlineinherited

Write an element to the stream.

Template Parameters
TElement type to write
Parameters
valueElement to write

◆ Write() [3/3]

virtual uint32 Faro::DataStream::Write ( void source,
uint16  elementSize,
uint32  elementCount 
)
pure virtualinherited

Write data to the stream.

Parameters
sourceSource memory
elementSizeSize of a single element
elementCountAmount of elements to write
Returns
uint32 Amount of bytes written

Implemented in Faro::DataStreamCopy.

Member Data Documentation

◆ copies

uint32 Faro::DataStream::copies = 0
protectedinherited

The documentation for this class was generated from the following file: