Function FileExtractCallback

Synopsis

#include <include/fileextractcallback.hpp>

FileExtractCallback(const BitArchiveHandler &handler, const BitInputArchive &inputArchive, const wstring &inFilePath, const wstring &directoryPath)

Description

Most of this code, though heavily modified, is taken from the CExtractCallback class in Client7z.cpp of the 7z SDK Main changes made:

  • Use of wstring instead of UString
  • Error messages are not showed. Instead, they are memorized into a wstring and used by BitExtractor to throw exceptions (see also Callback interface). Note that this class doesn't throw exceptions, as other classes in bit7, because it must implement interfaces with nothrow methods.
  • The work performed originally by the Init method is now performed by the class constructor

Source

Lines 43-54 in src/fileextractcallback.cpp. Line 34 in include/fileextractcallback.hpp.

FileExtractCallback::FileExtractCallback( const BitArchiveHandler& handler,
                                          const BitInputArchive& inputArchive,
                                          const wstring& inFilePath,
                                          const wstring& directoryPath )
    : ExtractCallback( handler, inputArchive ),
      mInFilePath( inFilePath ),
      mDirectoryPath( directoryPath ),
      mProcessedFileInfo(),
      mOutFileStreamSpec( nullptr ) {
    //NFile::NName::NormalizeDirPathPrefix( mDirectoryPath );
    filesystem::fsutil::normalizePath( mDirectoryPath );
}





Add Discussion as Guest

Log in