Function BitPropVariant

Summary

#include <include/bitpropvariant.hpp>

(1) BitPropVariant()

(2) BitPropVariant(const BitPropVariant &other)

(3) BitPropVariant(BitPropVariant &&other) NOEXCEPT

(4) explicit BitPropVariant(bool value)

(5) explicit BitPropVariant(const wchar_t *value)

(6) explicit BitPropVariant(const wstring &value)

(7) explicit BitPropVariant(uint8_t value)

(8) explicit BitPropVariant(uint16_t value)

(9) explicit BitPropVariant(uint32_t value)

(10) explicit BitPropVariant(uint64_t value)

(11) explicit BitPropVariant(int8_t value)

(12) explicit BitPropVariant(int16_t value)

(13) explicit BitPropVariant(int32_t value)

(14) explicit BitPropVariant(int64_t value)

(15) explicit BitPropVariant(const FILETIME &value)

Function overload

Synopsis

#include <include/bitpropvariant.hpp>

BitPropVariant()

Description

Constructs an empty BitPropVariant object.

Source

Lines 63-68 in src/bitpropvariant.cpp. Line 274 in include/bitpropvariant.hpp.

BitPropVariant::BitPropVariant() : PROPVARIANT() {
    /* As in CPropVariant default constructor (Note: it seems that the default vt value is VT_NULL)*/
    vt = VT_EMPTY;
    wReserved1 = 0;
    bstrVal = nullptr;
}

Synopsis

#include <include/bitpropvariant.hpp>

BitPropVariant(const BitPropVariant &other)

Description

Copy constructs this BitPropVariant from another one.

Parameters

other - the variant to be copied.

Source

Lines 70-78 in src/bitpropvariant.cpp. Line 281 in include/bitpropvariant.hpp.

BitPropVariant::BitPropVariant( const BitPropVariant& other ) : PROPVARIANT( other ) {
    if ( vt == VT_BSTR ) { //until now, I've copied only the pointer to the string, hence we need a copy!
        bstrVal = SysAllocStringByteLen( reinterpret_cast< LPCSTR >( other.bstrVal ),
                                         SysStringByteLen( other.bstrVal ) );
        if ( !bstrVal ) {
            throw BitException( "Could not allocate memory for BitPropVariant string" );
        }
    }
}

Synopsis

#include <include/bitpropvariant.hpp>

BitPropVariant(BitPropVariant &&other) NOEXCEPT

Description

Move constructs this BitPropVariant from another one.

Parameters

other - the variant to be moved.

Source

Lines 80-87 in src/bitpropvariant.cpp. Line 288 in include/bitpropvariant.hpp.

BitPropVariant::BitPropVariant( BitPropVariant&& other ) NOEXCEPT : PROPVARIANT( other ) {
    if ( vt == VT_BSTR ) {
        /* this and other share the pointer to the same string, but now the string belongs to this!
         * Hence, if we set the other.bstrVal to nullptr, we prevent the bstrVal from being destroyed when
         * the other object is deleted! */
        other.bstrVal = nullptr;
    }
}

Synopsis

#include <include/bitpropvariant.hpp>

explicit BitPropVariant(bool value)

Description

Constructs a boolean BitPropVariant.

Parameters

value - the bool value of the BitPropVariant

Source

Lines 89-93 in src/bitpropvariant.cpp. Line 295 in include/bitpropvariant.hpp.

BitPropVariant::BitPropVariant( bool value ) : PROPVARIANT() {
    vt = VT_BOOL;
    wReserved1 = 0;
    boolVal = ( value ? VARIANT_TRUE : VARIANT_FALSE );
}

Synopsis

#include <include/bitpropvariant.hpp>

explicit BitPropVariant(const wchar_t *value)

Description

Constructs a string BitPropVariant from a null-terminated C wide string.

Parameters

value - the null-terminated C wide string value of the BitPropVariant

Source

Lines 95-106 in src/bitpropvariant.cpp. Line 302 in include/bitpropvariant.hpp.

BitPropVariant::BitPropVariant( const wchar_t* value ) : PROPVARIANT() {
    vt = VT_BSTR;
    wReserved1 = 0;
    if ( value != nullptr ) {
        bstrVal = ::SysAllocString( value );
        if ( !bstrVal ) {
            throw BitException( "Could not allocate memory for BitPropVariant string" );
        }
    } else {
        bstrVal = nullptr;
    }
}

Synopsis

#include <include/bitpropvariant.hpp>

explicit BitPropVariant(const wstring &value)

Description

Constructs a string BitPropVariant from a wstring.

Parameters

value - the wstring value of the BitPropVariant

Source

Lines 108-115 in src/bitpropvariant.cpp. Line 309 in include/bitpropvariant.hpp.

BitPropVariant::BitPropVariant( const wstring& value ) : PROPVARIANT() {
    vt = VT_BSTR;
    wReserved1 = 0;
    bstrVal = ::SysAllocStringLen( value.data(), static_cast< unsigned int >( value.size() ) );
    if ( !bstrVal ) {
        throw BitException( "Could not allocate memory for BitPropVariant string" );
    }
}

Synopsis

#include <include/bitpropvariant.hpp>

explicit BitPropVariant(uint8_t value)

Description

Constructs a 8-bit unsigned integer BitPropVariant.

Parameters

value - the uint8_t value of the BitPropVariant

Source

Lines 117-121 in src/bitpropvariant.cpp. Line 316 in include/bitpropvariant.hpp.

BitPropVariant::BitPropVariant( uint8_t value ) : PROPVARIANT() {
    vt = VT_UI1;
    wReserved1 = 0;
    bVal = value;
}

Synopsis

#include <include/bitpropvariant.hpp>

explicit BitPropVariant(uint16_t value)

Description

Constructs a 16-bit unsigned integer BitPropVariant.

Parameters

value - the uint16_t value of the BitPropVariant

Source

Lines 123-127 in src/bitpropvariant.cpp. Line 323 in include/bitpropvariant.hpp.

BitPropVariant::BitPropVariant( uint16_t value ) : PROPVARIANT() {
    vt = VT_UI2;
    wReserved1 = 0;
    uiVal = value;
}

Synopsis

#include <include/bitpropvariant.hpp>

explicit BitPropVariant(uint32_t value)

Description

Constructs a 32-bit unsigned integer BitPropVariant.

Parameters

value - the uint32_t value of the BitPropVariant

Source

Lines 129-133 in src/bitpropvariant.cpp. Line 330 in include/bitpropvariant.hpp.

BitPropVariant::BitPropVariant( uint32_t value ) : PROPVARIANT() {
    vt = VT_UI4;
    wReserved1 = 0;
    ulVal = value;
}

Synopsis

#include <include/bitpropvariant.hpp>

explicit BitPropVariant(uint64_t value)

Description

Constructs a 64-bit unsigned integer BitPropVariant.

Parameters

value - the uint64_t value of the BitPropVariant

Source

Lines 135-139 in src/bitpropvariant.cpp. Line 337 in include/bitpropvariant.hpp.

BitPropVariant::BitPropVariant( uint64_t value ) : PROPVARIANT() {
    vt = VT_UI8;
    wReserved1 = 0;
    uhVal.QuadPart = value;
}

Synopsis

#include <include/bitpropvariant.hpp>

explicit BitPropVariant(int8_t value)

Description

Constructs a 8-bit integer BitPropVariant.

Parameters

value - the int8_t value of the BitPropVariant

Source

Lines 141-145 in src/bitpropvariant.cpp. Line 344 in include/bitpropvariant.hpp.

BitPropVariant::BitPropVariant( int8_t value ) : PROPVARIANT() {
    vt = VT_I1;
    wReserved1 = 0;
    cVal = value;
}

Synopsis

#include <include/bitpropvariant.hpp>

explicit BitPropVariant(int16_t value)

Description

Constructs a 16-bit integer BitPropVariant.

Parameters

value - the int16_t value of the BitPropVariant

Source

Lines 147-151 in src/bitpropvariant.cpp. Line 351 in include/bitpropvariant.hpp.

BitPropVariant::BitPropVariant( int16_t value ) : PROPVARIANT() {
    vt = VT_I2;
    wReserved1 = 0;
    iVal = value;
}

Synopsis

#include <include/bitpropvariant.hpp>

explicit BitPropVariant(int32_t value)

Description

Constructs a 32-bit integer BitPropVariant.

Parameters

value - the int32_t value of the BitPropVariant

Source

Lines 153-157 in src/bitpropvariant.cpp. Line 358 in include/bitpropvariant.hpp.

BitPropVariant::BitPropVariant( int32_t value ) : PROPVARIANT() {
    vt = VT_I4;
    wReserved1 = 0;
    lVal = value;
}

Synopsis

#include <include/bitpropvariant.hpp>

explicit BitPropVariant(int64_t value)

Description

Constructs a 64-bit integer BitPropVariant.

Parameters

value - the int64_t value of the BitPropVariant

Source

Lines 159-163 in src/bitpropvariant.cpp. Line 365 in include/bitpropvariant.hpp.

BitPropVariant::BitPropVariant( int64_t value ) : PROPVARIANT() {
    vt = VT_I8;
    wReserved1 = 0;
    hVal.QuadPart = value;
}

Synopsis

#include <include/bitpropvariant.hpp>

explicit BitPropVariant(const FILETIME &value)

Description

Constructs a FILETIME BitPropVariant.

Parameters

value - the FILETIME value of the BitPropVariant

Source

Lines 165-169 in src/bitpropvariant.cpp. Line 372 in include/bitpropvariant.hpp.

BitPropVariant::BitPropVariant( const FILETIME& value ) : PROPVARIANT() {
    vt = VT_FILETIME;
    wReserved1 = 0;
    filetime = value;
}





Add Discussion as Guest

Log in