]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/datetime.h
Remove deprecated methods
[wxWidgets.git] / include / wx / datetime.h
index c648073ed8f888d3f7a4005ac805c944c5c86b07..3fddea3f9a10f6025349fc2a839d3632d6200d80 100644 (file)
 
 #if wxUSE_DATETIME
 
-#ifndef __WXWINCE__
-#include <time.h>
-#else
-#include "wx/msw/wince/time.h"
-#endif
+#ifdef __WXWINCE__
+    #include "wx/msw/wince/time.h"
+#elif !defined(__WXPALMOS5__)
+    #include <time.h>
+#endif // OS
 
 #include <limits.h>             // for INT_MIN
 
@@ -30,6 +30,9 @@
 class WXDLLIMPEXP_FWD_BASE wxDateTime;
 class WXDLLIMPEXP_FWD_BASE wxTimeSpan;
 class WXDLLIMPEXP_FWD_BASE wxDateSpan;
+#ifdef __WXMSW__
+struct _SYSTEMTIME;
+#endif
 
 #include "wx/dynarray.h"
 
@@ -598,6 +601,12 @@ public:
                       wxDateTime_t minute = 0,
                       wxDateTime_t second = 0,
                       wxDateTime_t millisec = 0);
+#ifdef __WXMSW__
+    wxDateTime(const struct _SYSTEMTIME& st)
+    {
+        SetFromMSWSysTime(st);
+    }
+#endif
 
         // default copy ctor ok
 
@@ -912,6 +921,17 @@ public:
         // pack the date in DOS format
     unsigned long GetAsDOS() const;
 
+    // SYSTEMTIME format
+    // ------------------------------------------------------------------------
+#ifdef __WXMSW__
+
+    // convert SYSTEMTIME to wxDateTime
+    wxDateTime& SetFromMSWSysTime(const struct _SYSTEMTIME&);
+
+    // convert wxDateTime to SYSTEMTIME
+    void GetAsMSWSysTime(struct _SYSTEMTIME*) const;
+#endif // __WXMSW__
+
     // comparison (see also functions below for operator versions)
     // ------------------------------------------------------------------------
 
@@ -1128,21 +1148,21 @@ public:
         // provide compatibility overloads for them
     bool ParseISODate(const wxString& date)
     {
-        const wxStringCharType *p = ParseFormat(date, wxS("%Y-%m-%d"));
-        return p && !*p;
+        wxString::const_iterator end;
+        return ParseFormat(date, wxS("%Y-%m-%d"), &end) && end == date.end();
     }
 
-    bool ParseISOTime(const wxString& date)
+    bool ParseISOTime(const wxString& time)
     {
-        const wxStringCharType *p = ParseFormat(date, wxS("%H:%M:%S"));
-        return p && !*p;
+        wxString::const_iterator end;
+        return ParseFormat(time, wxS("%H:%M:%S"), &end) && end == time.end();
     }
 
-    bool ParseISOCombined(const wxString& date, char sep = 'T')
+    bool ParseISOCombined(const wxString& datetime, char sep = 'T')
     {
+        wxString::const_iterator end;
         const wxString fmt = wxS("%Y-%m-%d") + wxString(sep) + wxS("%H:%M:%S");
-        const wxStringCharType *p = ParseFormat(date, fmt.wx_str());
-        return p && !*p;
+        return ParseFormat(datetime, fmt, &end) && end == datetime.end();
     }
 
         // parse a string containing the date/time in "free" format, this