WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
chrono.h File Reference
#include <algorithm>
#include <chrono>
#include <cmath>
#include <cstring>
#include <ctime>
#include <iterator>
#include <locale>
#include <ostream>
#include <type_traits>
#include "format.h"

Go to the source code of this file.

Classes

struct  detail::utc_clock
struct  detail::local_t
struct  detail::null< T >
class  detail::formatbuf< StreamBuf >
struct  detail::codecvt_result< CodeUnit >
struct  detail::null_chrono_spec_handler< Derived >
class  detail::tm_format_checker
struct  detail::has_tm_gmtoff< T, typename >
struct  detail::has_tm_gmtoff< T, void_t< decltype(T::tm_gmtoff)> >
struct  detail::has_tm_zone< T, typename >
struct  detail::has_tm_zone< T, void_t< decltype(T::tm_zone)> >
struct  detail::count_fractional_digits< Num, Den, N, Enabled >
struct  detail::count_fractional_digits< Num, Den, N, false >
class  detail::tm_writer< OutputIt, Char, Duration >
struct  detail::chrono_format_checker
struct  detail::make_unsigned_or_unchanged< T, INTEGRAL >
struct  detail::make_unsigned_or_unchanged< T, true >
class  detail::get_locale
struct  detail::duration_formatter< Char, Rep, Period >
class  weekday
class  day
class  month
class  year
class  year_month_day
struct  formatter< weekday, Char >
struct  formatter< day, Char >
struct  formatter< month, Char >
struct  formatter< year, Char >
struct  formatter< year_month_day, Char >
struct  formatter< std::chrono::duration< Rep, Period >, Char >
struct  formatter< std::tm, Char >
struct  formatter< sys_time< Duration >, Char >
struct  formatter< utc_time< Duration >, Char >
struct  formatter< local_time< Duration >, Char >

Namespaces

namespace  detail
 Converts a string literal into a format string that will be parsed at compile time and converted into efficient formatting code.

Macros

#define FMT_SAFE_DURATION_CAST   1
#define FMT_USE_UTC_TIME   0
#define FMT_USE_LOCAL_TIME   0
#define FMT_NOMACRO

Typedefs

template<typename Duration>
using sys_time = std::chrono::time_point<std::chrono::system_clock, Duration>
template<typename Duration>
using utc_time = std::chrono::time_point<detail::utc_clock, Duration>
template<class Duration>
using local_time = std::chrono::time_point<detail::local_t, Duration>
template<typename T, typename U>
using detail::is_similar_arithmetic_type

Enumerations

enum class  detail::numeric_system { detail::standard , detail::alternative }
enum class  detail::pad_type { detail::zero , detail::none , detail::space }

Functions

auto detail::gmtime_r (...) -> null<>
auto detail::gmtime_s (...) -> null<>
auto detail::get_classic_locale () -> const std::locale &
template<typename CodeUnit>
void detail::write_codecvt (codecvt_result< CodeUnit > &out, string_view in, const std::locale &loc)
template<typename OutputIt>
auto detail::write_encoded_tm_str (OutputIt out, string_view in, const std::locale &loc) -> OutputIt
template<typename Char, typename OutputIt, FMT_ENABLE_IF(!std::is_same< Char, char >::value)>
auto detail::write_tm_str (OutputIt out, string_view sv, const std::locale &loc) -> OutputIt
template<typename Char, typename OutputIt, FMT_ENABLE_IF(std::is_same< Char, char >::value)>
auto detail::write_tm_str (OutputIt out, string_view sv, const std::locale &loc) -> OutputIt
template<typename Char>
void detail::do_write (buffer< Char > &buf, const std::tm &time, const std::locale &loc, char format, char modifier)
template<typename Char, typename OutputIt, FMT_ENABLE_IF(!std::is_same< Char, char >::value)>
auto detail::write (OutputIt out, const std::tm &time, const std::locale &loc, char format, char modifier=0) -> OutputIt
template<typename Char, typename OutputIt, FMT_ENABLE_IF(std::is_same< Char, char >::value)>
auto detail::write (OutputIt out, const std::tm &time, const std::locale &loc, char format, char modifier=0) -> OutputIt
FMT_NORETURN void detail::throw_duration_error ()
template<typename To, typename FromRep, typename FromPeriod, FMT_ENABLE_IF(std::is_integral< FromRep >::value && std::is_integral< typename To::rep >::value)>
auto detail::duration_cast (std::chrono::duration< FromRep, FromPeriod > from) -> To
template<typename To, typename FromRep, typename FromPeriod, FMT_ENABLE_IF(std::is_floating_point< FromRep >::value && std::is_floating_point< typename To::rep >::value)>
auto detail::duration_cast (std::chrono::duration< FromRep, FromPeriod > from) -> To
template<typename To, typename FromRep, typename FromPeriod, FMT_ENABLE_IF( !is_similar_arithmetic_type< FromRep, typename To::rep >::value)>
auto detail::duration_cast (std::chrono::duration< FromRep, FromPeriod > from) -> To
template<typename Duration>
auto detail::to_time_t (sys_time< Duration > time_point) -> std::time_t
FMT_BEGIN_EXPORT auto gmtime (std::time_t time) -> std::tm
 Converts given time since epoch as std::time_t value into calendar time, expressed in Coordinated Universal Time (UTC).
template<typename Duration>
auto gmtime (sys_time< Duration > time_point) -> std::tm
void detail::write_digit2_separated (char *buf, unsigned a, unsigned b, unsigned c, char sep)
template<typename Period>
FMT_CONSTEXPR auto detail::get_units () -> const char *
template<typename OutputIt>
auto detail::write_padding (OutputIt out, pad_type pad, int width) -> OutputIt
template<typename OutputIt>
auto detail::write_padding (OutputIt out, pad_type pad) -> OutputIt
template<typename Char, typename Handler>
FMT_CONSTEXPR auto detail::parse_chrono_format (const Char *begin, const Char *end, Handler &&handler) -> const Char *
auto detail::tm_wday_full_name (int wday) -> const char *
auto detail::tm_wday_short_name (int wday) -> const char *
auto detail::tm_mon_full_name (int mon) -> const char *
auto detail::tm_mon_short_name (int mon) -> const char *
template<typename T, FMT_ENABLE_IF(has_tm_zone< T >::value)>
auto detail::set_tm_zone (T &time, char *tz) -> bool
template<typename T, FMT_ENABLE_IF(!has_tm_zone< T >::value)>
auto detail::set_tm_zone (T &, char *) -> bool
auto detail::utc () -> char *
template<typename T, typename Int, FMT_ENABLE_IF(std::is_integral< T >::value)>
auto detail::to_nonnegative_int (T value, Int upper) -> Int
template<typename T, typename Int, FMT_ENABLE_IF(!std::is_integral< T >::value)>
auto detail::to_nonnegative_int (T value, Int upper) -> Int
constexpr auto detail::pow10 (std::uint32_t n) -> long long
template<typename Char, typename OutputIt, typename Duration>
void detail::write_fractional_seconds (OutputIt &out, Duration d, int precision=-1)
template<typename Duration>
void detail::write_floating_seconds (memory_buffer &buf, Duration duration, int num_fractional_digits=-1)
template<typename T, FMT_ENABLE_IF(std::is_integral< T >::value &&has_isfinite< T >::value)>
auto detail::isfinite (T) -> bool
template<typename T, FMT_ENABLE_IF(std::is_integral< T >::value)>
auto detail::mod (T x, int y) -> T
template<typename T, FMT_ENABLE_IF(std::is_floating_point< T >::value)>
auto detail::mod (T x, int y) -> T
template<typename Rep, typename Period, FMT_ENABLE_IF(std::is_integral< Rep >::value)>
auto detail::get_milliseconds (std::chrono::duration< Rep, Period > d) -> std::chrono::duration< Rep, std::milli >
template<typename Char, typename Rep, typename OutputIt, FMT_ENABLE_IF(std::is_integral< Rep >::value)>
auto detail::format_duration_value (OutputIt out, Rep val, int) -> OutputIt
template<typename Char, typename Rep, typename OutputIt, FMT_ENABLE_IF(std::is_floating_point< Rep >::value)>
auto detail::format_duration_value (OutputIt out, Rep val, int precision) -> OutputIt
template<typename Char, typename OutputIt>
auto detail::copy_unit (string_view unit, OutputIt out, Char) -> OutputIt
template<typename OutputIt>
auto detail::copy_unit (string_view unit, OutputIt out, wchar_t) -> OutputIt
template<typename Char, typename Period, typename OutputIt>
auto detail::format_duration_unit (OutputIt out) -> OutputIt

Macro Definition Documentation

◆ FMT_NOMACRO

#define FMT_NOMACRO

◆ FMT_SAFE_DURATION_CAST

#define FMT_SAFE_DURATION_CAST   1

◆ FMT_USE_LOCAL_TIME

#define FMT_USE_LOCAL_TIME   0

◆ FMT_USE_UTC_TIME

#define FMT_USE_UTC_TIME   0

Typedef Documentation

◆ local_time

template<class Duration>
using local_time = std::chrono::time_point<detail::local_t, Duration>

◆ sys_time

template<typename Duration>
using sys_time = std::chrono::time_point<std::chrono::system_clock, Duration>

◆ utc_time

template<typename Duration>
using utc_time = std::chrono::time_point<detail::utc_clock, Duration>

Function Documentation

◆ gmtime() [1/2]

FMT_BEGIN_EXPORT auto gmtime ( std::time_t time) ->std::tm
inline

Converts given time since epoch as std::time_t value into calendar time, expressed in Coordinated Universal Time (UTC).

Unlike std::gmtime, this function is thread-safe on most platforms.

◆ gmtime() [2/2]

template<typename Duration>
auto gmtime ( sys_time< Duration > time_point) ->std::tm
inline