ReadArchiveInterface Class Reference

#include <ioarchivehandler.h>

Inheritance diagram for ReadArchiveInterface:

Detailed Description

Interface class to read archives.

Public Member Functions

MAXON_METHOD Result< void > Open (const Url &inputFile, const String &password=String())
 
MAXON_METHOD Result< void > Close ()
 
MAXON_METHOD Result< UrlExtractSingleFile (const String &archiveFile, const Url &outputDirectory, ThreadRef thread, IOARCHIVEEXTRACTFLAGS flags, const ExtractCallback &extractCallback)
 
MAXON_METHOD Result< void > Extract (const Url &outputDirectory, ThreadRef thread, IOARCHIVEEXTRACTFLAGS flags, const ExtractCallback &extractCallback)
 

Private Member Functions

 MAXON_INTERFACE (ReadArchiveInterface, MAXON_REFERENCE_NORMAL, "net.maxon.interface.readarchive", MAXON_IMPLEMENTATION_MODULE("net.maxon.kernel"))
 

Member Function Documentation

◆ MAXON_INTERFACE()

MAXON_INTERFACE ( ReadArchiveInterface  ,
MAXON_REFERENCE_NORMAL  ,
"net.maxon.interface.readarchive"  ,
MAXON_IMPLEMENTATION_MODULE("net.maxon.kernel")   
)
private

◆ Open()

MAXON_METHOD Result<void> Open ( const Url inputFile,
const String password = String() 
)

Opens an archive for reading.

Parameters
[in]inputFileThe path of the archive.
[in]passwordAn optional password.
Returns
OK on success.

◆ Close()

MAXON_METHOD Result<void> Close ( )

Closes the archive.

Returns
OK on success.

◆ ExtractSingleFile()

MAXON_METHOD Result<Url> ExtractSingleFile ( const String archiveFile,
const Url outputDirectory,
ThreadRef  thread,
IOARCHIVEEXTRACTFLAGS  flags,
const ExtractCallback extractCallback 
)

Extracts a single file from an archive. Using extractCallback you can modify attributes.

Parameters
[in]archiveFileThe file to extract from the archive. Note that this must match exactly the name within the archive.
[in]outputDirectoryThe path the archive shall be extracted to. If the directory does not exist if will be created.
[in]threadAn optional thread to check for IsCancelled. Can be nullptr.
[in]flagsControl the behavior of the function see IOARCHIVEEXTRACTFLAGS.
[in]extractCallbackA callback that allows you to control the extraction process.
Returns
Returns the name of the extracted file on success. If the file was not found in the archive an empty Url will be returned.

◆ Extract()

MAXON_METHOD Result<void> Extract ( const Url outputDirectory,
ThreadRef  thread,
IOARCHIVEEXTRACTFLAGS  flags,
const ExtractCallback extractCallback 
)

Extracts all files from an archive. Using extractCallback you can filter which files shall be extracted and modify attributes.

Parameters
[in]outputDirectoryThe path the archive shall be extracted to. If the directory does not exist if will be created.
[in]threadAn optional thread to check for IsCancelled. Can be nullptr.
[in]flagsControl the behavior of the function see IOARCHIVEEXTRACTFLAGS.
[in]extractCallbackA callback that allows you to control the extraction process.
Returns
OK on success.