#include <ArchiveReader.h>
Inherits Archive::IArchiveReader.
Public Member Functions | |
AZ_TYPE_INFO_WITH_NAME_DECL (ArchiveReader) | |
AZ_RTTI_NO_TYPE_INFO_DECL () | |
ArchiveReader (const ArchiveReaderSettings &readerSettings) | |
Create an archive reader using the specified reader settings. | |
ArchiveReader (AZ::IO::PathView archivePath, const ArchiveReaderSettings &readerSettings={}) | |
ArchiveReader (ArchiveStreamPtr archiveStream, const ArchiveReaderSettings &readerSettings={}) | |
Takes ownership of the open stream and will optionally delete it based on the ArchiveFileDeleter. | |
bool | MountArchive (AZ::IO::PathView archivePath) override |
bool | MountArchive (ArchiveStreamPtr archiveStream) override |
void | UnmountArchive () override |
Closes the handle to the mounted archive stream. | |
bool | IsMounted () const override |
Returns if an open archive that is mounted. | |
ArchiveExtractFileResult | ExtractFileFromArchive (AZStd::span< AZStd::byte > outputSpan, const ArchiveReaderFileSettings &fileSettings) override |
ArchiveListFileResult | ListFileInArchive (ArchiveFileToken filePathToken) const override |
ArchiveListFileResult | ListFileInArchive (AZ::IO::PathView relativePath) const override |
bool | ContainsFile (AZ::IO::PathView relativePath) const override |
EnumerateArchiveResult | EnumerateFilesInArchive (ListFileCallback listFileCallback) const override |
bool | DumpArchiveMetadata (AZ::IO::GenericStream &metadataStream, const ArchiveMetadataSettings &metadataSettings={}) const override |
Public Member Functions inherited from Archive::IArchiveReader | |
AZ_TYPE_INFO_WITH_NAME_DECL (IArchiveReader) | |
AZ_RTTI_NO_TYPE_INFO_DECL () | |
virtual bool | MountArchive (AZ::IO::PathView archivePath)=0 |
virtual bool | MountArchive (ArchiveStreamPtr archiveStream)=0 |
virtual void | UnmountArchive ()=0 |
Closes the handle to the mounted archive stream. | |
virtual bool | IsMounted () const =0 |
Returns if an open archive that is mounted. | |
virtual ArchiveExtractFileResult | ExtractFileFromArchive (AZStd::span< AZStd::byte > outputSpan, const ArchiveReaderFileSettings &fileSettings)=0 |
virtual ArchiveListFileResult | ListFileInArchive (ArchiveFileToken filePathToken) const =0 |
virtual ArchiveListFileResult | ListFileInArchive (AZ::IO::PathView relativePath) const =0 |
virtual bool | ContainsFile (AZ::IO::PathView relativePath) const =0 |
virtual EnumerateArchiveResult | EnumerateFilesInArchive (ListFileCallback listFileCallback) const =0 |
virtual bool | DumpArchiveMetadata (AZ::IO::GenericStream &metadataStream, const ArchiveMetadataSettings &metadataSettings={}) const =0 |
Public Attributes | |
AZ_CLASS_ALLOCATOR_DECL | |
Public Attributes inherited from Archive::IArchiveReader | |
AZ_CLASS_ALLOCATOR_DECL | |
Additional Inherited Members | |
Public Types inherited from Archive::IArchiveReader | |
using | ArchiveStreamPtr = AZStd::unique_ptr< AZ::IO::GenericStream, ArchiveStreamDeleter > |
using | ListFileCallback = AZStd::function< bool(ArchiveListFileResult)> |
Implements the Archive Reader Interface This can be used to read and extract files from an archive
|
explicit |
Open an file at the specified file path and takes sole ownership of it The ArchiveReader will close the file on Unmount
|
overridevirtual |
Returns if the archive contains a relative path
relativePath | Relative path within archive to search for |
return FindFile(relativePath) != InvalidArchiveFileToken;
Implements Archive::IArchiveReader.
|
overridevirtual |
Dump metadata for the archive to the supplied generic stream
metadataStream | archive file metadata will be written to the stream |
metadataSettings | settings using which control the file metadata to write to the stream |
Implements Archive::IArchiveReader.
|
overridevirtual |
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
listFileCallback | Callback which is invoked for each file in the archive |
Implements Archive::IArchiveReader.
|
overridevirtual |
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
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... |
Implements Archive::IArchiveReader.
|
overridevirtual |
Returns if an open archive that is mounted.
Implements Archive::IArchiveReader.
|
overridevirtual |
List the file metadata from the archive using the ArchiveFileToken
filePathToken | identifier token that can be used to quickly lookup metadata about the file |
Implements Archive::IArchiveReader.
|
overridevirtual |
List the file metadata from the archive using the relative FilePath
relativePath | File path to lookup within the archive |
Implements Archive::IArchiveReader.
|
overridevirtual |
Implements Archive::IArchiveReader.
|
overridevirtual |
Opens the archive path and returns true if successful Will unmount any previously mounted archive
Implements Archive::IArchiveReader.
|
overridevirtual |
Closes the handle to the mounted archive stream.
Implements Archive::IArchiveReader.