Class BitArchiveItem

Synopsis

#include <include/bitarchiveitem.hpp>

class BitArchiveItem

Description

The BitArchiveItem class represents an item contained in an archive and contains all its properties.

Mentioned in

Methods

~BitArchiveItemBitArchiveItem destructor.
extensionReturn the extension of the item, if available or inferable from the name, or an empty string otherwise (e.g
getPropertyGets the specified item property.
indexReturn the index of the item in the archive.
isDirReturn true if and only if the item is a directory (i.e
isEncryptedReturn true if and only if the item is encrypted.
itemPropertiesReturn a map of all the available (i.e
nameReturn the name of the item, if available or inferable from the path, or an empty string otherwise.
packSizeReturn the compressed size of the item.
pathReturn the path of the item in the archive, if available or inferable from the name, or an empty string otherwise.
sizeReturn the uncompressed size of the item.

Source

Lines 33-106 in include/bitarchiveitem.hpp.

class BitArchiveItem {
    public:
        /**
         * @brief BitArchiveItem destructor.
         */
        virtual ~BitArchiveItem();
        /**
         * @return the index of the item in the archive.
         */
        uint32_t index() const;
        /**
         * @return true if and only if the item is a directory (i.e. it has the property BitProperty::IsDir).
         */
        bool isDir() const;
        /**
         * @return the name of the item, if available or inferable from the path, or an empty string otherwise.
         */
        wstring name() const;
        /**
         * @return the extension of the item, if available or inferable from the name, or an empty string otherwise
         * (e.g. when the item is a folder).
         */
        wstring extension() const;
        /**
         * @return the path of the item in the archive, if available or inferable from the name, or an empty string
         * otherwise.
         */
        wstring path() const;
        /**
         * @return the uncompressed size of the item.
         */
        uint64_t size() const;
        /**
         * @return the compressed size of the item.
         */
        uint64_t packSize() const;
        /**
         * @return true if and only if the item is encrypted.
         */
        bool isEncrypted() const;
        /**
         * @brief Gets the specified item property.
         *
         * @param property  the property to be retrieved.
         *
         * @return the value of the item property, if available, or an empty BitPropVariant.
         */
        BitPropVariant getProperty( BitProperty property ) const;
        /**
         * @return a map of all the available (i.e. non empty) item properties and their respective values.
         */
        map< BitProperty, BitPropVariant > itemProperties() const;
    private:
        const uint32_t mItemIndex;
        map< BitProperty, BitPropVariant > mItemProperties;
        /* BitArchiveItem objects can be created and updated only by BitArchiveReader */
        explicit BitArchiveItem( uint32_t item_index );
        void setProperty( BitProperty property, const BitPropVariant& value );
        friend class BitArchiveInfo;
};





Add Discussion as Guest

Log in