From c1d6d0f9e831c2e63e58cfd4c2cad3259ee4c8e3 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Thu, 21 Aug 2003 06:30:19 +0000 Subject: [PATCH] added wxDateTime to the streamable custom types git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23059 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/xti.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/common/xti.cpp b/src/common/xti.cpp index c3b5bef7d2..499db37639 100644 --- a/src/common/xti.cpp +++ b/src/common/xti.cpp @@ -30,6 +30,7 @@ #include "wx/tokenzr.h" #include "wx/notebook.h" #include "wx/list.h" +#include "wx/datetime.h" #include #if wxUSE_EXTENDED_RTTI @@ -290,6 +291,21 @@ template<> void wxStringWriteValue(wxString & , wxSize * const & ) WX_CUSTOM_TYPE_INFO(wxSize) +template<> void wxStringReadValue(const wxString &s , wxDateTime &data ) +{ + data.ParseFormat(s,wxT("%Y-%m-%d %H:%M:%S")) ; +} + +template<> void wxStringWriteValue(wxString &s , const wxDateTime &data ) +{ + s = data.Format(wxT("%Y-%m-%d %H:%M:%S")) ; +} + +WX_CUSTOM_TYPE_INFO(wxDateTime) + +// +// built-ins +// template<> const wxTypeInfo* wxGetTypeInfo( void * ) { -- 2.45.2