#ifdef __GNUG__
#pragma implementation "variant.h"
+#pragma implementation "time.h"
+#pragma implementation "date.h"
#endif
// For compilers that support precompilation, includes "wx/wx.h".
#pragma hdrstop
#endif
-#if wxUSE_IOSTREAMH && wxUSE_STD_IOSTREAM
-# include <fstream.h>
-#else
-# include <fstream>
+#if wxUSE_STD_IOSTREAM
+ #if wxUSE_IOSTREAMH
+ #include <fstream.h>
+ #else
+ #include <fstream>
+ #endif
#endif
#if wxUSE_STREAMS
#include "wx/string.h"
#include "wx/variant.h"
+#if wxUSE_TIMEDATE
+IMPLEMENT_DYNAMIC_CLASS(wxDate, wxObject)
+IMPLEMENT_DYNAMIC_CLASS(wxTime, wxObject)
+
+wxTime::tFormat wxTime::ms_Format = wxTime::wx12h;
+wxTime::tPrecision wxTime::ms_Precision = wxTime::wxStdMinSec;
+wxChar wxTime::ms_bufTime[128];
+#endif
+
IMPLEMENT_ABSTRACT_CLASS(wxVariantData, wxObject)
wxVariant WXDLLEXPORT wxNullVariant;
{
wxTextOutputStream s(str);
- s.Write32(m_value);
+ s.Write32((size_t)m_value);
return TRUE;
}
* wxVariantDataTime
*/
-#if wxUSE_TIMEDATE
+// For some reason, Watcom C++ can't link variant.cpp with time/date classes compiled
+#if wxUSE_TIMEDATE && !defined(__WATCOMC__)
class wxVariantDataTime: public wxVariantData
{
m_name = name;
}
-#if wxUSE_TIMEDATE
+// For some reason, Watcom C++ can't link variant.cpp with time/date classes compiled
+#if wxUSE_TIMEDATE && !defined(__WATCOMC__)
wxVariant::wxVariant(const wxTime& val, const wxString& name) // Time
{
m_data = new wxVariantDataTime(val);
wxString thisValue;
if (!Convert(&thisValue))
return FALSE;
- else
- return (value == thisValue);
+
+ return value == thisValue;
}
bool wxVariant::operator!= (const wxString& value) const
}
}
-#if wxUSE_TIMEDATE
+// For some reason, Watcom C++ can't link variant.cpp with time/date classes compiled
+#if wxUSE_TIMEDATE && !defined(__WATCOMC__)
bool wxVariant::operator== (const wxTime& value) const
{
wxTime thisValue;
if (!Convert(&thisValue))
return FALSE;
- else
- return (value == thisValue);
+
+ return value == thisValue;
}
bool wxVariant::operator!= (const wxTime& value) const
wxDate thisValue;
if (!Convert(&thisValue))
return FALSE;
- else
- return (value == thisValue);
+
+ return (value == thisValue);
}
bool wxVariant::operator!= (const wxDate& value) const
bool wxVariant::operator!= (void* value) const
{
- return (!((*this) == value));
+ return (!((*this) == (void*) value));
}
void wxVariant::operator= (void* value)
wxString wxVariant::GetString() const
{
wxString value;
- if (Convert(& value))
- return value;
- else
+ if (!Convert(& value))
{
wxFAIL_MSG(wxT("Could not convert to a string"));
- return wxString("");
}
+
+ return value;
}
-#if wxUSE_TIMEDATE
+// For some reason, Watcom C++ can't link variant.cpp with time/date classes compiled
+#if wxUSE_TIMEDATE && !defined(__WATCOMC__)
wxTime wxVariant::GetTime() const
{
wxTime value;
- if (Convert(& value))
- return value;
- else
+ if (!Convert(& value))
{
wxFAIL_MSG(wxT("Could not convert to a time"));
- return wxTime();
}
+
+ return value;
}
wxDate wxVariant::GetDate() const
{
wxDate value;
- if (Convert(& value))
- return value;
- else
+ if (!Convert(& value))
{
wxFAIL_MSG(wxT("Could not convert to a date"));
- return wxDate();
}
+
+ return value;
}
-#endif
+#endif // wxUSE_TIMEDATE
void* wxVariant::GetVoidPtr() const
{
return TRUE;
}
-#if wxUSE_TIMEDATE
+// For some reason, Watcom C++ can't link variant.cpp with time/date classes compiled
+#if wxUSE_TIMEDATE && !defined(__WATCOMC__)
bool wxVariant::Convert(wxTime* value) const
{
wxString type(GetType());
}
#endif
// wxUSE_TIMEDATE
+