Function GetProperty

Synopsis

#include <include/bufferupdatecallback.hpp>

STDMETHOD() GetProperty(UInt32 index, PROPID propID, PROPVARIANT *value)

Description

IArchiveUpdateCallback2.

Source

Lines 48-85 in src/bufferupdatecallback.cpp. Line 42 in include/bufferupdatecallback.hpp.

HRESULT BufferUpdateCallback::GetProperty( UInt32 index, PROPID propID, PROPVARIANT* value ) {
    BitPropVariant prop;

    if ( propID == kpidIsAnti ) {
        prop = false;
    } else if ( index < mOldArcItemsCount ) {
        prop = mOldArc->getItemProperty( index, static_cast< BitProperty >( propID ) );
    } else {
        switch ( propID ) {
            case kpidPath:
                prop = ( mBufferName.empty() ) ? kEmptyFileAlias : mBufferName;
                break;
            case kpidIsDir:
                prop = false;
                break;
            case kpidSize:
                prop = static_cast< uint64_t >( sizeof( byte_t ) * mBuffer.size() );
                break;
            case kpidAttrib:
                prop = static_cast< uint32_t >( FILE_ATTRIBUTE_NORMAL );
                break;
            case kpidCTime:
            case kpidATime:
            case kpidMTime: {
                FILETIME ft;
                SYSTEMTIME st;

                GetSystemTime( &st ); // gets current time
                SystemTimeToFileTime( &st, &ft ); // converts to file time format
                prop = ft;
                break;
            }
        }
    }

    *value = prop;
    return S_OK;
}





Add Discussion as Guest

Log in