FIFE::DAT2 Class Reference

#include <dat2.h>

Inheritance diagram for FIFE::DAT2:
Inheritance graph
[legend]
Collaboration diagram for FIFE::DAT2:
Collaboration graph
[legend]

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:
file A Fallout2 DAT file - e.g. master.DAT

Definition at line 39 of file dat2.cpp.


Member Function Documentation

bool FIFE::DAT2::fileExists ( const std::string &  file  )  const [virtual]

check if the given file exists

Parameters:
file filename to check
Returns:
true if it exists, false otherwise

Implements FIFE::VFSSource.

Definition at line 111 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 115 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:
path path to list directories in Will return an empty list on any error

Implements FIFE::VFSSource.

Definition at line 157 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:
path path to list files in Will return an empty list on any error

Implements FIFE::VFSSource.

Definition at line 153 of file dat2.cpp.

RawData * FIFE::DAT2::open ( const std::string &  file  )  const [virtual]

open a file inside this source

Parameters:
file the file to open
Returns:
a new RawData*
Exceptions:
CannotOpenFile if the file can't be found

Implements FIFE::VFSSource.

Definition at line 106 of file dat2.cpp.

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


The documentation for this class was generated from the following files:
Generated on Wed Nov 23 13:05:08 2011 for FIFE by  doxygen 1.6.3