userver
C++ Async Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
time_of_day.cpp
1
#
include
<
userver
/
proto
-
structs
/
time_of_day
.
hpp
>
2
3
#
include
<
fmt
/
format
.
h
>
4
5
#
include
<
userver
/
proto
-
structs
/
exceptions
.
hpp
>
6
#
include
<
userver
/
utils
/
impl
/
internal_tag
.
hpp
>
7
8
USERVER_NAMESPACE_BEGIN
9
10
namespace
proto_structs {
11
12
TimeOfDay::TimeOfDay(
13
::utils::impl::InternalTag,
14
std::int32_t hours,
15
std::int32_t minutes,
16
std::int32_t seconds,
17
std::int32_t nanos
18
)
19
: TimeOfDay(
20
std::chrono::hours{hours},
21
std::chrono::minutes{minutes},
22
std::chrono::seconds{seconds},
23
std::chrono::nanoseconds{nanos}
24
)
25
{}
26
27
void
TimeOfDay::ThrowError(
28
const
std::chrono::hours& hours,
29
const
std::chrono::minutes& minutes,
30
const
std::chrono::seconds& seconds,
31
const
std::chrono::nanoseconds& nanos
32
) {
33
throw
ValueError(fmt::format(
34
"Time of the day '{}:{}:{}.{}ns' is invalid or out of range"
,
35
hours.count(),
36
minutes.count(),
37
seconds.count(),
38
nanos.count()
39
));
40
}
41
42
void
TimeOfDay::ThrowError(
const
char
* reason) {
throw
ValueError(reason); }
43
44
}
// namespace proto_structs
45
46
USERVER_NAMESPACE_END
proto-structs
src
proto-structs
time_of_day.cpp
Generated on
for userver by
Doxygen
1.17.0