+bool wxVariantDataVoidPtr::Read(wxString& WXUNUSED(str))
+{
+ // Not implemented
+ return false;
+}
+
+// wxVariant
+
+wxVariant::wxVariant( void* val, const wxString& name)
+{
+ m_refData = new wxVariantDataVoidPtr(val);
+ m_name = name;
+}
+
+bool wxVariant::operator== (void* value) const
+{
+ return (value == ((wxVariantDataVoidPtr*)GetData())->GetValue());
+}
+
+bool wxVariant::operator!= (void* value) const
+{
+ return (!((*this) == (void*) value));
+}
+
+void wxVariant::operator= (void* value)
+{
+ if (GetType() == wxT("void*") && (m_refData->GetRefCount() == 1))
+ {
+ ((wxVariantDataVoidPtr*)GetData())->SetValue(value);
+ }
+ else
+ {
+ UnRef();
+ m_refData = new wxVariantDataVoidPtr(value);
+ }
+}
+
+void* wxVariant::GetVoidPtr() const
+{
+ // handling this specially is convenient when working with COM, see #9873
+ if ( IsNull() )
+ return NULL;
+
+ wxASSERT( GetType() == wxT("void*") );
+
+ return (void*) ((wxVariantDataVoidPtr*) m_refData)->GetValue();
+}
+
+// ----------------------------------------------------------------------------
+// wxVariantDataDateTime
+// ----------------------------------------------------------------------------
+
+#if wxUSE_DATETIME
+
+class wxVariantDataDateTime: public wxVariantData
+{
+public:
+ wxVariantDataDateTime() { }
+ wxVariantDataDateTime(const wxDateTime& value) { m_value = value; }
+
+ inline wxDateTime GetValue() const { return m_value; }
+ inline void SetValue(const wxDateTime& value) { m_value = value; }
+
+ virtual bool Eq(wxVariantData& data) const;
+#if wxUSE_STD_IOSTREAM
+ virtual bool Write(wxSTD ostream& str) const;
+#endif
+ virtual bool Write(wxString& str) const;
+#if wxUSE_STD_IOSTREAM
+ virtual bool Read(wxSTD istream& str);
+#endif
+ virtual bool Read(wxString& str);
+ virtual wxString GetType() const { return wxT("datetime"); }
+ virtual wxVariantData* Clone() const { return new wxVariantDataDateTime(m_value); }
+
+ DECLARE_WXANY_CONVERSION()
+protected:
+ wxDateTime m_value;
+};
+
+IMPLEMENT_TRIVIAL_WXANY_CONVERSION(wxDateTime, wxVariantDataDateTime)