]> git.saurik.com Git - wxWidgets.git/commitdiff
added wxDateTime to the streamable custom types
authorStefan Csomor <csomor@advancedconcepts.ch>
Thu, 21 Aug 2003 06:30:19 +0000 (06:30 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Thu, 21 Aug 2003 06:30:19 +0000 (06:30 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23059 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/xti.cpp

index c3b5bef7d2bc081d04fd6c17855dc8485665320a..499db37639415981ad7837d638fbe36772b07dd3 100644 (file)
@@ -30,6 +30,7 @@
 #include "wx/tokenzr.h"
 #include "wx/notebook.h"
 #include "wx/list.h"
+#include "wx/datetime.h"
 #include <string.h>
 
 #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 * )
 {