-DECLARE_DYNAMIC_CLASS(wxVariantDataChar)
-public:
- wxVariantDataChar() { m_value = 0; }
- wxVariantDataChar(char value) { m_value = value; }
-
- inline char GetValue() const { return m_value; }
- inline void SetValue(char value) { m_value = value; }
-
- virtual void Copy(wxVariantData& data);
- virtual bool Eq(wxVariantData& data) const;
- virtual bool Read(istream& str);
- virtual bool Write(ostream& str) const;
- 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 "char"; };
-
-protected:
- char m_value;
-};
-
-IMPLEMENT_DYNAMIC_CLASS(wxVariantDataChar, wxVariantData)
-
-void wxVariantDataChar::Copy(wxVariantData& data)
-{
- wxASSERT_MSG( (data.GetType() == "char"), "wxVariantDataChar::Copy: Can't copy to this type of data" );
-
- wxVariantDataChar& otherData = (wxVariantDataChar&) data;
-
- otherData.m_value = m_value;
-}
-
-bool wxVariantDataChar::Eq(wxVariantData& data) const
-{
- wxASSERT_MSG( (data.GetType() == "char"), "wxVariantDataChar::Eq: argument mismatch" );
-
- wxVariantDataChar& otherData = (wxVariantDataChar&) data;
-
- return (otherData.m_value == m_value);
-}
-
-bool wxVariantDataChar::Write(ostream& str) const
-{
- wxString s;
- Write(s);
- str << (const char*) s;
- return TRUE;