Function GetStream

Synopsis

#include <include/streamextractcallback.hpp>

STDMETHOD() GetStream(UInt32 index, ISequentialOutStream **outStream, Int32 askExtractMode)

Description

IArchiveExtractCallback.

Source

Lines 48-66 in src/streamextractcallback.cpp. Line 44 in include/streamextractcallback.hpp.

STDMETHODIMP StreamExtractCallback::GetStream( UInt32 index, ISequentialOutStream** outStream, Int32 askExtractMode ) try {
    *outStream = nullptr;
    mStdOutStream.Release();

    if ( askExtractMode != NArchive::NExtract::NAskMode::kExtract ) {
        return S_OK;
    }

    if ( !mInputArchive.isItemFolder( index ) ) {
        auto* out_std_stream_spec = new CStdOutStream( mOutputStream );
        CMyComPtr< IOutStream > outStreamLoc( out_std_stream_spec );
        mStdOutStream = outStreamLoc;
        *outStream = outStreamLoc.Detach();
    }

    return S_OK;
} catch ( const BitException& ) {
    return E_OUTOFMEMORY;
}





Add Discussion as Guest

Log in