Namespaces
Records
Functions
-
Duration MakeNormalizedDuration (int64_t sec, int64_t ticks)Creates a normalized Duration from an almost-normalized (sec,ticks)
pair. sec may be positive or negative. ticks must be in the range
-kTicksPerSecond
<
*ticks
<
kTicksPerSecond. If ticks is negative it
will be normalized to a positive value in the resulting Duration.
Defined at line 1623 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
Time FromUnixDuration (Duration d)Map between a Time and a Duration since the Unix epoch. Note that these
functions depend on the above mentioned choice of the Unix epoch for the
Time representation (and both need to be Time friends). Without this
knowledge, we would need to add-in/subtract-out UnixEpoch() respectively.
Defined at line 1663 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
Duration ToUnixDuration (Time t)Defined at line 1666 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
int64_t GetRepHi (Duration d)Provide access to the Duration representation.
Defined at line 1630 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
uint32_t GetRepLo (Duration d)Defined at line 1633 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
Duration MakeDuration (int64_t hi, uint32_t lo)Creates a Duration with a given representation.
REQUIRES: hi,lo is a valid representation of a Duration as specified
in time/duration.cc.
Defined at line 1597 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
Duration MakeDuration (int64_t hi, int64_t lo)Defined at line 1602 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
Duration MakePosDoubleDuration (double n)Make a Duration value from a floating-point number, as long as that number
is in the range [ 0 .. numeric_limits
<int64
_t>::max ), that is, as long as
it's positive and can be converted to int64_t without risk of UB.
Defined at line 1610 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
bool IsInfiniteDuration (Duration d)Returns true iff d is positive or negative infinity.
Defined at line 1638 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
Duration OppositeInfinity (Duration d)Returns an infinite Duration with the opposite sign.
REQUIRES: IsInfiniteDuration(d)
Defined at line 1644 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
int64_t NegateAndSubtractOne (int64_t n)Returns (-n)-1 (equivalently -(n+1)) without avoidable overflow.
Defined at line 1652 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
template <std::intmax_t N>Duration FromInt64 (int64_t v, std::ratio<1, N> )Defined at line 1671 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
Duration FromInt64 (int64_t v, std::ratio<60> )Defined at line 1678 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
Duration FromInt64 (int64_t v, std::ratio<3600> )Defined at line 1686 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
template <typename T>decltype(int64_t{std::declval<T>()} == 0) IsValidRep64 (int )IsValidRep64
<T
>(0) is true if the expression `int64_t{std::declval
<T
>()}` is
valid. That is, if a T can be assigned to an int64_t without narrowing.
Defined at line 1698 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
template <typename T>bool IsValidRep64 (char )Defined at line 1702 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
template <typename Rep, typename Period>Duration FromChrono (const std::chrono::duration<Rep, Period> & d)Converts a std::chrono::duration to an absl::Duration.
Defined at line 1708 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
template <typename Ratio>int64_t ToInt64 (Duration d, Ratio )Defined at line 1715 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
int64_t ToInt64 (Duration d, std::nano )Fastpath implementations for the 6 common duration units.
Defined at line 1721 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
int64_t ToInt64 (Duration d, std::micro )Defined at line 1724 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
int64_t ToInt64 (Duration d, std::milli )Defined at line 1727 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
int64_t ToInt64 (Duration d, std::ratio<1> )Defined at line 1730 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
int64_t ToInt64 (Duration d, std::ratio<60> )Defined at line 1734 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
int64_t ToInt64 (Duration d, std::ratio<3600> )Defined at line 1738 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
template <typename T>T ToChronoDuration (Duration d)Converts an absl::Duration to a chrono duration of type T.
Defined at line 1745 of file ../../third_party/abseil-cpp/src/absl/time/time.h
-
std::ostream & operator<< (std::ostream & os, CivilYear y)Streaming Operators
Each civil-time type may be sent to an output stream using operator
<
<
().
The result matches the string produced by `FormatCivilTime()`.
Example:
absl::CivilDay d = absl::CivilDay(1969, 7, 20);
std::cout
<
<
"Date is: "
<
<
d
<
<
"\n";
-
std::ostream & operator<< (std::ostream & os, CivilMonth m) -
std::ostream & operator<< (std::ostream & os, CivilDay d) -
std::ostream & operator<< (std::ostream & os, CivilHour h) -
std::ostream & operator<< (std::ostream & os, CivilMinute m) -
std::ostream & operator<< (std::ostream & os, CivilSecond s) -
bool AbslParseFlag (absl::string_views,CivilSecond *c,std::string *error)AbslParseFlag()
Parses the command-line flag string representation `s` into a civil-time
value. Flags must be specified in a format that is valid for
`absl::ParseLenientCivilTime()`.
-
bool AbslParseFlag (absl::string_views,CivilMinute *c,std::string *error) -
bool AbslParseFlag (absl::string_views,CivilHour *c,std::string *error) -
bool AbslParseFlag (absl::string_views,CivilDay *c,std::string *error) -
bool AbslParseFlag (absl::string_views,CivilMonth *c,std::string *error) -
bool AbslParseFlag (absl::string_views,CivilYear *c,std::string *error) -
std::string AbslUnparseFlag (CivilSecond c)AbslUnparseFlag()
Unparses a civil-time value into a command-line string representation using
the format specified by `absl::ParseCivilTime()`.
-
std::string AbslUnparseFlag (CivilMinute c) -
std::string AbslUnparseFlag (CivilHour c) -
std::string AbslUnparseFlag (CivilDay c) -
std::string AbslUnparseFlag (CivilMonth c) -
std::string AbslUnparseFlag (CivilYear c)