FIFE  6e1afdbeda11afe9ac53e6023a4be96ef88f1dc6
FIFE::RawDataFile Class Reference

A RawDataSource for a file on the host system. More...

#include <rawdatafile.h>

+ Inheritance diagram for FIFE::RawDataFile:
+ Collaboration diagram for FIFE::RawDataFile:

Public Member Functions

 RawDataFile (const std::string &file)
 Constructor Constructs a RawDataSource for file. More...
 
virtual ~RawDataFile ()
 
virtual uint32_t getSize () const
 get the complete datasize More...
 
virtual void readInto (uint8_t *buffer, uint32_t start, uint32_t length)
 read data from the source More...
 
- Public Member Functions inherited from FIFE::RawDataSource
 RawDataSource ()
 
virtual ~RawDataSource ()
 

Private Attributes

std::string m_file
 
std::ifstream m_stream
 
uint32_t m_filesize
 

Detailed Description

A RawDataSource for a file on the host system.

See also
VFSHostSystem
RawDataSource

Definition at line 43 of file rawdatafile.h.

Constructor & Destructor Documentation

FIFE::RawDataFile::RawDataFile ( const std::string &  file)

Constructor Constructs a RawDataSource for file.

Parameters
fileThe path to the file to load.
Exceptions
CannotOpenFile

Definition at line 36 of file rawdatafile.cpp.

References m_file, m_filesize, and m_stream.

FIFE::RawDataFile::~RawDataFile ( )
virtual

Definition at line 46 of file rawdatafile.cpp.

Member Function Documentation

uint32_t FIFE::RawDataFile::getSize ( ) const
virtual

get the complete datasize

Implements FIFE::RawDataSource.

Definition at line 50 of file rawdatafile.cpp.

References m_filesize.

void FIFE::RawDataFile::readInto ( uint8_t *  buffer,
uint32_t  start,
uint32_t  length 
)
virtual

read data from the source

Parameters
bufferthe data will be written into buffer
startthe startindex inside the source
lengthlength bytes will be written into buffer

Implements FIFE::RawDataSource.

Definition at line 54 of file rawdatafile.cpp.

References m_stream.

Member Data Documentation

std::string FIFE::RawDataFile::m_file
private

Definition at line 58 of file rawdatafile.h.

Referenced by RawDataFile().

uint32_t FIFE::RawDataFile::m_filesize
private

Definition at line 61 of file rawdatafile.h.

Referenced by getSize(), and RawDataFile().

std::ifstream FIFE::RawDataFile::m_stream
private

Definition at line 59 of file rawdatafile.h.

Referenced by RawDataFile(), and readInto().


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