#include <DirFile.h>
Inheritance diagram for DirFile:
Public Member Functions | |
ENABLE_RUNTIME_CLASSTYPE () | |
DirFile (const std::string &path) | |
virtual | ~DirFile () |
virtual bool | exists (const std::string &name) |
virtual uint8 * | getObject (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 |
Definition at line 24 of file DirFile.h.
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.
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
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.
Get named object from file; returns NULL if name is invalid. Must delete the returned buffer afterwards. See also exists(std::string name)
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)
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().
uint32 DirFile::count [protected] |
std::string DirFile::path [protected] |
Definition at line 43 of file DirFile.h.
Referenced by DirFile(), exists(), getObject(), getSize(), and readMetadata().