+ str << (const char*) s.mb_str();
+ return true;
+}
+#endif
+
+bool wxVariantDataBool::Write(wxString& str) const
+{
+ str.Printf(wxT("%d"), (int) m_value);
+ return true;
+}
+
+#if wxUSE_STD_IOSTREAM
+bool wxVariantDataBool::Read(wxSTD istream& WXUNUSED(str))
+{
+ wxFAIL_MSG(wxT("Unimplemented"));
+// str >> (long) m_value;
+ return false;
+}
+#endif
+
+#if wxUSE_STREAMS
+bool wxVariantDataBool::Write(wxOutputStream& str) const
+{
+ wxTextOutputStream s(str);
+
+ s.Write8(m_value);
+ return true;
+}
+
+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;
+ }
+}
+
+#endif // HAVE_BOOL
+
+// -----------------------------------------------------------------
+// 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;
+};
+
+bool wxVariantDataChar::Eq(wxVariantData& data) const
+{
+ wxASSERT_MSG( (data.GetType() == wxT("char")), wxT("wxVariantDataChar::Eq: argument mismatch") );
+
+ wxVariantDataChar& otherData = (wxVariantDataChar&) data;
+
+ return (otherData.m_value == m_value);
+}
+
+#if wxUSE_STD_IOSTREAM
+bool wxVariantDataChar::Write(wxSTD ostream& str) const
+{
+ str << wxString(m_value);
+ return true;