Namespaces
Records
Functions
-
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 1556 of file ../../third_party/abseil-cpp/absl/time/time.h
-
Duration MakeDuration (int64_t hi, int64_t lo)Defined at line 1561 of file ../../third_party/abseil-cpp/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 1569 of file ../../third_party/abseil-cpp/absl/time/time.h
-
bool AbslParseFlag (absl::string_view s, 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_view s, CivilMinute * c, std::string * error) -
bool AbslParseFlag (absl::string_view s, CivilHour * c, std::string * error) -
bool AbslParseFlag (absl::string_view s, CivilDay * c, std::string * error) -
bool AbslParseFlag (absl::string_view s, CivilMonth * c, std::string * error) -
bool AbslParseFlag (absl::string_view s, 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) -
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 1582 of file ../../third_party/abseil-cpp/absl/time/time.h
-
Duration OppositeInfinity (Duration d)Returns an infinite Duration with the opposite sign.
REQUIRES: IsInfiniteDuration(d)
Defined at line 1603 of file ../../third_party/abseil-cpp/absl/time/time.h
-
int64_t NegateAndSubtractOne (int64_t n)Returns (-n)-1 (equivalently -(n+1)) without avoidable overflow.
Defined at line 1611 of file ../../third_party/abseil-cpp/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 1622 of file ../../third_party/abseil-cpp/absl/time/time.h
-
Duration ToUnixDuration (Time t)Defined at line 1625 of file ../../third_party/abseil-cpp/absl/time/time.h
-
int64_t GetRepHi (Duration d)Provide access to the Duration representation.
Defined at line 1589 of file ../../third_party/abseil-cpp/absl/time/time.h
-
uint32_t GetRepLo (Duration d)Defined at line 1592 of file ../../third_party/abseil-cpp/absl/time/time.h
-
bool IsInfiniteDuration (Duration d)Returns true iff d is positive or negative infinity.
Defined at line 1597 of file ../../third_party/abseil-cpp/absl/time/time.h
-
template <std::intmax_t N>Duration FromInt64 (int64_t v, std::ratio<1, N> )Defined at line 1630 of file ../../third_party/abseil-cpp/absl/time/time.h
-
Duration FromInt64 (int64_t v, std::ratio<60> )Defined at line 1637 of file ../../third_party/abseil-cpp/absl/time/time.h
-
Duration FromInt64 (int64_t v, std::ratio<3600> )Defined at line 1644 of file ../../third_party/abseil-cpp/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 1655 of file ../../third_party/abseil-cpp/absl/time/time.h
-
template <typename T>bool IsValidRep64 (char )Defined at line 1659 of file ../../third_party/abseil-cpp/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 1665 of file ../../third_party/abseil-cpp/absl/time/time.h
-
template <typename Ratio>int64_t ToInt64 (Duration d, Ratio )Defined at line 1672 of file ../../third_party/abseil-cpp/absl/time/time.h
-
int64_t ToInt64 (Duration d, std::nano )Fastpath implementations for the 6 common duration units.
Defined at line 1678 of file ../../third_party/abseil-cpp/absl/time/time.h
-
int64_t ToInt64 (Duration d, std::micro )Defined at line 1681 of file ../../third_party/abseil-cpp/absl/time/time.h
-
int64_t ToInt64 (Duration d, std::milli )Defined at line 1684 of file ../../third_party/abseil-cpp/absl/time/time.h
-
int64_t ToInt64 (Duration d, std::ratio<1> )Defined at line 1687 of file ../../third_party/abseil-cpp/absl/time/time.h
-
int64_t ToInt64 (Duration d, std::ratio<60> )Defined at line 1691 of file ../../third_party/abseil-cpp/absl/time/time.h
-
int64_t ToInt64 (Duration d, std::ratio<3600> )Defined at line 1695 of file ../../third_party/abseil-cpp/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 1702 of file ../../third_party/abseil-cpp/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 & osCivilSecond s)