Archive Class Reference
[Core]
Simple system for accessing archive content.
More...
Classes | |
| struct | DirectoryEntry |
| struct | FileEntry |
Public Member Functions | |
| Archive (const void *memoryBuffer, int size) | |
| Archive (const Filename &filename) | |
| ~Archive () | |
| ArchiveFile * | GetFile (const Filename &filename) const |
| const ArchiveDirectory * | GetDirectory (const Filename &path) const |
| const ArchiveDirectory * | GetRootDirectory () const |
Detailed Description
Simple system for accessing archive content.An Archive is what you get when packing lots of files together into one big file. Check out ArchiveGenerator for a utility class for generating archives.
This archive class can be passed to the static method Asset::SetArchive, to direct all Asset requests to the specified archive.
Definition at line 33 of file Archive.h.
Constructor & Destructor Documentation
| Archive::Archive | ( | const void * | memoryBuffer, | |
| int | size | |||
| ) |
Creates a new archive from the specified memory area with the specified size. It doesn't make a copy of the data passed in, so make sure to keep the data around until you destroy the archive.
- Parameters:
-
memoryBuffer Pointer to archive data size Size of archive data
Definition at line 20 of file Archive.cpp.
| Archive::Archive | ( | const Filename & | filename | ) |
Creates a new archive from the specified file. It doesn't load the entire archive into memory, but it opens the file and keeps it open until the archive is destroyed. Data is only loaded as it is read trough Assets.
- Parameters:
-
filename Full path to archive file
Definition at line 57 of file Archive.cpp.
| Archive::~Archive | ( | ) |
Destructor
Definition at line 114 of file Archive.cpp.
Member Function Documentation
| ArchiveFile * Archive::GetFile | ( | const Filename & | filename | ) | const |
This method is used to get the data of the file with the specified name from the archive
- Returns:
- A pointer to a StaticBuffer containing the file data of the requested file. If the file doesn't exist, GetFile will assert and return 0
- Parameters:
-
filename The name of the file to get
Definition at line 170 of file Archive.cpp.
| const ArchiveDirectory * Archive::GetDirectory | ( | const Filename & | path | ) | const |
Definition at line 154 of file Archive.cpp.
| const ArchiveDirectory * Archive::GetRootDirectory | ( | ) | const |
Definition at line 142 of file Archive.cpp.
Reproduction/republishing of any material on this site without permission is strictly prohibited.
