// Created: 10/09/98
// RCS-ID: $Id$
// Copyright: (c)
-// Licence: wxWindows licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
#include "wx/wxprec.h"
#ifdef __BORLANDC__
-#pragma hdrstop
+ #pragma hdrstop
#endif
#if wxUSE_IOSTREAMH
# include <fstream.h>
#else
# include <fstream>
-# ifdef _MSC_VER
- using namespace std;
-# endif
#endif
#include "wx/stream.h"
virtual void Copy(wxVariantData& data);
virtual bool Eq(wxVariantData& data) const;
- virtual bool Write(ostream& str) const;
+
+ virtual bool Read(wxString& str);
virtual bool Write(wxString& str) const;
- virtual bool Write(wxOutputStream &str) const;
virtual bool Read(istream& str);
+ virtual bool Write(ostream& str) const;
+
+#if wxUSE_STREAMS
virtual bool Read(wxInputStream& str);
- virtual bool Read(wxString& str);
+ virtual bool Write(wxOutputStream &str) const;
+#endif // wxUSE_STREAMS
+
virtual wxString GetType() const { return "long"; };
protected:
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;
}
+#if wxUSE_STREAMS
+bool wxVariantDataLong::Write(wxOutputStream& str) const
+{
+ str << m_value;
+ return TRUE;
+}
+
bool wxVariantDataLong::Read(wxInputStream& str)
{
str >> m_value;
return TRUE;
}
+#endif // wxUSE_STREAMS
bool wxVariantDataLong::Read(wxString& str)
{
virtual void Copy(wxVariantData& data);
virtual bool Eq(wxVariantData& data) const;
+ virtual bool Read(wxString& str);
virtual bool Write(ostream& str) const;
virtual bool Write(wxString& str) const;
- virtual bool Write(wxOutputStream &str) const;
virtual bool Read(istream& str);
+#if wxUSE_STREAMS
virtual bool Read(wxInputStream& str);
- virtual bool Read(wxString& str);
+ virtual bool Write(wxOutputStream &str) const;
+#endif // wxUSE_STREAMS
virtual wxString GetType() const { return "double"; };
protected:
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;
}
+#if wxUSE_STREAMS
+bool wxVariantDataReal::Write(wxOutputStream& str) const
+{
+ str << m_value;
+ return TRUE;
+}
+
bool wxVariantDataReal::Read(wxInputStream& str)
{
str >> (float&)m_value;
return TRUE;
}
+#endif // wxUSE_STREAMS
bool wxVariantDataReal::Read(wxString& 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(wxString& str);
virtual bool Read(istream& str);
+#if wxUSE_STREAMS
virtual bool Read(wxInputStream& str);
- virtual bool Read(wxString& str);
+ virtual bool Write(wxOutputStream& str) const;
+#endif // wxUSE_STREAMS
virtual wxString GetType() const { return "bool"; };
protected:
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;
}
+#if wxUSE_STREAMS
+bool wxVariantDataBool::Write(wxOutputStream& str) const
+{
+ str << (char)m_value;
+ return TRUE;
+}
+
bool wxVariantDataBool::Read(wxInputStream& str)
{
str >> (char&)m_value;
return TRUE;
}
+#endif // wxUSE_STREAMS
bool wxVariantDataBool::Read(wxString& str)
{
virtual void Copy(wxVariantData& data);
virtual bool Eq(wxVariantData& data) const;
+ virtual bool Read(istream& str);
virtual bool Write(ostream& str) const;
- virtual bool Write(wxOutputStream& str) const;
+ virtual bool Read(wxString& str);
virtual bool Write(wxString& str) const;
- virtual bool Read(istream& str);
+#if wxUSE_STREAMS
virtual bool Read(wxInputStream& str);
- virtual bool Read(wxString& str);
+ virtual bool Write(wxOutputStream& str) const;
+#endif // wxUSE_STREAMS
virtual wxString GetType() const { return "char"; };
protected:
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;
}
+#if wxUSE_STREAMS
+bool wxVariantDataChar::Write(wxOutputStream& str) const
+{
+ str << m_value;
+ return TRUE;
+}
+
bool wxVariantDataChar::Read(wxInputStream& str)
{
str >> m_value;
return TRUE;
}
+#endif // wxUSE_STREAMS
bool wxVariantDataChar::Read(wxString& 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 Read(wxString& str);
virtual bool Write(wxString& str) const;
virtual bool Read(istream& str);
+#if wxUSE_STREAMS
virtual bool Read(wxInputStream& str);
- virtual bool Read(wxString& str);
+ virtual bool Write(wxOutputStream& str) const;
+#endif // wxUSE_STREAMS
virtual wxString GetType() const { return "string"; };
protected:
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;
}
+#if wxUSE_STREAMS
+bool wxVariantDataString::Write(wxOutputStream& str) const
+{
+ str << (const char*) m_value;
+ return TRUE;
+}
+
bool wxVariantDataString::Read(wxInputStream& str)
{
str >> m_value;
return TRUE;
}
+#endif // wxUSE_STREAMS
bool wxVariantDataString::Read(wxString& str)
{