class ICU4XCalendar; class ICU4XDateTime; #include"ICU4XError.hpp" class ICU4XDate; class ICU4XTime; class ICU4XIsoDateTime; #include"ICU4XIsoWeekday.hpp" class ICU4XWeekCalculator; struct ICU4XWeekOf;
/** * A destruction policy for using ICU4XDateTime with std::unique_ptr.
*/ struct ICU4XDateTimeDeleter { voidoperator()(capi::ICU4XDateTime* l) const noexcept {
capi::ICU4XDateTime_destroy(l);
}
};
/** * An ICU4X DateTime object capable of containing a date and time for any calendar. * * See the [Rust documentation for `DateTime`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html) for more information.
*/ class ICU4XDateTime { public:
/** * Creates a new [`ICU4XDateTime`] representing the ISO date and time * given but in a given calendar * * See the [Rust documentation for `new_from_iso`](https://docs.rs/icu/latest/icu/struct.DateTime.html#method.new_from_iso) for more information.
*/ static diplomat::result<ICU4XDateTime, ICU4XError> create_from_iso_in_calendar(int32_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second, uint32_t nanosecond, const ICU4XCalendar& calendar);
/** * Creates a new [`ICU4XDateTime`] from the given codes, which are interpreted in the given calendar system * * See the [Rust documentation for `try_new_from_codes`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#method.try_new_from_codes) for more information.
*/ static diplomat::result<ICU4XDateTime, ICU4XError> create_from_codes_in_calendar(const std::string_view era_code, int32_t year, const std::string_view month_code, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second, uint32_t nanosecond, const ICU4XCalendar& calendar);
/** * Creates a new [`ICU4XDateTime`] from an [`ICU4XDate`] and [`ICU4XTime`] object * * See the [Rust documentation for `new`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#method.new) for more information.
*/ static ICU4XDateTime create_from_date_and_time(const ICU4XDate& date, const ICU4XTime& time);
/** * Returns the week number in this month, 1-indexed, based on what * is considered the first day of the week (often a locale preference). * * `first_weekday` can be obtained via `first_weekday()` on [`ICU4XWeekCalculator`] * * See the [Rust documentation for `week_of_month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.week_of_month) for more information.
*/
uint32_t week_of_month(ICU4XIsoWeekday first_weekday) const;
/** * Returns the week number in this year, using week data * * See the [Rust documentation for `week_of_year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.week_of_year) for more information.
*/
diplomat::result<ICU4XWeekOf, ICU4XError> week_of_year(const ICU4XWeekCalculator& calculator) const;
/** * Returns 1-indexed number of the month of this date in its year * * Note that for lunar calendars this may not lead to the same month * having the same ordinal month across years; use month_code if you care * about month identity. * * See the [Rust documentation for `month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.month) for more information.
*/
uint32_t ordinal_month() const;
/** * Returns the month code for this date. Typically something * like "M01", "M02", but can be more complicated for lunar calendars. * * See the [Rust documentation for `month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.month) for more information.
*/ template<typename W> diplomat::result<std::monostate, ICU4XError> month_code_to_writeable(W& write) const;
/** * Returns the month code for this date. Typically something * like "M01", "M02", but can be more complicated for lunar calendars. * * See the [Rust documentation for `month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.month) for more information.
*/
diplomat::result<std::string, ICU4XError> month_code() const;
/** * Returns the era for this date, * * See the [Rust documentation for `year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.year) for more information.
*/ template<typename W> diplomat::result<std::monostate, ICU4XError> era_to_writeable(W& write) const;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.