#pragma hdrstop
#endif
-#include <fstream.h>
+#if wxUSE_IOSTREAMH
+# include <fstream.h>
+#else
+# include <fstream>
+# ifdef _MSC_VER
+ using namespace std;
+# endif
+#endif
+#include "wx/stream.h"
#include "wx/string.h"
#include "wx/variant.h"
virtual bool Eq(wxVariantData& data) const;
virtual bool Write(ostream& str) const;
virtual bool Write(wxString& str) const;
+ virtual bool Write(wxOutputStream &str) const;
virtual bool Read(istream& str);
+ virtual bool Read(wxInputStream& str);
virtual bool Read(wxString& str);
virtual wxString GetType() const { return "long"; };
return TRUE;
}
+bool wxVariantDataLong::Write(wxOutputStream& str) const
+{
+ str << m_value;
+ return TRUE;
+}
+
bool wxVariantDataLong::Write(wxString& str) const
{
str.Printf("%ld", m_value);
return TRUE;
}
+bool wxVariantDataLong::Read(wxInputStream& str)
+{
+ str >> m_value;
+ return TRUE;
+}
+
bool wxVariantDataLong::Read(wxString& str)
{
m_value = atol((const char*) str);
virtual bool Eq(wxVariantData& data) const;
virtual bool Write(ostream& str) const;
virtual bool Write(wxString& str) const;
+ virtual bool Write(wxOutputStream &str) const;
virtual bool Read(istream& str);
+ virtual bool Read(wxInputStream& str);
virtual bool Read(wxString& str);
virtual wxString GetType() const { return "double"; };
return TRUE;
}
+bool wxVariantDataReal::Write(wxOutputStream& str) const
+{
+ str << m_value;
+ return TRUE;
+}
+
bool wxVariantDataReal::Write(wxString& str) const
{
str.Printf("%.4f", m_value);
return TRUE;
}
+bool wxVariantDataReal::Read(wxInputStream& str)
+{
+ str >> (float&)m_value;
+ return TRUE;
+}
+
bool wxVariantDataReal::Read(wxString& str)
{
m_value = atof((const char*) str);
virtual void Copy(wxVariantData& data);
virtual bool Eq(wxVariantData& data) const;
virtual bool Write(ostream& str) const;
+ virtual bool Write(wxOutputStream& str) const;
virtual bool Write(wxString& str) const;
virtual bool Read(istream& str);
+ virtual bool Read(wxInputStream& str);
virtual bool Read(wxString& str);
virtual wxString GetType() const { return "bool"; };
return TRUE;
}
+bool wxVariantDataBool::Write(wxOutputStream& str) const
+{
+ str << (char)m_value;
+ return TRUE;
+}
+
bool wxVariantDataBool::Write(wxString& str) const
{
str.Printf("%d", (int) m_value);
return FALSE;
}
+bool wxVariantDataBool::Read(wxInputStream& str)
+{
+ str >> (char&)m_value;
+ return TRUE;
+}
+
bool wxVariantDataBool::Read(wxString& str)
{
m_value = (atol((const char*) str) != 0);
virtual void Copy(wxVariantData& data);
virtual bool Eq(wxVariantData& data) const;
virtual bool Write(ostream& str) const;
+ virtual bool Write(wxOutputStream& str) const;
virtual bool Write(wxString& str) const;
virtual bool Read(istream& str);
+ virtual bool Read(wxInputStream& str);
virtual bool Read(wxString& str);
virtual wxString GetType() const { return "char"; };
return TRUE;
}
+bool wxVariantDataChar::Write(wxOutputStream& str) const
+{
+ str << m_value;
+ return TRUE;
+}
+
bool wxVariantDataChar::Write(wxString& str) const
{
str.Printf("%c", m_value);
return FALSE;
}
+bool wxVariantDataChar::Read(wxInputStream& str)
+{
+ str >> m_value;
+ return TRUE;
+}
+
bool wxVariantDataChar::Read(wxString& str)
{
m_value = str[(size_t)0];
virtual void Copy(wxVariantData& data);
virtual bool Eq(wxVariantData& data) const;
virtual bool Write(ostream& str) const;
+ virtual bool Write(wxOutputStream& str) const;
virtual bool Write(wxString& str) const;
virtual bool Read(istream& str);
+ virtual bool Read(wxInputStream& str);
virtual bool Read(wxString& str);
virtual wxString GetType() const { return "string"; };
return TRUE;
}
+bool wxVariantDataString::Write(wxOutputStream& str) const
+{
+ str << (const char*) m_value;
+ return TRUE;
+}
+
bool wxVariantDataString::Write(wxString& str) const
{
str = m_value;
return TRUE;
}
+bool wxVariantDataString::Read(wxInputStream& str)
+{
+ str >> m_value;
+ return TRUE;
+}
+
bool wxVariantDataString::Read(wxString& str)
{
m_value = str;