#include <NamedArchiveFile.h>
Inheritance diagram for NamedArchiveFile:
Public Member Functions | |
ENABLE_RUNTIME_CLASSTYPE () | |
NamedArchiveFile () | |
virtual | ~NamedArchiveFile () |
virtual bool | exists (uint32 index) |
virtual bool | exists (const std::string &name)=0 |
virtual uint8 * | getObject (uint32 index, uint32 *size=0) |
virtual uint8 * | getObject (const std::string &name, uint32 *size=0)=0 |
virtual uint32 | getSize (uint32 index) |
virtual uint32 | getSize (const std::string &name)=0 |
virtual uint32 | getCount ()=0 |
virtual uint32 | getIndexCount () |
virtual bool | isIndexed () const |
virtual bool | isNamed () const |
Protected Member Functions | |
bool | indexToName (uint32 index, std::string &name) |
void | storeIndexedName (const std::string &name) |
Protected Attributes | |
std::map< uint32, std::string > | indexedNames |
uint32 | indexCount |
Definition at line 24 of file NamedArchiveFile.h.
NamedArchiveFile::NamedArchiveFile | ( | ) | [inline] |
Definition at line 28 of file NamedArchiveFile.h.
virtual NamedArchiveFile::~NamedArchiveFile | ( | ) | [inline, virtual] |
Definition at line 29 of file NamedArchiveFile.h.
NamedArchiveFile::ENABLE_RUNTIME_CLASSTYPE | ( | ) |
virtual bool NamedArchiveFile::exists | ( | const std::string & | name | ) | [pure 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 ArchiveFile.
Implemented in DirFile, U8SaveFile, and ZipFile.
virtual bool NamedArchiveFile::exists | ( | uint32 | index | ) | [inline, virtual] |
Check if numbered object exists If the Flex has named objects, only objects with numerical names will be returned (the filename without the extension must be an integer)
index | index of object to check for |
Implements ArchiveFile.
Definition at line 31 of file NamedArchiveFile.h.
References indexToName().
virtual uint32 NamedArchiveFile::getCount | ( | ) | [pure 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 ArchiveFile.
Implemented in DirFile, U8SaveFile, and ZipFile.
virtual uint32 NamedArchiveFile::getIndexCount | ( | ) | [inline, virtual] |
Get the highest index in the file Guaranteed to be sufficiently large for a vector that needs to store the indexed entries of this file
Implements ArchiveFile.
Definition at line 53 of file NamedArchiveFile.h.
References indexCount.
virtual uint8* NamedArchiveFile::getObject | ( | const std::string & | name, | |
uint32 * | size = 0 | |||
) | [pure virtual] |
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 ArchiveFile.
Implemented in DirFile, U8SaveFile, and ZipFile.
Get object from file; returns NULL if index is invalid. Must delete the returned buffer afterwards. See also exists(uint32 index)
index | index of object to fetch | |
size | if non-NULL, size of object is stored in *size |
Implements ArchiveFile.
Definition at line 37 of file NamedArchiveFile.h.
References indexToName().
virtual uint32 NamedArchiveFile::getSize | ( | const std::string & | name | ) | [pure 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 ArchiveFile.
Implemented in DirFile, U8SaveFile, and ZipFile.
Get size of object; returns zero if index is invalid. See also exists(uint32 index)
index | index of object to get size of |
Implements ArchiveFile.
Definition at line 44 of file NamedArchiveFile.h.
References indexToName().
bool NamedArchiveFile::indexToName | ( | uint32 | index, | |
std::string & | name | |||
) | [inline, protected] |
Definition at line 59 of file NamedArchiveFile.h.
References indexedNames.
Referenced by exists(), getObject(), and getSize().
virtual bool NamedArchiveFile::isIndexed | ( | ) | const [inline, virtual] |
virtual bool NamedArchiveFile::isNamed | ( | ) | const [inline, virtual] |
void NamedArchiveFile::storeIndexedName | ( | const std::string & | name | ) | [inline, protected] |
Definition at line 67 of file NamedArchiveFile.h.
References ArchiveFile::extractIndexFromName(), indexCount, and indexedNames.
Referenced by ZipFile::readMetadata(), U8SaveFile::readMetadata(), and DirFile::readMetadata().
uint32 NamedArchiveFile::indexCount [protected] |
Definition at line 77 of file NamedArchiveFile.h.
Referenced by getIndexCount(), and storeIndexedName().
std::map<uint32, std::string> NamedArchiveFile::indexedNames [protected] |
Definition at line 76 of file NamedArchiveFile.h.
Referenced by indexToName(), and storeIndexedName().