Function hasEncryptedItems

Synopsis

#include <include/bitarchiveinfo.hpp>

bool hasEncryptedItems() const

Description

Return
true if and only if the archive has at least one encrypted item.

Source

Lines 109-119 in src/bitarchiveinfo.cpp. Line 131 in include/bitarchiveinfo.hpp.

bool BitArchiveInfo::hasEncryptedItems() const {
    /* Note: simple encryption (i.e. not including the archive headers) can be detected only reading
     *       the properties of the files in the archive, so we search for any encrypted file inside the archive! */
    uint32_t items_count = itemsCount();
    for ( uint32_t file_index = 0; file_index < items_count; ++file_index ) {
        if ( !isItemFolder( file_index ) && isItemEncrypted( file_index ) ) {
            return true;
        }
    }
    return false;
}





Add Discussion as Guest

Log in