stmm-games-doc  0.32.0
Public Member Functions | List of all members
stmg::File Class Reference

Public Member Functions

 File () noexcept
 Undefined File constructor. More...
 
 File (const std::string &sFullPath) noexcept
 Filesystem path File constructor. More...
 
 File (uint8_t *p0Buffer, int32_t nBufferSize) noexcept
 Memory buffer File constructor. More...
 
 File (const File &oSource) noexcept
 Copy constructor. More...
 
Fileoperator= (const File &oSource) noexcept
 Assignment operator. More...
 
bool isDefined () const noexcept
 Whether the file is defined. More...
 
bool isBuffered () const noexcept
 Whether the file is a memory buffer. More...
 
uint8_t const * getBuffer () const noexcept
 The buffer. More...
 
uint32_t getBufferSize () const noexcept
 The size of the buffer. More...
 
const std::string & getFullPath () const noexcept
 The file path. More...
 

Constructor & Destructor Documentation

◆ File() [1/4]

stmg::File::File ( )
noexcept

Undefined File constructor.

◆ File() [2/4]

stmg::File::File ( const std::string &  sFullPath)
explicitnoexcept

Filesystem path File constructor.

Parameters
sFullPathThe full path to a file. Cannot be empty.

◆ File() [3/4]

stmg::File::File ( uint8_t *  p0Buffer,
int32_t  nBufferSize 
)
noexcept

Memory buffer File constructor.

The file doesn't manage the pointed to memory.

Parameters
p0BufferThe buffer start. Cannot be null.
nBufferSizeThe buffer size. Cannot be negative.

◆ File() [4/4]

stmg::File::File ( const File oSource)
noexcept

Copy constructor.

Parameters
oSourceThe source.

Member Function Documentation

◆ getBuffer()

uint8_t const* stmg::File::getBuffer ( ) const
noexcept

The buffer.

Returns
The buffer start or null if undefined or file path.

◆ getBufferSize()

uint32_t stmg::File::getBufferSize ( ) const
noexcept

The size of the buffer.

Returns
The buffer size or 0 if undefined or file path.

◆ getFullPath()

const std::string& stmg::File::getFullPath ( ) const
noexcept

The file path.

Returns
The path or empty string if undefined or buffer.

◆ isBuffered()

bool stmg::File::isBuffered ( ) const
noexcept

Whether the file is a memory buffer.

Returns
Whether a buffer.

◆ isDefined()

bool stmg::File::isDefined ( ) const
noexcept

Whether the file is defined.

Returns
Whether path or buffer.

◆ operator=()

File& stmg::File::operator= ( const File oSource)
noexcept

Assignment operator.

Parameters
oSourceThe source.
Returns
This instance.