From ca695fa6e1469e2b72257b40d2f2ab933c034e88 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Thu, 12 Sep 2013 22:15:04 -0700 Subject: [PATCH] Add Time::isNull() --- modules/beast_core/time/beast_Time.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/modules/beast_core/time/beast_Time.h b/modules/beast_core/time/beast_Time.h index 037f18092..9628333f8 100644 --- a/modules/beast_core/time/beast_Time.h +++ b/modules/beast_core/time/beast_Time.h @@ -97,6 +97,21 @@ public: */ static Time BEAST_CALLTYPE getCurrentTime() noexcept; + /** Returns `true` if this object represents "no time", or NULL. + Internally we check for milliseconds since Epoch equal to zero. + */ + /** @{ */ + bool isNull () const noexcept + { + return millisSinceEpoch == 0; + } + + bool isNotNull () const noexcept + { + return millisSinceEpoch != 0; + } + /** @} */ + /** Returns the time as a number of milliseconds. @returns the number of milliseconds this Time object represents, since