FIFE  be64c707dea6b3250bd4355bf5c825d25920087d
FIFE::DAT1 Class Reference

VFSource for the Fallout1 DAT file format. More...

#include <dat1.h>

+ Inheritance diagram for FIFE::DAT1:
+ Collaboration diagram for FIFE::DAT1:

Public Member Functions

 DAT1 (VFS *vfs, const std::string &file)
 Constructor Create a VFSSource for a Fallout1 DAT file. More...
 
bool fileExists (const std::string &name) const
 check if the given file exists More...
 
RawDataopen (const std::string &file) const
 open a file inside this source More...
 
const RawDataDAT1::s_infogetInfo (const std::string &name) const
 Get the needed information to unpack and extract a file from the DAT file. More...
 
std::set< std::string > listFiles (const std::string &pathstr) const
 list all files in a directory of this source More...
 
std::set< std::string > listDirectories (const std::string &pathstr) const
 list all directories in a directory of this source More...
 
- Public Member Functions inherited from FIFE::VFSSource
 VFSSource (VFS *vfs)
 
virtual ~VFSSource ()
 
VFSgetVFS () const
 get the VFS this source is associated with. More...
 

Private Types

typedef std::map< std::string, RawDataDAT1::s_infotype_filelist
 

Private Member Functions

std::set< std::string > list (const std::string &pathstr, bool dirs) const
 
std::string readString ()
 
void loadFileList (const std::string &dirname)
 
 DAT1 (const DAT1 &)
 
DAT1operator= (const DAT1 &)
 

Private Attributes

std::string m_datpath
 
std::unique_ptr< RawDatam_data
 
type_filelist m_filelist
 

Additional Inherited Members

- Protected Member Functions inherited from FIFE::VFSSource
std::string fixPath (std::string path) const
 

Detailed Description

VFSource for the Fallout1 DAT file format.

Definition at line 44 of file dat1.h.

Member Typedef Documentation

◆ type_filelist

typedef std::map<std::string, RawDataDAT1::s_info> FIFE::DAT1::type_filelist
private

Definition at line 73 of file dat1.h.

Constructor & Destructor Documentation

◆ DAT1() [1/2]

FIFE::DAT1::DAT1 ( VFS vfs,
const std::string &  file 
)

Constructor Create a VFSSource for a Fallout1 DAT file.

Parameters
vfsA pointer to the VFS.
fileA Fallout1 DAT file - e.g. master.DAT

Definition at line 39 of file dat1.cpp.

References FIFE::_log, FL_LOG, loadFileList(), m_data, and readString().

◆ DAT1() [2/2]

FIFE::DAT1::DAT1 ( const DAT1 )
private

Member Function Documentation

◆ fileExists()

bool FIFE::DAT1::fileExists ( const std::string &  file) const
virtual

check if the given file exists

Parameters
filefilename to check
Returns
true if it exists, false otherwise

Implements FIFE::VFSSource.

Definition at line 95 of file dat1.cpp.

References m_filelist.

◆ getInfo()

const RawDataDAT1::s_info & FIFE::DAT1::getInfo ( const std::string &  name) const

Get the needed information to unpack and extract a file from the DAT file.

Retrieves the Information needed to extract a specific file, this is passed as argument to a mffalloutrawdatadat1 RawMemSource, which itself fills its memory content with the unpacked file.

Exceptions
NotFound
See also
MFFalloutRawDataDAT1, RawMemSource

Definition at line 99 of file dat1.cpp.

References m_filelist.

Referenced by open().

+ Here is the caller graph for this function:

◆ list()

std::set< std::string > FIFE::DAT1::list ( const std::string &  pathstr,
bool  dirs 
) const
private

Definition at line 115 of file dat1.cpp.

References m_filelist.

Referenced by listDirectories(), and listFiles().

+ Here is the caller graph for this function:

◆ listDirectories()

std::set< std::string > FIFE::DAT1::listDirectories ( const std::string &  path) const
virtual

list all directories in a directory of this source

Parameters
pathpath to list directories in Will return an empty list on any error

Implements FIFE::VFSSource.

Definition at line 111 of file dat1.cpp.

References list().

◆ listFiles()

std::set< std::string > FIFE::DAT1::listFiles ( const std::string &  path) const
virtual

list all files in a directory of this source

Parameters
pathpath to list files in Will return an empty list on any error

Implements FIFE::VFSSource.

Definition at line 107 of file dat1.cpp.

References list().

◆ loadFileList()

void FIFE::DAT1::loadFileList ( const std::string &  dirname)
private

◆ open()

RawData * FIFE::DAT1::open ( const std::string &  file) const
virtual

open a file inside this source

Parameters
filethe file to open
Returns
a new RawData*
Exceptions
CannotOpenFileif the file can't be found

Implements FIFE::VFSSource.

Definition at line 90 of file dat1.cpp.

References getInfo(), FIFE::VFSSource::getVFS(), and m_datpath.

◆ operator=()

DAT1& FIFE::DAT1::operator= ( const DAT1 )
private

◆ readString()

std::string FIFE::DAT1::readString ( )
private

Definition at line 85 of file dat1.cpp.

References m_data.

Referenced by DAT1(), and loadFileList().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_data

std::unique_ptr<RawData> FIFE::DAT1::m_data
private

Definition at line 72 of file dat1.h.

Referenced by DAT1(), loadFileList(), and readString().

◆ m_datpath

std::string FIFE::DAT1::m_datpath
private

Definition at line 71 of file dat1.h.

Referenced by open().

◆ m_filelist

type_filelist FIFE::DAT1::m_filelist
private

Definition at line 74 of file dat1.h.

Referenced by fileExists(), getInfo(), list(), and loadFileList().


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