FIFE  2008.0
 All Classes Namespaces Functions Variables Enumerations Enumerator
FIFE::DAT2 Class Reference

#include <dat2.h>

Inheritance diagram for FIFE::DAT2:
Collaboration diagram for FIFE::DAT2:

List of all members.

Public Member Functions

 DAT2 (VFS *vfs, const std::string &path)
bool fileExists (const std::string &name) const
RawDataopen (const std::string &file) const
const RawDataDAT2::s_infogetInfo (const std::string &name) const
std::set< std::string > listFiles (const std::string &pathstr) const
std::set< std::string > listDirectories (const std::string &pathstr) const

Detailed Description

VFSource for the Fallout2 DAT file format

Implements a kind of lazy initializing, by reading the file list in chunks. Behaviour is the same as if it wouldn't do this, but startup is very fast. But a open/fileExists call with a filename that doesn't exist, does trigger completely loading the file entries.

See also:
MFFalloutDAT1
Todo:
maybe merge common DAT1/DAT2 code in a common base class

Definition at line 59 of file dat2.h.


Constructor & Destructor Documentation

FIFE::DAT2::DAT2 ( VFS vfs,
const std::string &  path 
)

Constructor Create a VFSSource for a Fallout2 DAT file.

Parameters:
fileA Fallout2 DAT file - e.g. master.DAT

Definition at line 40 of file dat2.cpp.


Member Function Documentation

bool FIFE::DAT2::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 112 of file dat2.cpp.

const RawDataDAT2::s_info & FIFE::DAT2::getInfo ( const std::string &  name) const

Get Information needed to unpack and extract data

See also:
MFFalloutDAT1::getInfo

Definition at line 116 of file dat2.cpp.

Referenced by open().

Here is the caller graph for this function:

std::set< std::string > FIFE::DAT2::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 158 of file dat2.cpp.

std::set< std::string > FIFE::DAT2::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 154 of file dat2.cpp.

RawData * FIFE::DAT2::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 107 of file dat2.cpp.

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


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