4#ifndef _Stroika_Foundation_Time_TimeOfDay_h_
5#define _Stroika_Foundation_Time_TimeOfDay_h_ 1
7#include "Stroika/Foundation/StroikaPreComp.h"
15#include "Stroika/Foundation/Common/Common.h"
17#include "Stroika/Foundation/DataExchange/ValidationStrategy.h"
18#include "Stroika/Foundation/Execution/Exceptions.h"
46namespace Stroika::Foundation::Time {
48 using Characters::String;
88 constexpr explicit TimeOfDay (uint32_t t);
90 explicit constexpr TimeOfDay (
unsigned int hour,
unsigned int minute,
unsigned int seconds = 0);
167 static optional<TimeOfDay> ParseQuietly_ (
const wstring& rep,
const String& formatPattern);
168 static optional<TimeOfDay> ParseQuietly_ (
const wstring& rep,
const time_get<wchar_t>& tmget,
const String& formatPattern);
184 class FormatException;
195 nonvirtual
void ClearSecondsField ();
201 nonvirtual
constexpr uint8_t
GetHours ()
const;
207 nonvirtual
constexpr uint8_t
GetMinutes ()
const;
213 nonvirtual
constexpr uint8_t
GetSeconds ()
const;
225 eCurrentLocale_WithZerosStripped,
227 eDEFAULT = eCurrentLocale_WithZerosStripped,
233 using NonStandardPrintFormat::eCurrentLocale_WithZerosStripped;
250 constexpr strong_ordering operator<=> (
const TimeOfDay& rhs)
const =
default;
269 static const FormatException kThe;
271 static_assert (totally_ordered<TimeOfDay>);
273 inline const TimeOfDay::FormatException TimeOfDay::FormatException::kThe;
283 kLocaleStandardFormat,
284 kLocaleStandardAlternateFormat,
307#include "TimeOfDay.inl"
#define Stroika_Define_Enum_Bounds(FIRST_ITEM, LAST_ITEM)
String is like std::u32string, except it is much easier to use, often much more space efficient,...
static constexpr uint32_t kMaxSecondsPerDay
static constexpr string_view kISO8601Format
nonvirtual constexpr uint32_t GetAsSecondsCount() const
nonvirtual constexpr uint8_t GetMinutes() const
static constexpr string_view kLocaleStandardFormat
static const Traversal::Iterable< String > kDefaultParseFormats
nonvirtual String Format(NonStandardPrintFormat pf=NonStandardPrintFormat::eDEFAULT) const
nonvirtual constexpr uint8_t GetHours() const
nonvirtual String ToString() const
static const TimeOfDay kMin
nonvirtual constexpr uint8_t GetSeconds() const
static TimeOfDay Parse(const String &rep, const locale &l=locale{})
static const TimeOfDay kMax
static optional< TimeOfDay > ParseQuietly(const String &rep, const String &formatPattern)
like Parse(), but returns nullopt on parse error, not throwing exception. if locale is missing,...
constexpr TimeOfDay(TimeOfDay &&src) noexcept=default
static constexpr string_view kLocaleStandardAlternateFormat
NonStandardPrintFormat
NonStandardPrintFormat is a representation which a TimeOfDay can be transformed into.
Iterable<T> is a base class for containers which easily produce an Iterator<T> to traverse them.