Nirtcpp 2.1.0
Nirtcpp is a high-performance c++ graphics engine.
Loading...
Searching...
No Matches
nirt::io::IReadFile Class Referenceabstract

Interface providing read access to a file. More...

#include <nirtcpp/core/engine/IReadFile.hpp>

Inheritance diagram for nirt::io::IReadFile:
Inheritance graph
Collaboration diagram for nirt::io::IReadFile:
Collaboration graph

Public Member Functions

virtual size_t read (void *buffer, size_t sizeToRead)=0
 Reads an amount of bytes from the file.
 
virtual bool seek (long finalPos, bool relativeMovement=false)=0
 Changes position in file.
 
virtual long getSize () const =0
 Get size of file.
 
virtual long getPos () const =0
 Get the current position in the file.
 
virtual const io::pathgetFileName () const =0
 Get name of file.
 
virtual EREAD_FILE_TYPE getType () const
 Get the type of the class implementing this interface.
 
- Public Member Functions inherited from nirt::IReferenceCounted
 IReferenceCounted ()
 Constructor.
 
virtual ~IReferenceCounted ()
 Destructor.
 
void grab () const
 Grabs the object. Increments the reference counter by one.
 
bool drop () const
 Drops the object. Decrements the reference counter by one.
 
s32 getReferenceCount () const
 Get the reference count.
 
const c8getDebugName () const
 Returns the debug name of the object.
 

Additional Inherited Members

- Protected Member Functions inherited from nirt::IReferenceCounted
void setDebugName (const c8 *newName)
 Sets the debug name of the object.
 

Detailed Description

Interface providing read access to a file.

Member Function Documentation

◆ getFileName()

virtual const io::path & nirt::io::IReadFile::getFileName ( ) const
pure virtual

Get name of file.

Returns
File name as zero terminated character string.

◆ getPos()

virtual long nirt::io::IReadFile::getPos ( ) const
pure virtual

Get the current position in the file.

Returns
Current position in the file in bytes on success or -1L on failure.

◆ getSize()

virtual long nirt::io::IReadFile::getSize ( ) const
pure virtual

Get size of file.

Returns
Size of the file in bytes.

◆ read()

virtual size_t nirt::io::IReadFile::read ( void *  buffer,
size_t  sizeToRead 
)
pure virtual

Reads an amount of bytes from the file.

Parameters
bufferPointer to buffer where read bytes are written to.
sizeToReadAmount of bytes to read from the file.
Returns
How many bytes were read.

◆ seek()

virtual bool nirt::io::IReadFile::seek ( long  finalPos,
bool  relativeMovement = false 
)
pure virtual

Changes position in file.

Parameters
finalPosDestination position in the file.
relativeMovementIf set to true, the position in the file is changed relative to current position. Otherwise the position is changed from beginning of file.
Returns
True if successful, otherwise false.

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

Nirtcpp    @cppfx.xyz

Utxcpp    utx::print