class ICU4XIsoDateTime; #include"ICU4XError.hpp" class ICU4XIsoDate; class ICU4XTime; class ICU4XDateTime; class ICU4XCalendar; #include"ICU4XIsoWeekday.hpp" class ICU4XWeekCalculator; struct ICU4XWeekOf;
/** * A destruction policy for using ICU4XIsoDateTime with std::unique_ptr.
*/ struct ICU4XIsoDateTimeDeleter { voidoperator()(capi::ICU4XIsoDateTime* l) const noexcept {
capi::ICU4XIsoDateTime_destroy(l);
}
};
/** * An ICU4X DateTime object capable of containing a ISO-8601 date and time. * * See the [Rust documentation for `DateTime`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html) for more information.
*/ class ICU4XIsoDateTime { public:
/** * Creates a new [`ICU4XIsoDateTime`] from the specified date and time. * * See the [Rust documentation for `try_new_iso_datetime`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#method.try_new_iso_datetime) for more information.
*/ static diplomat::result<ICU4XIsoDateTime, ICU4XError> create(int32_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second, uint32_t nanosecond);
/** * Creates a new [`ICU4XIsoDateTime`] from an [`ICU4XIsoDate`] 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 ICU4XIsoDateTime crate_from_date_and_time(const ICU4XIsoDate& 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 the number of days in the year represented by this date * * See the [Rust documentation for `days_in_year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.days_in_year) for more information.
*/
uint16_t days_in_year() const; inlineconst capi::ICU4XIsoDateTime* AsFFI() const { return this->inner.get(); } inline capi::ICU4XIsoDateTime* AsFFIMut() { return this->inner.get(); } inlineexplicit ICU4XIsoDateTime(capi::ICU4XIsoDateTime* i) : inner(i) {}
ICU4XIsoDateTime() = default;
ICU4XIsoDateTime(ICU4XIsoDateTime&&) noexcept = default;
ICU4XIsoDateTime& operator=(ICU4XIsoDateTime&& other) noexcept = default; private:
std::unique_ptr<capi::ICU4XIsoDateTime, ICU4XIsoDateTimeDeleter> inner;
};
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.