Skip to content

Commit

Permalink
libcore|Date: Parsing from text
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Feb 1, 2016
1 parent 0e62ea3 commit b105974
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion doomsday/sdk/libcore/include/de/data/date.h
Expand Up @@ -14,7 +14,7 @@
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this program; if not, see:
* http://www.gnu.org/licenses</small>
* http://www.gnu.org/licenses</small>
*/

#ifndef LIBDENG2_DATE_H
Expand Down Expand Up @@ -66,6 +66,8 @@ class DENG2_PUBLIC Date : public Time, public LogEntry::Arg::Base
LogEntry::Arg::Type logEntryArgType() const {
return LogEntry::Arg::StringArgument;
}

static Date fromText(String const &text);
};

DENG2_PUBLIC QTextStream &operator << (QTextStream &os, Date const &date);
Expand Down
7 changes: 6 additions & 1 deletion doomsday/sdk/libcore/src/data/date.cpp
Expand Up @@ -14,7 +14,7 @@
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this program; if not, see:
* http://www.gnu.org/licenses</small>
* http://www.gnu.org/licenses</small>
*/

#include "de/Date"
Expand All @@ -32,6 +32,11 @@ Time Date::asTime() const
return *this;
}

Date Date::fromText(String const &text)
{
return Time::fromText(text, ISODateOnly);
}

String Date::asText() const
{
String result;
Expand Down

0 comments on commit b105974

Please sign in to comment.