#include <ArchiveReader.h>
Inherits Archive::IArchiveReader.
|
| AZ_CLASS_ALLOCATOR_DECL |
|
| AZ_CLASS_ALLOCATOR_DECL |
|
Implements the Archive Reader Interface This can be used to read and extract files from an archive
◆ ArchiveReader()
Archive::ArchiveReader::ArchiveReader |
( |
AZ::IO::PathView |
archivePath, |
|
|
const ArchiveReaderSettings & |
readerSettings = {} |
|
) |
| |
|
explicit |
Open an file at the specified file path and takes sole ownership of it The ArchiveReader will close the file on Unmount
◆ ContainsFile()
bool Archive::ArchiveReader::ContainsFile |
( |
AZ::IO::PathView |
relativePath | ) |
const |
|
overridevirtual |
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;
Implements Archive::IArchiveReader.
◆ DumpArchiveMetadata()
bool Archive::ArchiveReader::DumpArchiveMetadata |
( |
AZ::IO::GenericStream & |
metadataStream, |
|
|
const ArchiveMetadataSettings & |
metadataSettings = {} |
|
) |
| const |
|
overridevirtual |
Dump metadata for the archive to the supplied generic stream
- Parameters
-
metadataStream | archive file metadata will be written to the stream |
metadataSettings | settings using which control the file metadata to write to the stream |
- Returns
- true if metadata was successfully written
Implements Archive::IArchiveReader.
◆ 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...) Alternatively this function can be used to list all of the files within the archive by binding a lambda that populates a vector
- 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
Implements Archive::IArchiveReader.
◆ 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
Implements Archive::IArchiveReader.
◆ ListFileInArchive() [1/2]
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
Implements Archive::IArchiveReader.
◆ ListFileInArchive() [2/2]
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
Implements Archive::IArchiveReader.
◆ MountArchive()
bool Archive::ArchiveReader::MountArchive |
( |
AZ::IO::PathView |
archivePath | ) |
|
|
overridevirtual |
Opens the archive path and returns true if successful Will unmount any previously mounted archive
Implements Archive::IArchiveReader.
The documentation for this class was generated from the following file:
- Gems/Archive/Code/Source/Clients/ArchiveReader.h