From 2b3691508f70040393f2f4169e0c245b5ac14672 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 26 Sep 2015 11:39:45 -0400 Subject: [PATCH] ISO8601: Prepared ::parse method for its new role of parsing all dates --- src/ISO8601.cpp | 5 ++++- src/ISO8601.h | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ISO8601.cpp b/src/ISO8601.cpp index 6b4b16559..d5d9a6dbf 100644 --- a/src/ISO8601.cpp +++ b/src/ISO8601.cpp @@ -167,7 +167,10 @@ ISO8601d::operator time_t () const // | 'R' [n] '/' datetime '/' datetime # start end // ; // -bool ISO8601d::parse (const std::string& input, std::string::size_type& start) +bool ISO8601d::parse ( + const std::string& input, + std::string::size_type& start, + const std::string& format /* = "" */) { auto i = start; Nibbler n (input.substr (i)); diff --git a/src/ISO8601.h b/src/ISO8601.h index 9a6b60e79..9c41c81e1 100644 --- a/src/ISO8601.h +++ b/src/ISO8601.h @@ -23,6 +23,7 @@ // http://www.opensource.org/licenses/mit-license.php // //////////////////////////////////////////////////////////////////////////////// + #ifndef INCLUDED_ISO8601 #define INCLUDED_ISO8601 @@ -38,7 +39,7 @@ public: ISO8601d (const ISO8601d&); // Unimplemented ISO8601d& operator= (const ISO8601d&); // Unimplemented operator time_t () const; - bool parse (const std::string&, std::string::size_type&); + bool parse (const std::string&, std::string::size_type&, const std::string& format = ""); void clear (); private: