|
CelestialCalendar 1.0.0 · unreleased development @ 67a7c4c79a4a4a6aa7e703c9e6f0039ae34bee82
|
Classes | |
| struct | AlgoMetadata< Algo::ALGO_1 > |
| Specialize AlgoMetadata for Algo::ALGO_1. More... | |
| struct | AlgoMetadata< Algo::ALGO_2 > |
| Specialize AlgoMetadata for Algo::ALGO_2. More... | |
| struct | AlgoMetadata< Algo::ALGO_3 > |
| Specialize AlgoMetadata for Algo::ALGO_3. More... | |
| struct | LunarYear |
| Information of the lunar year. 阴历年信息。 More... | |
| struct | TraditionalMonth |
| A lunar month in traditional numbering: month number (1-12) plus a leap flag. 传统编号的阴历月:月份 (1-12) 加闰月标记。 More... | |
| struct | AlgoBounds |
| The bounds of the algorithm. More... | |
| struct | AlgoMetadata |
| The type trait for the lunar algorithm, expected specializations in every algorithm implementation. More... | |
Typedefs | |
| using | year_month_day |
Enumerations | |
| enum class | Algo : uint8_t { ALGO_1 , ALGO_2 , ALGO_3 } |
| Algorithm version. More... | |
Functions | |
| auto | parse_lunar_year (int32_t year, uint32_t encoded) -> LunarYear |
| Parse the encoded lunar year information for the given year. 返回给定年份的阴历年信息。 | |
| auto | month_position (const LunarYear &info, const uint8_t month, const bool is_leap) -> std::optional< uint8_t > |
| Translate a traditionally-numbered lunar month to its 1-based position in info.month_lengths. 把传统编号的阴历月翻译成 info.month_lengths 里的位置序号(从 1 起)。 | |
| auto | month_at_position (const LunarYear &info, const uint8_t position) -> std::optional< TraditionalMonth > |
| Translate a 1-based position in info.month_lengths back to traditional numbering. 把 info.month_lengths 里的位置序号(从 1 起)翻译回传统编号。 | |
| template<typename Func> requires std::invocable<const Func&, int32_t> and std::convertible_to<std::invoke_result_t<const Func&, int32_t>, LunarYear> | |
| auto | calc_bounds (const int32_t start_lunar_year, const int32_t end_lunar_year, const Func &algo_f) -> AlgoBounds |
| Calculate the bounds of the lunar algorithm. | |
|
strong |
|
inlinenodiscard |
Calculate the bounds of the lunar algorithm.
|
inlinenodiscard |
Translate a 1-based position in info.month_lengths back to traditional numbering. 把 info.month_lengths 里的位置序号(从 1 起)翻译回传统编号。
| info | The lunar year. 阴历年信息。 |
| position | The 1-based position. 位置序号(从 1 起)。 |
|
inlinenodiscard |
Translate a traditionally-numbered lunar month to its 1-based position in info.month_lengths. 把传统编号的阴历月翻译成 info.month_lengths 里的位置序号(从 1 起)。
| info | The lunar year. 阴历年信息。 |
| month | The traditional month number (1-12). 传统编号 (1-12)。 |
| is_leap | Whether the month is the leap month. 是否闰月。 |
|
inlinenodiscard |
Parse the encoded lunar year information for the given year. 返回给定年份的阴历年信息。
| year | The lunar year. 阴历年份。 |
| encoded | The encoded lunar year information. 阴历年信息的编码。 |