userver
C++ Async Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
timestamp.cpp
1
#
include
<
userver
/
proto
-
structs
/
timestamp
.
hpp
>
2
3
#
include
<
fmt
/
chrono
.
h
>
4
#
include
<
fmt
/
format
.
h
>
5
6
#
include
<
userver
/
proto
-
structs
/
exceptions
.
hpp
>
7
#
include
<
userver
/
utils
/
impl
/
internal_tag
.
hpp
>
8
9
USERVER_NAMESPACE_BEGIN
10
11
namespace
proto_structs {
12
13
Timestamp::Timestamp(utils::impl::InternalTag, std::int64_t seconds, std::int32_t nanos)
14
: Timestamp(std::chrono::seconds{seconds}, std::chrono::nanoseconds{nanos})
15
{}
16
17
void
Timestamp::ThrowError(
const
std::chrono::seconds& seconds,
const
std::chrono::nanoseconds& nanos) {
18
throw
ValueError(fmt::format(
"Timestamp '{}s.{}ns' is invalid or out of range"
, seconds.count(), nanos.count()));
19
}
20
21
void
Timestamp::ThrowError(
const
char
* reason) {
throw
ValueError(reason); }
22
23
}
// namespace proto_structs
24
25
USERVER_NAMESPACE_END
proto-structs
src
proto-structs
timestamp.cpp
Generated on
for userver by
Doxygen
1.17.0