#include <ArchiveReaderAPI.h>
Inherited by Archive::ArchiveReader.
Interface for the ArchiveReader of O3DE Archive format An ArchiveReaderSettings object can be used to customize how an archive is read. Such as the ability to specify the number of read and decompression task that can run in parallel The user can supply their own stream of archive data via the AZ::IO::GenericStream interface In that case the archive needs to be opened with at least OpenMode::Read The recommend OpenMode value for opening the archive are as follows constexpr OpenMode mode = OpenMode::Read | OpenMode::Binary
◆ ListFileCallback
Callback structure which is invoked with the metadata for each file in the archive table of contents section This can be used to perform filtering on files within the archive
- Returns
- a value of
true
can be returned to continue enumeration of the archive
◆ ContainsFile()
virtual bool Archive::IArchiveReader::ContainsFile |
( |
AZ::IO::PathView |
relativePath | ) |
const |
|
pure virtual |
Returns if the archive contains a relative path
- Parameters
-
relativePath | Relative path within archive to search for |
- Returns
- true if the relative path is contained with the Archive equivalent to
return FindFile(relativePath) != InvalidArchiveFileToken;
Implemented in Archive::ArchiveReader.
◆ DumpArchiveMetadata()
virtual bool Archive::IArchiveReader::DumpArchiveMetadata |
( |
AZ::IO::GenericStream & |
metadataStream, |
|
|
const ArchiveMetadataSettings & |
metadataSettings = {} |
|
) |
| const |
|
pure virtual |
Dump metadata for the archive to the supplied generic stream
- Parameters
-
metadataStream | with human readable data about files within the archive will be written to the stream |
metadataStream | archive file metadata will be written to the stream |
metadataSettings | settings using which control the file metadata to write to the stream |
Implemented in Archive::ArchiveReader.
◆ EnumerateFilesInArchive()
Enumerates all files within the archive table of contents and invokes a callback function with the listing information about the file This function can be used to build filter files in the Archive based on any value supplied in the ArchiveListFileResult structure For example filtering can be done based on file path(such as globbing for all *.txt files) or filtering based on uncompressed size(such as locating all files > 2MiB, etc...)
- Parameters
-
listFileCallback | Callback which is invoked for each file in the archive |
- Returns
- result structure that is convertible to a boolean value indicating if enumeration was successful
Implemented in Archive::ArchiveReader.
◆ ExtractFileFromArchive()
Reads the content of the file specified in the ArchiveReadeFileSettings The file path identifier in the settings is used to locate the file to extract from the archive The outputSpan should be a pre-allocated buffer that is large enough to fit either the uncompressed size of the file if the m_decompressFile
setting is true or the compressed size of the file if the m_decompressFile
setting is false
- Parameters
-
outputSpan | pre-allocated buffer that should be large enough to store the extracted file |
fileSettings | settings which can configure whether the file should be decompressed, the start offset where to start reading content within the file, how many bytes to read from the file, etc... |
- Returns
- ArchiveExtractFileResult structure which on success contains a span of the actual data extracted from the Archive. NOTE: The extracted data can be smaller than the outputSpan.size() On failure, the result outcome member contains the error that occurred
Implemented in Archive::ArchiveReader.
◆ ListFileInArchive() [1/2]
virtual ArchiveListFileResult Archive::IArchiveReader::ListFileInArchive |
( |
ArchiveFileToken |
filePathToken | ) |
const |
|
pure virtual |
List the file metadata from the archive using the ArchiveFileToken
- Parameters
-
filePathToken | identifier token that can be used to quickly lookup metadata about the file |
- Returns
- ArchiveListResult with metadata for the file if found
Implemented in Archive::ArchiveReader.
◆ ListFileInArchive() [2/2]
virtual ArchiveListFileResult Archive::IArchiveReader::ListFileInArchive |
( |
AZ::IO::PathView |
relativePath | ) |
const |
|
pure virtual |
List the file metadata from the archive using the relative FilePath
- Parameters
-
relativePath | File path to lookup within the archive |
- Returns
- ArchiveListResult with metadata for the file if found
Implemented in Archive::ArchiveReader.
◆ MountArchive()
virtual bool Archive::IArchiveReader::MountArchive |
( |
AZ::IO::PathView |
archivePath | ) |
|
|
pure virtual |
Opens the archive path and returns true if successful Will unmount any previously mounted archive
Implemented in Archive::ArchiveReader.
The documentation for this class was generated from the following files:
- Gems/Archive/Code/Include/Archive/Clients/ArchiveReaderAPI.h
- Gems/Archive/Code/Include/Archive/Clients/ArchiveReaderAPI.inl