10#ifndef BITPROPVARIANT_HPP
11#define BITPROPVARIANT_HPP
13#include "bitdefines.hpp"
14#include "bittypes.hpp"
15#include "bitwindows.hpp"
299 template< typename T >
300 auto operator=( const T& value ) noexcept( std::is_integral< T >::value ) ->
BitPropVariant& {
333 BIT7Z_NODISCARD auto
getUInt8() const -> std::uint8_t;
339 BIT7Z_NODISCARD auto
getUInt16() const -> std::uint16_t;
345 BIT7Z_NODISCARD auto
getUInt32() const -> std::uint32_t;
351 BIT7Z_NODISCARD auto
getUInt64() const -> std::uint64_t;
357 BIT7Z_NODISCARD auto
getInt8() const -> std::int8_t;
363 BIT7Z_NODISCARD auto
getInt16() const -> std::int16_t;
369 BIT7Z_NODISCARD auto
getInt32() const -> std::int32_t;
375 BIT7Z_NODISCARD auto
getInt64() const -> std::int64_t;
397 BIT7Z_NODISCARD auto
isEmpty() const noexcept ->
bool;
402 BIT7Z_NODISCARD auto
isBool() const noexcept ->
bool;
407 BIT7Z_NODISCARD auto
isString() const noexcept ->
bool;
412 BIT7Z_NODISCARD auto
isUInt8() const noexcept ->
bool;
417 BIT7Z_NODISCARD auto
isUInt16() const noexcept ->
bool;
422 BIT7Z_NODISCARD auto
isUInt32() const noexcept ->
bool;
427 BIT7Z_NODISCARD auto
isUInt64() const noexcept ->
bool;
432 BIT7Z_NODISCARD auto
isInt8() const noexcept ->
bool;
437 BIT7Z_NODISCARD auto
isInt16() const noexcept ->
bool;
442 BIT7Z_NODISCARD auto
isInt32() const noexcept ->
bool;
447 BIT7Z_NODISCARD auto
isInt64() const noexcept ->
bool;
465 void internalClear() noexcept;
The main namespace of the bit7z library.
Definition bit7zlibrary.hpp:29
BitProperty
The BitProperty enum represents the archive/item properties that 7-zip can read or write.
Definition bitpropvariant.hpp:32
@ IsAltStream
Whether the item is an alternate data stream.
Definition bitpropvariant.hpp:96
@ Group
The group owning the item.
Definition bitpropvariant.hpp:59
@ UnpackVer
The format version required to extract the item.
Definition bitpropvariant.hpp:66
@ Comment
The comment associated with the item.
Definition bitpropvariant.hpp:61
@ AltStreamsSize
The total size of the alternate data streams of the item.
Definition bitpropvariant.hpp:109
@ Attrib
The attributes of the item.
Definition bitpropvariant.hpp:42
@ OutName
The suggested output name for the item.
Definition bitpropvariant.hpp:127
@ Warning
A warning associated with the archive.
Definition bitpropvariant.hpp:106
@ ReadOnly
Whether the item is read-only.
Definition bitpropvariant.hpp:126
@ ATime
The last access time of the item.
Definition bitpropvariant.hpp:44
@ Sha256
The SHA-256 hash of the item.
Definition bitpropvariant.hpp:101
@ TotalPhySize
The total physical size of the multi-volume archive.
Definition bitpropvariant.hpp:112
@ ErrorFlags
The flags describing the errors detected while opening the archive.
Definition bitpropvariant.hpp:104
@ MTime
The last write time of the item.
Definition bitpropvariant.hpp:45
@ CRC
The CRC checksum of the item.
Definition bitpropvariant.hpp:52
@ DictionarySize
The dictionary size used to compress the item.
Definition bitpropvariant.hpp:51
@ TimeType
The type (precision) of the item timestamps.
Definition bitpropvariant.hpp:73
@ Provider
The provider of the item.
Definition bitpropvariant.hpp:94
@ Va
The virtual address of the item.
Definition bitpropvariant.hpp:81
@ BigEndian
Whether the values are stored in big-endian byte order.
Definition bitpropvariant.hpp:75
@ IsTree
Whether the archive items are organized as a tree.
Definition bitpropvariant.hpp:99
@ MainSubfile
The index of the main subfile of the archive.
Definition bitpropvariant.hpp:34
@ NtSecure
The NT security descriptor of the item.
Definition bitpropvariant.hpp:95
@ NumBlocks
The number of blocks in the archive.
Definition bitpropvariant.hpp:71
@ IsAnti
Whether the item is an anti-item (a deletion marker).
Definition bitpropvariant.hpp:54
@ NumSubDirs
The number of subdirectories contained in the item.
Definition bitpropvariant.hpp:64
@ Characts
The characteristics of the item.
Definition bitpropvariant.hpp:80
@ NtReparse
The NT reparse point data of the item.
Definition bitpropvariant.hpp:122
@ ClusterSize
The cluster size of the volume.
Definition bitpropvariant.hpp:91
@ SplitBefore
Whether the item is continued from a previous volume.
Definition bitpropvariant.hpp:49
@ Id
The identifier of the item.
Definition bitpropvariant.hpp:82
@ Name
The name of the item.
Definition bitpropvariant.hpp:37
@ IsDir
Whether the item is a directory.
Definition bitpropvariant.hpp:39
@ Method
The compression method used for the item.
Definition bitpropvariant.hpp:55
@ IsVolume
Whether the archive is a multi-volume archive.
Definition bitpropvariant.hpp:68
@ Position
The position of the item.
Definition bitpropvariant.hpp:62
@ Cpu
The target CPU architecture.
Definition bitpropvariant.hpp:76
@ IsNotArcType
Whether the file is not of the detected archive type.
Definition bitpropvariant.hpp:117
@ PosixAttrib
The POSIX attributes of the item.
Definition bitpropvariant.hpp:86
@ TailSize
The size of the data following the archive (tail).
Definition bitpropvariant.hpp:120
@ Extension
The file extension of the item.
Definition bitpropvariant.hpp:38
@ SymLink
The symbolic link target of the item.
Definition bitpropvariant.hpp:87
@ ZerosTailIsAllowed
Whether a tail of zero bytes is allowed after the archive data.
Definition bitpropvariant.hpp:119
@ SplitAfter
Whether the item is continued in the next volume.
Definition bitpropvariant.hpp:50
@ NumErrors
The number of errors detected in the archive.
Definition bitpropvariant.hpp:103
@ WarningFlags
The flags describing the warnings detected while opening the archive.
Definition bitpropvariant.hpp:105
@ NumVolumes
The number of volumes composing the archive.
Definition bitpropvariant.hpp:72
@ Size
The uncompressed size of the item.
Definition bitpropvariant.hpp:40
@ Prefix
The path prefix of the item.
Definition bitpropvariant.hpp:63
@ VolumeName
The label of the volume.
Definition bitpropvariant.hpp:92
@ PhySize
The physical size of the archive.
Definition bitpropvariant.hpp:77
@ UnpackSize
The uncompressed size of the archive.
Definition bitpropvariant.hpp:111
@ ErrorType
The type of error detected while opening the archive.
Definition bitpropvariant.hpp:102
@ StreamId
The identifier of the data stream of the item.
Definition bitpropvariant.hpp:125
@ Sha1
The SHA-1 hash of the item.
Definition bitpropvariant.hpp:100
@ Checksum
The checksum of the item.
Definition bitpropvariant.hpp:79
@ PackSize
The compressed size of the item.
Definition bitpropvariant.hpp:41
@ HardLink
The hard link target of the item.
Definition bitpropvariant.hpp:123
@ HeadersSize
The size of the archive headers.
Definition bitpropvariant.hpp:78
@ User
The user owning the item.
Definition bitpropvariant.hpp:58
@ Error
An error associated with the item.
Definition bitpropvariant.hpp:88
@ Commented
Whether the item has a comment.
Definition bitpropvariant.hpp:47
@ HostOS
The host OS on which the item was created.
Definition bitpropvariant.hpp:56
@ Type
The type of the item.
Definition bitpropvariant.hpp:53
@ NumStreams
The number of streams in the archive.
Definition bitpropvariant.hpp:107
@ FreeSpace
The free space available on the volume.
Definition bitpropvariant.hpp:90
@ CreatorApp
The application that created the archive.
Definition bitpropvariant.hpp:84
@ Path
The path of the item.
Definition bitpropvariant.hpp:36
@ CopyLink
The copy link of the item.
Definition bitpropvariant.hpp:128
@ LocalName
The local name of the item.
Definition bitpropvariant.hpp:93
@ VolumeIndex
The index of the volume containing the item.
Definition bitpropvariant.hpp:113
@ Volume
The volume the item belongs to.
Definition bitpropvariant.hpp:67
@ Links
The number of hard links to the item.
Definition bitpropvariant.hpp:70
@ SubType
The subtype of the archive.
Definition bitpropvariant.hpp:114
@ CodePage
The code page used to encode the item.
Definition bitpropvariant.hpp:116
@ INode
The inode number of the item.
Definition bitpropvariant.hpp:124
@ IsDeleted
Whether the item is marked as deleted.
Definition bitpropvariant.hpp:98
@ ShortName
The short (DOS 8.3) name of the item.
Definition bitpropvariant.hpp:83
@ PhySizeCantBeDetected
Whether the physical size of the archive cannot be detected.
Definition bitpropvariant.hpp:118
@ Encrypted
Whether the item is encrypted.
Definition bitpropvariant.hpp:48
@ Offset
The offset of the item.
Definition bitpropvariant.hpp:69
@ Bit64
Whether the archive uses 64-bit values.
Definition bitpropvariant.hpp:74
@ Block
The index of the block containing the item.
Definition bitpropvariant.hpp:60
@ IsAux
Whether the item is an auxiliary item.
Definition bitpropvariant.hpp:97
@ FileSystem
The file system on which the item was stored.
Definition bitpropvariant.hpp:57
@ Solid
Whether the item uses solid compression.
Definition bitpropvariant.hpp:46
@ NumAltStreams
The number of alternate data streams of the item.
Definition bitpropvariant.hpp:108
@ SectorSize
The sector size of the volume.
Definition bitpropvariant.hpp:85
@ NoProperty
No property (placeholder for an invalid or unset property).
Definition bitpropvariant.hpp:33
@ VirtualSize
The virtual size of the item.
Definition bitpropvariant.hpp:110
@ TotalSize
The total size of the volume.
Definition bitpropvariant.hpp:89
@ EmbeddedStubSize
The size of the executable stub embedded before the archive data.
Definition bitpropvariant.hpp:121
@ HandlerItemIndex
The internal item index used by the archive handler.
Definition bitpropvariant.hpp:35
@ ShortComment
A short comment describing the archive.
Definition bitpropvariant.hpp:115
@ NumSubFiles
The number of subfiles contained in the item.
Definition bitpropvariant.hpp:65
@ CTime
The creation time of the item.
Definition bitpropvariant.hpp:43
std::wstring sevenzip_string
The string type used internally by 7-Zip.
Definition bittypes.hpp:69
auto to_string(BitProperty property) -> std::string
Returns the name of the given archive/item property.
BitPropVariantType
The BitPropVariantType enum represents the possible types that a BitPropVariant can store.
Definition bitpropvariant.hpp:143
@ String
String BitPropVariant type.
Definition bitpropvariant.hpp:146
@ Int16
16-bit signed int BitPropVariant type
Definition bitpropvariant.hpp:152
@ FileTime
FILETIME BitPropVariant type.
Definition bitpropvariant.hpp:155
@ Int8
8-bit signed int BitPropVariant type
Definition bitpropvariant.hpp:151
@ UInt16
16-bit unsigned int BitPropVariant type
Definition bitpropvariant.hpp:148
@ UInt64
64-bit unsigned int BitPropVariant type
Definition bitpropvariant.hpp:150
@ UInt8
8-bit unsigned int BitPropVariant type
Definition bitpropvariant.hpp:147
@ Int32
32-bit signed int BitPropVariant type
Definition bitpropvariant.hpp:153
@ Bool
Boolean BitPropVariant type.
Definition bitpropvariant.hpp:145
@ Empty
Empty BitPropVariant type.
Definition bitpropvariant.hpp:144
@ UInt32
32-bit unsigned int BitPropVariant type
Definition bitpropvariant.hpp:149
@ Int64
64-bit signed int BitPropVariant type
Definition bitpropvariant.hpp:154
std::basic_string< tchar > tstring
Definition bittypes.hpp:104
std::chrono::time_point< std::chrono::system_clock > time_type
A type representing a time point measured using the system clock.
Definition bitpropvariant.hpp:27
std::string native_string
Native string type of the system.
Definition bittypes.hpp:80
The BitPropVariant struct is a light extension to the WinAPI PROPVARIANT struct providing useful gett...
Definition bitpropvariant.hpp:161
void clear() noexcept
Clears the current value of the variant object.
auto getTimePoint() const -> time_type
auto isInt8() const noexcept -> bool
auto isString() const noexcept -> bool
auto getInt16() const -> std::int16_t
auto getInt64() const -> std::int64_t
auto isInt64() const noexcept -> bool
auto getFileTime() const -> FILETIME
auto getUInt32() const -> std::uint32_t
auto getInt8() const -> std::int8_t
auto getBool() const -> bool
auto getInt32() const -> std::int32_t
auto toString() const -> tstring
auto getString() const -> tstring
auto isUInt32() const noexcept -> bool
auto isInt16() const noexcept -> bool
auto isBool() const noexcept -> bool
auto getNativeString() const -> native_string
auto getRawString() const -> sevenzip_string
auto getUInt64() const -> std::uint64_t
auto type() const -> BitPropVariantType
auto getUInt8() const -> std::uint8_t
auto isUInt64() const noexcept -> bool
auto isInt32() const noexcept -> bool
BitPropVariant() noexcept
Constructs an empty BitPropVariant object.
auto isUInt8() const noexcept -> bool
auto isEmpty() const noexcept -> bool
auto getUInt16() const -> std::uint16_t
auto isFileTime() const noexcept -> bool
auto isUInt16() const noexcept -> bool