]> git.saurik.com Git - wxWidgets.git/commitdiff
Added wxVariant's =, == and != operators for wxObject*
authorRobert Roebling <robert@roebling.de>
Tue, 26 Sep 2006 21:08:23 +0000 (21:08 +0000)
committerRobert Roebling <robert@roebling.de>
Tue, 26 Sep 2006 21:08:23 +0000 (21:08 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41472 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/latex/wx/variant.tex
include/wx/variant.h
src/common/variant.cpp

index 5f233fc1f1f48ef3fdac348161493f63dcc566d1..eecefc84b4ddd5f29219fe2eec14590ff829c7c8 100644 (file)
@@ -306,6 +306,8 @@ Sets the internal variant data, deleting the existing data if there is any.
 
 \func{void}{operator $=$}{\param{void* }{value}}
 
+\func{void}{operator $=$}{\param{wxObject* }{value}}
+
 \func{void}{operator $=$}{\param{const wxList\& }{value}}
 
 \func{void}{operator $=$}{\param{const wxDateTime\& }{value}}
@@ -338,6 +340,8 @@ Assignment operators.
 
 \constfunc{bool}{operator $==$}{\param{void* }{value}}
 
+\constfunc{bool}{operator $==$}{\param{wxObject* }{value}}
+
 \constfunc{bool}{operator $==$}{\param{const wxList\& }{value}}
 
 \constfunc{bool}{operator $==$}{\param{const wxArrayString\& }{value}}
@@ -364,6 +368,8 @@ Equality test operators.
 
 \constfunc{bool}{operator $!=$}{\param{void* }{value}}
 
+\constfunc{bool}{operator $!=$}{\param{wxObject* }{value}}
+
 \constfunc{bool}{operator $!=$}{\param{const wxList\& }{value}}
 
 \constfunc{bool}{operator $!=$}{\param{const wxArrayString\& }{value}}
index 9388e4b6d816e018c101c709d2236323a03126c0..2086ee38676904e3ae0b7ac0634f586d396a75ee 100644 (file)
@@ -168,7 +168,11 @@ public:
     void operator= (const wxList& value) ;
     bool operator== (void* value) const;
     bool operator!= (void* value) const;
-    void operator= (void* value) ;
+    void operator= (void* value);
+    bool operator== (wxObject* value) const;
+    bool operator!= (wxObject* value) const;
+    void operator= (wxObject* value);
+    
 
     // Treat a list variant as an array
     wxVariant operator[] (size_t idx) const;
index 2ebfcff9d82cb5a3b56c488ed178cd47c5560120..b17b2c1f667ffde06fbb09e6c1ba70f530a8b89b 100644 (file)
@@ -1628,6 +1628,23 @@ void wxVariant::operator= (void* value)
     }
 }
 
+bool wxVariant::operator== (wxObject* value) const
+{
+    return (value == ((wxVariantDataWxObjectPtr*)GetData())->GetValue());
+}
+
+bool wxVariant::operator!= (wxObject* value) const
+{
+    return (!((*this) == (void*) value));
+}
+
+void wxVariant::operator= (wxObject* value)
+{
+    if (m_data)
+        delete m_data;
+    m_data = new wxVariantDataWxObjectPtr(value);
+}
+
 #if wxUSE_DATETIME
 bool wxVariant::operator== (const wxDateTime& value) const
 {