userver
C++ Async Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
datetime.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
#
include
<
cstdint
>
4
5
/// @file userver/protobuf/datetime.hpp
6
/// @brief Date and time protobuf utilities.
7
8
USERVER_NAMESPACE_BEGIN
9
10
namespace
protobuf {
11
12
constexpr
inline
std::int64_t kMinDurationSeconds = -315'576'000'000LL;
13
constexpr
inline
std::int64_t kMaxDurationSeconds = 315'576'000'000LL;
14
constexpr
inline
std::int32_t kMinDurationNanos = -999'999'999;
15
constexpr
inline
std::int32_t kMaxDurationNanos = 999'999'999;
16
constexpr
inline
std::int64_t kMinTimestampSeconds = -62'135'596'800LL;
17
constexpr
inline
std::int64_t kMaxTimestampSeconds = 253'402'300'799LL;
18
constexpr
inline
std::int32_t kMinTimestampNanos = 0;
19
constexpr
inline
std::int32_t kMaxTimestampNanos = 999'999'999;
20
21
/// @brief Returns @c true if combination of @a seconds and @a nanos represent a valid `google.protobuf.Duration`.
22
[[nodiscard]]
bool
IsValidDuration(std::int64_t seconds, std::int32_t nanos)
noexcept
;
23
24
/// @brief Returns @c true if combination of @a seconds and @a nanos represent a valid `google.protobuf.Timestamp`.
25
[[nodiscard]]
bool
IsValidTimestamp(std::int64_t seconds, std::int32_t nanos)
noexcept
;
26
27
}
// namespace protobuf
28
29
USERVER_NAMESPACE_END
protobuf
include
userver
protobuf
datetime.hpp
Generated on
for userver by
Doxygen
1.17.0