Commit 8ff5e5af authored by andersca@apple.com's avatar andersca@apple.com

2009-01-05 Anders Carlsson <andersca@apple.com>

        Reviewed by Darin Adler, Jon Honeycutt.

        Add a templatized COMVariant constructor so we can make COMVariants out of
        everything that has a COMVariantSetter specialization.
        
        Add a COMVariantSetter specialization for COMVariant.
        
        * COMVariantSetter.h:
        (COMVariant::COMVariant):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@39629 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 6ec334c4
......@@ -118,6 +118,13 @@ public:
::VariantInit(&m_variant);
}
template<typename UnderlyingType>
COMVariant(UnderlyingType value)
{
::VariantInit(&m_variant);
COMVariantSetter<UnderlyingType>::setVariant(&m_variant, value);
}
~COMVariant()
{
::VariantClear(&m_variant);
......@@ -146,4 +153,19 @@ private:
VARIANT m_variant;
};
template<> struct COMVariantSetter<COMVariant>
{
static inline VARENUM variantType(const COMVariant& value)
{
return value.variantType();
}
static void setVariant(VARIANT* variant, const COMVariant& value)
{
ASSERT(V_VT(variant) == VT_EMPTY);
value.copyTo(variant);
}
};
#endif // COMVariantSetter
2009-01-05 Anders Carlsson <andersca@apple.com>
Reviewed by Darin Adler, Jon Honeycutt.
Add a templatized COMVariant constructor so we can make COMVariants out of
everything that has a COMVariantSetter specialization.
Add a COMVariantSetter specialization for COMVariant.
* COMVariantSetter.h:
(COMVariant::COMVariant):
2009-01-05 Brent Fulgham <bfulgham@gmail.com>
Reviewed by Oliver Hunt.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment