Minecraft Community Edition 0.1.0
Loading...
Searching...
No Matches
mce::FileInputStream Class Referencefinal
Inheritance diagram for mce::FileInputStream:
mce::InputStream

Public Member Functions

bool open (const std::string &file)
 Constructs the stream and opens a file.
bool isOpen () const
void close ()
 Closes the file.
size_t read (void *buffer, size_t size) override
 Reads from the input stream.
size_t seek (size_t position) override
 Changes the current position the stream is reading.
size_t tell () override
size_t getSize () override

Static Public Attributes

static constexpr size_t FILE_NOT_FOUND = 0
static constexpr size_t INVALID_FILE_SIZE = ~(0)
static constexpr size_t INVALID_FILE_POSITION = ~(0)

Member Function Documentation

◆ getSize()

size_t mce::FileInputStream::getSize ( )
overridevirtual
Returns
The size of the stream in bytes

Implements mce::InputStream.

◆ isOpen()

bool mce::FileInputStream::isOpen ( ) const
Returns
True if the file was successfully opened

◆ open()

bool mce::FileInputStream::open ( const std::string & file)

Constructs the stream and opens a file.

Parameters
fileThe path (absolute or relative) to the file

Opens a file to read from

Parameters
fileThe path (absolute or relative) to the file

◆ read()

size_t mce::FileInputStream::read ( void * buffer,
size_t size )
overridevirtual

Reads from the input stream.

Parameters
bufferThe buffer to read the bytes into
sizeThe amount of bytes to read
Returns
The amount of bytes written

Implements mce::InputStream.

◆ seek()

size_t mce::FileInputStream::seek ( size_t position)
overridevirtual

Changes the current position the stream is reading.

Parameters
positionThe position to seek the input stream to
Returns
The position the input stream is at now

Implements mce::InputStream.

◆ tell()

size_t mce::FileInputStream::tell ( )
overridevirtual
Returns
The current position the stream is at

Implements mce::InputStream.


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