Struct BitPropVariant

Synopsis

#include <include/bitpropvariant.hpp>

struct BitPropVariant : public PROPVARIANT

Description

The BitPropVariant struct is a light extension to the WinAPI PROPVARIANT struct providing useful getters.

Inheritance

Ancestors: PROPVARIANT

Methods

BitPropVariant OverloadConstructs an empty BitPropVariant object.
BitPropVariant OverloadCopy constructs this BitPropVariant from another one.
BitPropVariant OverloadMove constructs this BitPropVariant from another one.
BitPropVariant OverloadConstructs a boolean BitPropVariant.
BitPropVariant OverloadConstructs a string BitPropVariant from a null-terminated C wide string.
BitPropVariant OverloadConstructs a string BitPropVariant from a wstring.
BitPropVariant OverloadConstructs a 8-bit unsigned integer BitPropVariant.
BitPropVariant OverloadConstructs a 16-bit unsigned integer BitPropVariant.
BitPropVariant OverloadConstructs a 32-bit unsigned integer BitPropVariant.
BitPropVariant OverloadConstructs a 64-bit unsigned integer BitPropVariant.
BitPropVariant OverloadConstructs a 8-bit integer BitPropVariant.
BitPropVariant OverloadConstructs a 16-bit integer BitPropVariant.
BitPropVariant OverloadConstructs a 32-bit integer BitPropVariant.
BitPropVariant OverloadConstructs a 64-bit integer BitPropVariant.
BitPropVariant OverloadConstructs a FILETIME BitPropVariant.
~BitPropVariantBitPropVariant destructor.
clearClears the current value of the variant object.
getBoolReturn the boolean value of this variant (it throws an expcetion if the variant is not a boolean).
getFiletimeReturn the FILETIME value of this variant (it throws an exception if the variant is not a filetime).
getInt16Return the 16-bit integer value of this variant (it throws an exception if the variant is not an 8 or 16-bit integer).
getInt32Return the 32-bit integer value of this variant (it throws an exception if the variant is not an 8, 16 or 32-bit integer).
getInt64Return the 64-bit integer value of this variant (it throws an exception if the variant is not an 8, 16, 32 or 64-bit integer).
getInt8Return the 8-bit integer value of this variant (it throws an exception if the variant is not an 8-bit integer).
getStringReturn the string value of this variant (it throws an exception if the variant is not a string).
getUInt16Return the 16-bit unsigned integer value of this variant (it throws an exception if the variant is not an 8 or 16-bit unsigned integer).
getUInt32Return the 32-bit unsigned integer value of this variant (it throws an exception if the variant is not an 8, 16 or 32-bit unsigned integer).
getUInt64Return the 64-bit unsigned integer value of this variant (it throws an exception if the variant is not an 8, 16, 32 or 64-bit unsigned integer).
getUInt8Return the 8-bit unsigned integer value of this variant (it throws an exception if the variant is not an 8-bit unsigned integer).
isBoolReturn true if this variant is a boolean, false otherwise.
isEmptyReturn true if this variant is empty, false otherwise.
isFiletimeReturn true if this variant is a FILETIME structure, false otherwise.
isInt16Return true if this variant is an 8 or 16-bit integer, false otherwise.
isInt32Return true if this variant is an 8, 16 or 32-bit integer, false otherwise.
isInt64Return true if this variant is an 8, 16, 32 or 64-bit integer, false otherwise.
isInt8Return true if this variant is an 8-bit integer, false otherwise.
isStringReturn true if this variant is a string, false otherwise.
isUInt16Return true if this variant is an 8 or 16-bit unsigned integer, false otherwise.
isUInt32Return true if this variant is an 8, 16 or 32-bit unsigned integer, false otherwise.
isUInt64Return true if this variant is an 8, 16, 32 or 64-bit unsigned integer, false otherwise.
isUInt8Return true if this variant is an 8-bit unsigned integer, false otherwise.
operator= OverloadCopy assignment operator.
operator= OverloadMove assignment operator.
operator= OverloadAssignment operator.
toStringReturn the the value of this variant converted from any supported type to std::wstring.
typeReturn the BitPropVariantType of this variant.

Source

Lines 270-560 in include/bitpropvariant.hpp.

struct BitPropVariant : public PROPVARIANT {
        /**
         * @brief Constructs an empty BitPropVariant object.
         */
        BitPropVariant();
        /**
         * @brief Copy constructs this BitPropVariant from another one.
         *
         * @param other the variant to be copied.
         */
        BitPropVariant( const BitPropVariant& other );
        /**
         * @brief Move constructs this BitPropVariant from another one.
         *
         * @param other the variant to be moved.
         */
        BitPropVariant( BitPropVariant&& other ) NOEXCEPT;
        /**
         * @brief Constructs a boolean BitPropVariant
         *
         * @param value the bool value of the BitPropVariant
         */
        explicit BitPropVariant( bool value );
        /**
         * @brief Constructs a string BitPropVariant from a null-terminated C wide string
         *
         * @param value the null-terminated C wide string value of the BitPropVariant
         */
        explicit BitPropVariant( const wchar_t* value );
        /**
         * @brief Constructs a string BitPropVariant from a wstring
         *
         * @param value the wstring value of the BitPropVariant
         */
        explicit BitPropVariant( const wstring& value );
        /**
         * @brief Constructs a 8-bit unsigned integer BitPropVariant
         *
         * @param value the uint8_t value of the BitPropVariant
         */
        explicit BitPropVariant( uint8_t value );
        /**
         * @brief Constructs a 16-bit unsigned integer BitPropVariant
         *
         * @param value the uint16_t value of the BitPropVariant
         */
        explicit BitPropVariant( uint16_t value );
        /**
         * @brief Constructs a 32-bit unsigned integer BitPropVariant
         *
         * @param value the uint32_t value of the BitPropVariant
         */
        explicit BitPropVariant( uint32_t value );
        /**
         * @brief Constructs a 64-bit unsigned integer BitPropVariant
         *
         * @param value the uint64_t value of the BitPropVariant
         */
        explicit BitPropVariant( uint64_t value );
        /**
         * @brief Constructs a 8-bit integer BitPropVariant
         *
         * @param value the int8_t value of the BitPropVariant
         */
        explicit BitPropVariant( int8_t value );
        /**
         * @brief Constructs a 16-bit integer BitPropVariant
         *
         * @param value the int16_t value of the BitPropVariant
         */
        explicit BitPropVariant( int16_t value );
        /**
         * @brief Constructs a 32-bit integer BitPropVariant
         *
         * @param value the int32_t value of the BitPropVariant
         */
        explicit BitPropVariant( int32_t value );
        /**
         * @brief Constructs a 64-bit integer BitPropVariant
         *
         * @param value the int64_t value of the BitPropVariant
         */
        explicit BitPropVariant( int64_t value );
        /**
         * @brief Constructs a FILETIME BitPropVariant
         *
         * @param value the FILETIME value of the BitPropVariant
         */
        explicit BitPropVariant( const FILETIME& value );
        /**
         * @brief BitPropVariant destructor.
         *
         * @note This is not virtual, in order to maintain the same memory layout of the base struct!
         */
        ~BitPropVariant();
        /**
         * @brief Copy assignment operator.
         *
         * @param other the variant to be copied.
         *
         * @return a reference to *this object (with the copied values from other).
         */
        BitPropVariant& operator=( const BitPropVariant& other ) NOEXCEPT;
        /**
         * @brief Move assignment operator.
         *
         * @param other the variant to be moved.
         *
         * @return a reference to *this object (with the moved values from other).
         */
        BitPropVariant& operator=( BitPropVariant&& other ) NOEXCEPT;
        /**
         * @brief Assignment operator
         *
         * @note this will work only for T types for which a BitPropVariant constructor is defined!
         *
         * @param value the value to be assigned to the object
         *
         * @return a reference to *this object having the value as new variant value
         */
        template<typename T>
        BitPropVariant& operator=( const T& value ) {
            *this = BitPropVariant( value );
            return *this;
        }
        /**
         * @return the boolean value of this variant
         * (it throws an expcetion if the variant is not a boolean).
         */
        bool getBool() const;
        /**
         * @return the string value of this variant
         * (it throws an exception if the variant is not a string).
         */
        wstring getString() const;
        /**
         * @return the 8-bit unsigned integer value of this variant
         * (it throws an exception if the variant is not an 8-bit unsigned integer).
         */
        uint8_t getUInt8() const;
        /**
         * @return the 16-bit unsigned integer value of this variant
         * (it throws an exception if the variant is not an 8 or 16-bit unsigned integer).
         */
        uint16_t getUInt16() const;
        /**
         * @return the 32-bit unsigned integer value of this variant
         * (it throws an exception if the variant is not an 8, 16 or 32-bit unsigned integer).
         */
        uint32_t getUInt32() const;
        /**
         * @return the 64-bit unsigned integer value of this variant
         * (it throws an exception if the variant is not an 8, 16, 32 or 64-bit unsigned integer).
         */
        uint64_t getUInt64() const;
        /**
         * @return the 8-bit integer value of this variant
         * (it throws an exception if the variant is not an 8-bit integer).
         */
        int8_t getInt8() const;
        /**
         * @return the 16-bit integer value of this variant
         * (it throws an exception if the variant is not an 8 or 16-bit integer).
         */
        int16_t getInt16() const;
        /**
         * @return the 32-bit integer value of this variant
         * (it throws an exception if the variant is not an 8, 16 or 32-bit integer).
         */
        int32_t getInt32() const;
        /**
         * @return the 64-bit integer value of this variant
         * (it throws an exception if the variant is not an 8, 16, 32 or 64-bit integer).
         */
        int64_t getInt64() const;
        /**
         * @return the FILETIME value of this variant
         * (it throws an exception if the variant is not a filetime).
         */
        FILETIME getFiletime() const;
        /**
         * @return the the value of this variant converted from any supported type to std::wstring.
         */
        wstring toString() const;
        /**
         * @return true if this variant is empty, false otherwise.
         */
        bool isEmpty() const;
        /**
         * @return true if this variant is a boolean, false otherwise.
         */
        bool isBool() const;
        /**
         * @return true if this variant is a string, false otherwise.
         */
        bool isString() const;
        /**
         * @return true if this variant is an 8-bit unsigned integer, false otherwise.
         */
        bool isUInt8() const;
        /**
         * @return true if this variant is an 8 or 16-bit unsigned integer, false otherwise.
         */
        bool isUInt16() const;
        /**
         * @return true if this variant is an 8, 16 or 32-bit unsigned integer, false otherwise.
         */
        bool isUInt32() const;
        /**
         * @return true if this variant is an 8, 16, 32 or 64-bit unsigned integer, false otherwise.
         */
        bool isUInt64() const;
        /**
         * @return true if this variant is an 8-bit integer, false otherwise.
         */
        bool isInt8() const;
        /**
         * @return true if this variant is an 8 or 16-bit integer, false otherwise.
         */
        bool isInt16() const;
        /**
         * @return true if this variant is an 8, 16 or 32-bit integer, false otherwise.
         */
        bool isInt32() const;
        /**
         * @return true if this variant is an 8, 16, 32 or 64-bit integer, false otherwise.
         */
        bool isInt64() const;
        /**
         * @return true if this variant is a FILETIME structure, false otherwise.
         */
        bool isFiletime() const;
        /**
         * @return the BitPropVariantType of this variant.
         */
        BitPropVariantType type() const;
        /**
         * @brief Clears the current value of the variant object
         */
        void clear();
    private:
        void internalClear();
        friend bool operator ==( const BitPropVariant& a, const BitPropVariant& b );
        friend bool operator !=( const BitPropVariant& a, const BitPropVariant& b );
};





Add Discussion as Guest

Log in