+bool wxVariantDataBool::Read(wxInputStream& str)
+{
+ wxTextInputStream s(str);
+
+ m_value = s.Read8() != 0;
+ return true;
+}
+#endif // wxUSE_STREAMS
+
+bool wxVariantDataBool::Read(wxString& str)
+{
+ m_value = (wxAtol(str) != 0);
+ return true;
+}
+
+// wxVariant ****
+
+wxVariant::wxVariant(bool val, const wxString& name)
+{
+ m_data = new wxVariantDataBool(val);
+ m_name = name;
+}
+
+bool wxVariant::operator== (bool value) const
+{
+ bool thisValue;
+ if (!Convert(&thisValue))
+ return false;
+ else
+ return (value == thisValue);
+}
+
+bool wxVariant::operator!= (bool value) const
+{
+ return (!((*this) == value));
+}
+
+void wxVariant::operator= (bool value)
+{
+ if (GetType() == wxT("bool") &&
+ m_data->GetRefCount() == 1)
+ {
+ ((wxVariantDataBool*)GetData())->SetValue(value);
+ }
+ else
+ {
+ UnRef();
+ m_data = new wxVariantDataBool(value);
+ }
+}
+
+bool wxVariant::GetBool() const
+{
+ bool value;
+ if (Convert(& value))
+ return value;
+ else
+ {
+ wxFAIL_MSG(wxT("Could not convert to a bool"));
+ return 0;
+ }
+}
+
+// -----------------------------------------------------------------
+// wxVariantDataChar
+// -----------------------------------------------------------------
+
+class WXDLLIMPEXP_BASE wxVariantDataChar: public wxVariantData
+{
+public:
+ wxVariantDataChar() { m_value = 0; }
+ wxVariantDataChar(const wxUniChar& value) { m_value = value; }
+
+ inline wxUniChar GetValue() const { return m_value; }
+ inline void SetValue(const wxUniChar& value) { m_value = value; }
+
+ virtual bool Eq(wxVariantData& data) const;
+#if wxUSE_STD_IOSTREAM
+ virtual bool Read(wxSTD istream& str);
+ virtual bool Write(wxSTD ostream& str) const;
+#endif
+ virtual bool Read(wxString& str);
+ virtual bool Write(wxString& str) const;
+#if wxUSE_STREAMS
+ virtual bool Read(wxInputStream& str);
+ virtual bool Write(wxOutputStream& str) const;
+#endif // wxUSE_STREAMS
+ virtual wxString GetType() const { return wxT("char"); }
+ wxVariantData* Clone() const { return new wxVariantDataChar(m_value); }
+
+protected:
+ wxUniChar m_value;
+};
+