Class BitArchiveInfo

Synopsis

#include <include/bitarchiveinfo.hpp>

class BitArchiveInfo : public BitArchiveOpener, public BitInputArchive

Description

The BitArchiveInfo class allows to retrieve metadata information of archives and their content.

Mentioned in

Inheritance

Ancestors: BitArchiveOpener, BitInputArchive

Methods

BitArchiveInfo overloadConstructs a BitArchiveInfo object, opening the input file archive.
BitArchiveInfo overloadConstructs a BitArchiveInfo object, opening the archive in the input buffer.
BitArchiveInfo overloadConstructs a BitArchiveInfo object, opening the archive from the standard input stream.
~BitArchiveInfoBitArchiveInfo destructor.
archivePropertiesReturns: a map of all the available (i.e
filesCountReturns: the number of files contained in the archive.
foldersCountReturns: the number of folders contained in the archive.
hasEncryptedItemsReturns: true if and only if the archive has at least one encrypted item.
isMultiVolumeReturns: true if and only if the archive is composed by multiple volumes.
isSolidReturns: true if and only if the archive was created using solid compression.
itemsReturns: a vector of all the archive items as BitArchiveItem objects.
packSizeReturns: the total compressed size of the archive content.
sizeReturns: the total uncompressed size of the archive content.
volumesCountReturns: the number of volumes composing the archive.

Source

Lines 35-147 in include/bitarchiveinfo.hpp.

class BitArchiveInfo : public BitArchiveOpener, public BitInputArchive {
    public:
        /**
         * @brief Constructs a BitArchiveInfo object, opening the input file archive.
         *
         * @note When bit7z is compiled using the BIT7Z_AUTO_FORMAT macro define, the format
         * argument has default value BitFormat::Auto (automatic format detection of the input archive).
         * On the other hand, when BIT7Z_AUTO_FORMAT is not defined (i.e. no auto format detection available)
         * the format argument must be specified.
         *
         * @param lib       the 7z library used.
         * @param in_file   the input archive file path.
         * @param format    the input archive format.
         * @param password  the password needed to open the input archive.
         */
        BitArchiveInfo( const Bit7zLibrary& lib,
                        const wstring& in_file,
                        const BitInFormat& format DEFAULT_FORMAT,
                        const wstring& password = L"" );
        /**
         * @brief Constructs a BitArchiveInfo object, opening the archive in the input buffer.
         *
         * @note When bit7z is compiled using the BIT7Z_AUTO_FORMAT macro define, the format
         * argument has default value BitFormat::Auto (automatic format detection of the input archive).
         * On the other hand, when BIT7Z_AUTO_FORMAT is not defined (i.e. no auto format detection available)
         * the format argument must be specified.
         *
         * @param lib       the 7z library used.
         * @param in_buffer the input buffer containing the archive.
         * @param format    the input archive format.
         * @param password  the password needed to open the input archive.
         */
        BitArchiveInfo( const Bit7zLibrary& lib,
                        const vector< byte_t >& in_buffer,
                        const BitInFormat& format DEFAULT_FORMAT,
                        const wstring& password = L"" );
        /**
         * @brief Constructs a BitArchiveInfo object, opening the archive from the standard input stream.
         *
         * @note When bit7z is compiled using the BIT7Z_AUTO_FORMAT macro define, the format
         * argument has default value BitFormat::Auto (automatic format detection of the input archive).
         * On the other hand, when BIT7Z_AUTO_FORMAT is not defined (i.e. no auto format detection available)
         * the format argument must be specified.
         *
         * @param lib       the 7z library used.
         * @param in_stream the standard input stream of the archive.
         * @param format    the input archive format.
         * @param password  the password needed to open the input archive.
         */
        BitArchiveInfo( const Bit7zLibrary& lib,
                        std::istream& in_stream,
                        const BitInFormat& format DEFAULT_FORMAT,
                        const wstring& password = L"" );
        /**
         * @brief BitArchiveInfo destructor.
         *
         * @note It releases the input archive file.
         */
        virtual ~BitArchiveInfo() override;
        /**
         * @return a map of all the available (i.e. non empty) archive properties and their respective values.
         */
        map< BitProperty, BitPropVariant > archiveProperties() const;
        /**
         * @return a vector of all the archive items as BitArchiveItem objects.
         */
        vector< BitArchiveItem > items() const;
        /**
         * @return the number of folders contained in the archive.
         */
        uint32_t foldersCount() const;
        /**
         * @return the number of files contained in the archive.
         */
        uint32_t filesCount() const;
        /**
         * @return the total uncompressed size of the archive content.
         */
        uint64_t size() const;
        /**
         * @return the total compressed size of the archive content.
         */
        uint64_t packSize() const;
        /**
         * @return true if and only if the archive has at least one encrypted item.
         */
        bool hasEncryptedItems() const;
        /**
         * @return the number of volumes composing the archive.
         */
        uint32_t volumesCount() const;
        /**
         * @return true if and only if the archive is composed by multiple volumes.
         */
        bool isMultiVolume() const;
        /**
         * @return true if and only if the archive was created using solid compression.
         */
        bool isSolid() const;
};





Add Discussion as Guest

Log in