other-licenses/7zstub/src/Windows/PropVariant.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 // Windows/PropVariant.h
     3 #ifndef __WINDOWS_PROPVARIANT_H
     4 #define __WINDOWS_PROPVARIANT_H
     6 #include "../Common/MyWindows.h"
     7 #include "../Common/Types.h"
     9 namespace NWindows {
    10 namespace NCOM {
    12 class CPropVariant : public tagPROPVARIANT
    13 {
    14 public:
    15   CPropVariant() { vt = VT_EMPTY; }
    16   ~CPropVariant() { Clear(); }
    17   CPropVariant(const PROPVARIANT& varSrc);
    18   CPropVariant(const CPropVariant& varSrc);
    19   CPropVariant(BSTR bstrSrc);
    20   CPropVariant(LPCOLESTR lpszSrc);
    21   CPropVariant(bool bSrc) { vt = VT_BOOL; boolVal = (bSrc ? VARIANT_TRUE : VARIANT_FALSE); };
    22   CPropVariant(UInt32 value) {  vt = VT_UI4; ulVal = value; }
    23   CPropVariant(UInt64 value) {  vt = VT_UI8; uhVal = *(ULARGE_INTEGER*)&value; }
    24   CPropVariant(const FILETIME &value) {  vt = VT_FILETIME; filetime = value; }
    25   CPropVariant(Int32 value) { vt = VT_I4; lVal = value; }
    26   CPropVariant(Byte value) { vt = VT_UI1; bVal = value; }
    27   CPropVariant(Int16 value) { vt = VT_I2; iVal = value; }
    28   // CPropVariant(LONG value, VARTYPE vtSrc = VT_I4) { vt = vtSrc; lVal = value; }
    30   CPropVariant& operator=(const CPropVariant& varSrc);
    31   CPropVariant& operator=(const PROPVARIANT& varSrc);
    32   CPropVariant& operator=(BSTR bstrSrc);
    33   CPropVariant& operator=(LPCOLESTR lpszSrc);
    34   CPropVariant& operator=(bool bSrc);
    35   CPropVariant& operator=(UInt32 value);
    36   CPropVariant& operator=(UInt64 value);
    37   CPropVariant& operator=(const FILETIME &value);
    39   CPropVariant& operator=(Int32 value);
    40   CPropVariant& operator=(Byte value);
    41   CPropVariant& operator=(Int16 value);
    42   // CPropVariant& operator=(LONG  value);
    44   HRESULT Clear();
    45   HRESULT Copy(const PROPVARIANT* pSrc);
    46   HRESULT Attach(PROPVARIANT* pSrc);
    47   HRESULT Detach(PROPVARIANT* pDest);
    49   HRESULT InternalClear();
    50   void InternalCopy(const PROPVARIANT* pSrc);
    52   int Compare(const CPropVariant &a1);
    53 };
    55 }}
    57 #endif

mercurial