#ifndef ABSL_TIME_INTERNAL_CCTZ_CIVIL_TIME_DETAIL_H_
#define ABSL_TIME_INTERNAL_CCTZ_CIVIL_TIME_DETAIL_H_
#include <cstdint>
#include <limits>
#include <ostream>
#include <type_traits>
#include "absl/base/config.h"
#if __cpp_constexpr >= 201304 || (defined(_MSC_VER) && _MSC_VER >= 1910)
#define CONSTEXPR_D …
#define CONSTEXPR_F …
#define CONSTEXPR_M …
#else
#define CONSTEXPR_D …
#define CONSTEXPR_F …
#define CONSTEXPR_M
#endif
namespace absl {
ABSL_NAMESPACE_BEGIN
namespace time_internal {
namespace cctz {
year_t;
diff_t;
namespace detail {
month_t;
day_t;
hour_t;
minute_t;
second_t;
struct fields { … };
struct second_tag { … };
struct minute_tag : second_tag { … };
struct hour_tag : minute_tag { … };
struct day_tag : hour_tag { … };
struct month_tag : day_tag { … };
struct year_tag : month_tag { … };
namespace impl {
CONSTEXPR_F bool is_leap_year(year_t y) noexcept { … }
CONSTEXPR_F int year_index(year_t y, month_t m) noexcept { … }
CONSTEXPR_F int days_per_century(int yi) noexcept { … }
CONSTEXPR_F int days_per_4years(int yi) noexcept { … }
CONSTEXPR_F int days_per_year(year_t y, month_t m) noexcept { … }
CONSTEXPR_F int days_per_month(year_t y, month_t m) noexcept { … }
CONSTEXPR_F fields n_day(year_t y, month_t m, diff_t d, diff_t cd, hour_t hh,
minute_t mm, second_t ss) noexcept { … }
CONSTEXPR_F fields n_mon(year_t y, diff_t m, diff_t d, diff_t cd, hour_t hh,
minute_t mm, second_t ss) noexcept { … }
CONSTEXPR_F fields n_hour(year_t y, diff_t m, diff_t d, diff_t cd, diff_t hh,
minute_t mm, second_t ss) noexcept { … }
CONSTEXPR_F fields n_min(year_t y, diff_t m, diff_t d, diff_t hh, diff_t ch,
diff_t mm, second_t ss) noexcept { … }
CONSTEXPR_F fields n_sec(year_t y, diff_t m, diff_t d, diff_t hh, diff_t mm,
diff_t ss) noexcept { … }
}
CONSTEXPR_F fields step(second_tag, fields f, diff_t n) noexcept { … }
CONSTEXPR_F fields step(minute_tag, fields f, diff_t n) noexcept { … }
CONSTEXPR_F fields step(hour_tag, fields f, diff_t n) noexcept { … }
CONSTEXPR_F fields step(day_tag, fields f, diff_t n) noexcept { … }
CONSTEXPR_F fields step(month_tag, fields f, diff_t n) noexcept { … }
CONSTEXPR_F fields step(year_tag, fields f, diff_t n) noexcept { … }
namespace impl {
CONSTEXPR_F diff_t scale_add(diff_t v, diff_t f, diff_t a) noexcept { … }
CONSTEXPR_F diff_t ymd_ord(year_t y, month_t m, day_t d) noexcept { … }
CONSTEXPR_F diff_t day_difference(year_t y1, month_t m1, day_t d1, year_t y2,
month_t m2, day_t d2) noexcept { … }
}
CONSTEXPR_F diff_t difference(year_tag, fields f1, fields f2) noexcept { … }
CONSTEXPR_F diff_t difference(month_tag, fields f1, fields f2) noexcept { … }
CONSTEXPR_F diff_t difference(day_tag, fields f1, fields f2) noexcept { … }
CONSTEXPR_F diff_t difference(hour_tag, fields f1, fields f2) noexcept { … }
CONSTEXPR_F diff_t difference(minute_tag, fields f1, fields f2) noexcept { … }
CONSTEXPR_F diff_t difference(second_tag, fields f1, fields f2) noexcept { … }
CONSTEXPR_F fields align(second_tag, fields f) noexcept { … }
CONSTEXPR_F fields align(minute_tag, fields f) noexcept { … }
CONSTEXPR_F fields align(hour_tag, fields f) noexcept { … }
CONSTEXPR_F fields align(day_tag, fields f) noexcept { … }
CONSTEXPR_F fields align(month_tag, fields f) noexcept { … }
CONSTEXPR_F fields align(year_tag, fields f) noexcept { … }
namespace impl {
template <typename H>
H AbslHashValueImpl(second_tag, H h, fields f) { … }
template <typename H>
H AbslHashValueImpl(minute_tag, H h, fields f) { … }
template <typename H>
H AbslHashValueImpl(hour_tag, H h, fields f) { … }
template <typename H>
H AbslHashValueImpl(day_tag, H h, fields f) { … }
template <typename H>
H AbslHashValueImpl(month_tag, H h, fields f) { … }
template <typename H>
H AbslHashValueImpl(year_tag, H h, fields f) { … }
}
template <typename T>
class civil_time { … };
template <typename T, typename U>
CONSTEXPR_F diff_t operator-(civil_time<T>, civil_time<U>) = delete;
civil_year;
civil_month;
civil_day;
civil_hour;
civil_minute;
civil_second;
template <typename T1, typename T2>
CONSTEXPR_F bool operator<(const civil_time<T1>& lhs,
const civil_time<T2>& rhs) noexcept { … }
template <typename T1, typename T2>
CONSTEXPR_F bool operator<=(const civil_time<T1>& lhs,
const civil_time<T2>& rhs) noexcept { … }
template <typename T1, typename T2>
CONSTEXPR_F bool operator>=(const civil_time<T1>& lhs,
const civil_time<T2>& rhs) noexcept { … }
template <typename T1, typename T2>
CONSTEXPR_F bool operator>(const civil_time<T1>& lhs,
const civil_time<T2>& rhs) noexcept { … }
template <typename T1, typename T2>
CONSTEXPR_F bool operator==(const civil_time<T1>& lhs,
const civil_time<T2>& rhs) noexcept { … }
template <typename T1, typename T2>
CONSTEXPR_F bool operator!=(const civil_time<T1>& lhs,
const civil_time<T2>& rhs) noexcept { … }
enum class weekday { … };
CONSTEXPR_F weekday get_weekday(const civil_second& cs) noexcept { … }
CONSTEXPR_F civil_day next_weekday(civil_day cd, weekday wd) noexcept { … }
CONSTEXPR_F civil_day prev_weekday(civil_day cd, weekday wd) noexcept { … }
CONSTEXPR_F int get_yearday(const civil_second& cs) noexcept { … }
std::ostream& operator<<(std::ostream& os, const civil_year& y);
std::ostream& operator<<(std::ostream& os, const civil_month& m);
std::ostream& operator<<(std::ostream& os, const civil_day& d);
std::ostream& operator<<(std::ostream& os, const civil_hour& h);
std::ostream& operator<<(std::ostream& os, const civil_minute& m);
std::ostream& operator<<(std::ostream& os, const civil_second& s);
std::ostream& operator<<(std::ostream& os, weekday wd);
}
}
}
ABSL_NAMESPACE_END
}
#undef CONSTEXPR_M
#undef CONSTEXPR_F
#undef CONSTEXPR_D
#endif