FOSSredder 0.5.0
Loading...
Searching...
No Matches
Year.h
Go to the documentation of this file.
1
5
6#pragma once
7
8namespace core::domain {
9
10class Year {
11public:
12 int value() const noexcept;
13
14 Year() = default;
19 explicit Year(int value);
20
25 static constexpr int minValue() noexcept;
30 static constexpr int maxValue() noexcept;
31
37 static bool isValid(int value) noexcept;
38
44 static int normalize(int value) noexcept;
45
50 bool empty() const noexcept;
51
52private:
53 int value_ = 0;
54};
55
56} // namespace core::domain
bool empty() const noexcept
Checks whether the stored value is empty.
Definition Year.cpp:38
static bool isValid(int value) noexcept
Checks whether a raw year is valid.
Definition Year.cpp:30
static constexpr int maxValue() noexcept
Returns the maximum supported year.
Definition Year.cpp:26
static constexpr int minValue() noexcept
Returns the minimum supported year.
Definition Year.cpp:22
int value() const noexcept
Definition Year.cpp:20
static int normalize(int value) noexcept
Normalizes a raw year value.
Definition Year.cpp:34