From 31fd2822f516337f084f85db7e369d0633113b73 Mon Sep 17 00:00:00 2001 From: Bruno de Oliveira Abinader Date: Wed, 25 Nov 2015 13:30:32 +0200 Subject: [core] Replace time_t with std::chrono::seconds Added aliases for std::chrono typedefs (eg. 'Seconds' for std::chrono::seconds). These aliases are used together with templated helper functions to replace time_t with std::chrono::seconds for most cases, in particular for 'modified' and 'expires' values in Response. --- src/mbgl/util/chrono.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/mbgl/util/chrono.cpp (limited to 'src/mbgl/util') diff --git a/src/mbgl/util/chrono.cpp b/src/mbgl/util/chrono.cpp new file mode 100644 index 0000000000..4102092a90 --- /dev/null +++ b/src/mbgl/util/chrono.cpp @@ -0,0 +1,20 @@ +#include + +namespace mbgl { + +template Duration toDuration(TimePoint); +template SystemDuration toDuration(SystemTimePoint); + +template Seconds asSeconds(Duration); +template Seconds asSeconds(Milliseconds); + +template Seconds toSeconds(TimePoint); +template Seconds toSeconds(SystemTimePoint); + +template Milliseconds asMilliseconds(Duration); +template Milliseconds asMilliseconds(Seconds); + +template Milliseconds toMilliseconds(TimePoint); +template Milliseconds toMilliseconds(SystemTimePoint); + +} -- cgit v1.2.1