|
fmt
|
Formatters for std::chrono durations, time points and calendar types. More...
#include "fmt/macros.hpp"#include <cerrno>#include <climits>#include <limits.h>#include <stdint.h>#include <stdio.h>#include <string.h>#include <time.h>#include <version>import fmt:format;import std;Typedefs | |
| template<typename Duration> | |
| using | fmt::SysTime |
| template<typename Duration> | |
| using | fmt::UtcTime = std::chrono::time_point<detail::UtcClock, Duration> |
| template<class Duration> | |
| using | fmt::LocalTime = std::chrono::time_point<detail::LocalT, Duration> |
| template<typename T, typename U> | |
| using | fmt::detail::IsSimilarArithmeticType |
Enumerations | |
| enum class | NumericSystem : int { kStandard = 0 , kAlternative = 1 } |
| enum class | PadType : int { kZero = 0 , kNone = 1 , kSpace = 2 } |
Functions | |
| auto | fmt::detail::gmtime_r (...) -> Null<> |
| auto | fmt::detail::gmtime_s (...) -> Null<> |
| auto | fmt::detail::getClassicLocale () -> const std::locale & |
| template<typename CodeUnit> | |
| auto | fmt::detail::writeCodecvt (CodecvtResult< CodeUnit > &out, StringView in, const std::locale &loc) -> void |
| template<typename OutputIt> | |
| auto | fmt::detail::writeEncodedTmStr (OutputIt out, StringView in, const std::locale &loc) -> OutputIt |
|
template<typename Char, typename OutputIt> requires (!std::is_same<Char, char>::value) | |
| auto | fmt::detail::writeTmStr (OutputIt out, StringView sv, const std::locale &loc) -> OutputIt |
|
template<typename Char, typename OutputIt> requires (std::is_same<Char, char>::value) | |
| auto | fmt::detail::writeTmStr (OutputIt out, StringView sv, const std::locale &loc) -> OutputIt |
| template<typename Char> | |
| auto | fmt::detail::doWrite (Buffer< Char > &buf, const std::tm &time, const std::locale &loc, char format, char modifier) -> void |
|
template<typename Char, typename OutputIt> requires (!std::is_same<Char, char>::value) | |
| auto | fmt::detail::write (OutputIt out, const std::tm &time, const std::locale &loc, char format, char modifier=0) -> OutputIt |
|
template<typename Char, typename OutputIt> requires (std::is_same<Char, char>::value) | |
| auto | fmt::detail::write (OutputIt out, const std::tm &time, const std::locale &loc, char format, char modifier=0) -> OutputIt |
| void | fmt::detail::throwDurationError () |
|
template<typename To, typename FromRep, typename FromPeriod> requires (std::is_integral<FromRep>::value && std::is_integral<typename To::rep>::value) | |
| auto | fmt::detail::durationCast (std::chrono::duration< FromRep, FromPeriod > from) -> To |
|
template<typename To, typename FromRep, typename FromPeriod> requires (std::is_floating_point<FromRep>::value && std::is_floating_point<typename To::rep>::value) | |
| auto | fmt::detail::durationCast (std::chrono::duration< FromRep, FromPeriod > from) -> To |
|
template<typename To, typename FromRep, typename FromPeriod> requires (!IsSimilarArithmeticType<FromRep, typename To::rep>::value) | |
| auto | fmt::detail::durationCast (std::chrono::duration< FromRep, FromPeriod > from) -> To |
| template<typename Duration> | |
| auto | fmt::detail::toTimeT (SysTime< Duration > time_point) -> std::time_t |
| auto | fmt::gmtime (std::time_t time) -> std::tm |
| template<typename Duration> | |
| auto | fmt::gmtime (SysTime< Duration > time_point) -> std::tm |
| auto | fmt::detail::writeDigit2Separated (char *buf, unsigned a, unsigned b, unsigned c, char sep) -> void |
| template<typename Period> | |
| constexpr auto | fmt::detail::getUnits () -> const char * |
| template<typename OutputIt> | |
| auto | fmt::detail::writePadding (OutputIt out, PadType pad, int width) -> OutputIt |
| template<typename OutputIt> | |
| auto | fmt::detail::writePadding (OutputIt out, PadType pad) -> OutputIt |
| template<typename Char, typename Handler> | |
| constexpr auto | fmt::detail::parseChronoFormat (const Char *begin, const Char *end, Handler &&handler) -> const Char * |
| auto | fmt::detail::tmWdayFullName (int wday) -> const char * |
| auto | fmt::detail::tmWdayShortName (int wday) -> const char * |
| auto | fmt::detail::tmMonFullName (int mon) -> const char * |
| auto | fmt::detail::tmMonShortName (int mon) -> const char * |
|
template<typename T> requires (HasTmZone<T>::value) | |
| auto | fmt::detail::setTmZone (T &time, char *tz) -> bool |
|
template<typename T> requires (!HasTmZone<T>::value) | |
| auto | fmt::detail::setTmZone (T &, char *) -> bool |
| auto | fmt::detail::utc () -> char * |
|
template<typename T, typename Int> requires (std::is_integral<T>::value) | |
| auto | fmt::detail::toNonnegativeInt (T value, Int upper) -> Int |
|
template<typename T, typename Int> requires (!std::is_integral<T>::value) | |
| auto | fmt::detail::toNonnegativeInt (T value, Int upper) -> Int |
| constexpr auto | fmt::detail::pow10 (std::uint32_t n) -> long long |
| template<typename Char, typename OutputIt, typename Duration> | |
| auto | fmt::detail::writeFractionalSeconds (OutputIt &out, Duration d, int precision=-1) -> void |
| template<typename Duration> | |
| auto | fmt::detail::writeFloatingSeconds (MemoryBuffer &buf, Duration duration, int num_fractional_digits=-1) -> void |
|
template<typename T> requires (std::is_integral<T>::value && HasIsfinite<T>::value) | |
| auto | fmt::detail::isfinite (T) -> bool |
|
template<typename T> requires (std::is_integral<T>::value) | |
| auto | fmt::detail::mod (T x, int y) -> T |
|
template<typename T> requires (std::is_floating_point<T>::value) | |
| auto | fmt::detail::mod (T x, int y) -> T |
|
template<typename Rep, typename Period> requires (std::is_integral<Rep>::value) | |
| auto | fmt::detail::getMilliseconds (std::chrono::duration< Rep, Period > d) -> std::chrono::duration< Rep, std::milli > |
|
template<typename Char, typename Rep, typename OutputIt> requires (std::is_integral<Rep>::value) | |
| auto | fmt::detail::formatDurationValue (OutputIt out, Rep val, int) -> OutputIt |
|
template<typename Char, typename Rep, typename OutputIt> requires (std::is_floating_point<Rep>::value) | |
| auto | fmt::detail::formatDurationValue (OutputIt out, Rep val, int precision) -> OutputIt |
| template<typename Char, typename OutputIt> | |
| auto | fmt::detail::copyUnit (StringView unit, OutputIt out, Char) -> OutputIt |
| template<typename OutputIt> | |
| auto | fmt::detail::copyUnit (StringView unit, OutputIt out, wchar_t) -> OutputIt |
| template<typename Char, typename Period, typename OutputIt> | |
| auto | fmt::detail::formatDurationUnit (OutputIt out) -> OutputIt |
Formatters for std::chrono durations, time points and calendar types.
Interface partition fmt:chrono.
| using fmt::detail::IsSimilarArithmeticType |
| using fmt::SysTime |
|
export |
Converts a std::time_t into calendar time expressed in Coordinated Universal Time.
Unlike std::gmtime, this is thread-safe on most platforms: it uses gmtime_r or gmtime_s where available.
| time | seconds since the epoch. |
| fmt::format_error | if the value cannot be represented. |
|
export |
Converts a sys_time into calendar time expressed in UTC.
| time_point | the time point to convert. |
| fmt::format_error | if the value cannot be represented as time_t. |