+ const char *ParseRfc822Date(const wxString& date,
+ wxString::const_iterator *end = NULL);
+ const char *ParseRfc822Date(const wxCStrData& date,
+ wxString::const_iterator *end = NULL)
+ {
+ return ParseRfc822Date(date.AsString(), end);
+ }
+
+ const wchar_t *ParseRfc822Date(const wchar_t* date)
+ {
+ return ReturnEndAsWidePtr(&wxDateTime::ParseRfc822Date, date);
+ }
+
+ const char *ParseRfc822Date(const char* date)
+ {
+ return ParseRfc822Date(wxString(date));
+ }
+
+ // parse a date/time in the given format (see strptime(3)), fill in
+ // the missing (in the string) fields with the values of dateDef (by
+ // default, they will not change if they had valid values or will
+ // default to Today() otherwise)
+ const char *ParseFormat(const wxString& date,
+ const wxString& format = wxDefaultDateTimeFormat,
+ const wxDateTime& dateDef = wxDefaultDateTime,
+ wxString::const_iterator *end = NULL);
+
+ const char *ParseFormat(const wxString& date,
+ const char *format = wxDefaultDateTimeFormat,
+ const wxDateTime& dateDef = wxDefaultDateTime,
+ wxString::const_iterator *end = NULL)
+ {
+ return ParseFormat(date, wxString(format), dateDef, end);
+ }
+
+ const char *ParseFormat(const wxString& date,
+ const wxString& format = wxDefaultDateTimeFormat,
+ wxString::const_iterator *end = NULL)
+ {
+ return ParseFormat(date, format, wxDefaultDateTime, end);
+ }
+
+ const char *ParseFormat(const wxCStrData& date,
+ const wxString& format = wxDefaultDateTimeFormat,
+ const wxDateTime& dateDef = wxDefaultDateTime,
+ wxString::const_iterator *end = NULL)
+ {
+ return ParseFormat(date.AsString(), format, dateDef, end);
+ }
+
+ const wchar_t *ParseFormat(const wchar_t *date,
+ const wxString& format = wxDefaultDateTimeFormat,
+ const wxDateTime& dateDef = wxDefaultDateTime)
+ {
+ const wxString datestr(date);
+ wxString::const_iterator end;
+ if ( !ParseFormat(datestr, format, dateDef, &end) )
+ return NULL;
+
+ return date + (end - datestr.begin());
+ }
+
+ const char *ParseFormat(const char *date,
+ const wxString& format = "%c",
+ const wxDateTime& dateDef = wxDefaultDateTime)
+ {
+ return ParseFormat(wxString(date), format, dateDef);
+ }
+
+ const char *ParseFormat(const char *date,
+ const char *format = wxDefaultDateTimeFormat,
+ const wxDateTime& dateDef = wxDefaultDateTime)
+ {
+ return ParseFormat(wxString(date), wxString(format), dateDef);
+ }
+
+ // parse a string containing date, time or both in ISO 8601 format
+ //
+ // notice that these functions are new in wx 3.0 and so we don't
+ // provide compatibility overloads for them
+ bool ParseISODate(const wxString& date)
+ {
+ wxString::const_iterator end;
+ return ParseFormat(date, wxS("%Y-%m-%d"), &end) && end == date.end();
+ }
+
+ bool ParseISOTime(const wxString& time)
+ {
+ wxString::const_iterator end;
+ return ParseFormat(time, wxS("%H:%M:%S"), &end) && end == time.end();
+ }
+
+ 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");
+ return ParseFormat(datetime, fmt, &end) && end == datetime.end();
+ }
+