Function SetOperationResult

Synopsis

#include <include/fileextractcallback.hpp>

STDMETHOD() SetOperationResult(Int32 resultEOperationResult)

Description

No description yet.

Source

Lines 156-202 in src/fileextractcallback.cpp. Line 43 in include/fileextractcallback.hpp.

STDMETHODIMP FileExtractCallback::SetOperationResult( Int32 operationResult ) {
    switch ( operationResult ) {
        case NArchive::NExtract::NOperationResult::kOK:
            break;

        default: {
            mNumErrors++;

            switch ( operationResult ) {
                case NArchive::NExtract::NOperationResult::kUnsupportedMethod:
                    mErrorMessage = kUnsupportedMethod;
                    break;

                case NArchive::NExtract::NOperationResult::kCRCError:
                    mErrorMessage = kCRCFailed;
                    break;

                case NArchive::NExtract::NOperationResult::kDataError:
                    mErrorMessage = kDataError;
                    break;

                default:
                    mErrorMessage = kUnknownError;
            }
        }
    }

    if ( mOutFileStream != nullptr ) {
        if ( mProcessedFileInfo.MTimeDefined ) {
            mOutFileStreamSpec->SetMTime( &mProcessedFileInfo.MTime );
        }

        RINOK( mOutFileStreamSpec->Close() );
    }

    mOutFileStream.Release();

    if ( mExtractMode && mProcessedFileInfo.AttribDefined ) {
        NFile::NDir::SetFileAttrib( mDiskFilePath.c_str(), mProcessedFileInfo.Attrib );
    }

    if ( mNumErrors > 0 ) {
        return E_FAIL;
    }

    return S_OK;
}





Add Discussion as Guest

Log in