DirFile Class Reference

#include <DirFile.h>

Inheritance diagram for DirFile:

NamedArchiveFile ArchiveFile List of all members.

Public Member Functions

 ENABLE_RUNTIME_CLASSTYPE ()
 DirFile (const std::string &path)
virtual ~DirFile ()
virtual bool exists (const std::string &name)
virtual uint8getObject (const std::string &name, uint32 *size=0)
virtual uint32 getSize (const std::string &name)
virtual uint32 getCount ()

Protected Member Functions

bool readMetadata ()

Protected Attributes

std::string path
uint32 count

Detailed Description

Definition at line 24 of file DirFile.h.


Constructor & Destructor Documentation

DirFile::DirFile ( const std::string &  path  )  [explicit]

create DirFile from path

Definition at line 27 of file DirFile.cpp.

References path, readMetadata(), and ArchiveFile::valid.

DirFile::~DirFile (  )  [virtual]

Definition at line 41 of file DirFile.cpp.


Member Function Documentation

DirFile::ENABLE_RUNTIME_CLASSTYPE (  ) 

Reimplemented from NamedArchiveFile.

bool DirFile::exists ( const std::string &  name  )  [virtual]

Check if named object exists If the Flex is not named, name must be an integer with an optional extension

Parameters:
name name of object to check for

Implements NamedArchiveFile.

Definition at line 72 of file DirFile.cpp.

References FileSystem::get_instance(), path, and FileSystem::ReadFile().

virtual uint32 DirFile::getCount (  )  [inline, virtual]

Get upper bound for number of objects. In an indexed file this is (probably) the highest index plus one, while in a named file it's (probably) the actual count

Implements NamedArchiveFile.

Definition at line 38 of file DirFile.h.

References count.

uint8 * DirFile::getObject ( const std::string &  name,
uint32 size = 0 
) [virtual]

Get named object from file; returns NULL if name is invalid. Must delete the returned buffer afterwards. See also exists(std::string name)

Parameters:
name name of object to fetch
size if non-NULL, size of object is stored in *size

Implements NamedArchiveFile.

Definition at line 93 of file DirFile.cpp.

References FileSystem::get_instance(), IDataSource::getSize(), path, IDataSource::read(), and FileSystem::ReadFile().

uint32 DirFile::getSize ( const std::string &  name  )  [virtual]

Get size of named object; returns zero if name is invalid See also exists(std::string name)

Parameters:
index index of object to get size of

Implements NamedArchiveFile.

Definition at line 82 of file DirFile.cpp.

References FileSystem::get_instance(), IDataSource::getSize(), path, and FileSystem::ReadFile().

bool DirFile::readMetadata (  )  [protected]

Definition at line 46 of file DirFile.cpp.

References count, FileSystem::get_instance(), FileSystem::ListFiles(), path, pout, and NamedArchiveFile::storeIndexedName().

Referenced by DirFile().


Member Data Documentation

uint32 DirFile::count [protected]

Definition at line 44 of file DirFile.h.

Referenced by getCount(), and readMetadata().

std::string DirFile::path [protected]

Definition at line 43 of file DirFile.h.

Referenced by DirFile(), exists(), getObject(), getSize(), and readMetadata().


The documentation for this class was generated from the following files:
Generated on Fri Jul 27 22:29:08 2007 for pentagram by  doxygen 1.4.7