class ICU4XDataProvider; class ICU4XLocale; #include"ICU4XTimeLength.hpp" class ICU4XTimeFormatter; #include"ICU4XError.hpp" class ICU4XTime; class ICU4XDateTime; class ICU4XIsoDateTime;
/** * A destruction policy for using ICU4XTimeFormatter with std::unique_ptr.
*/ struct ICU4XTimeFormatterDeleter { voidoperator()(capi::ICU4XTimeFormatter* l) const noexcept {
capi::ICU4XTimeFormatter_destroy(l);
}
};
/** * An ICU4X TimeFormatter object capable of formatting an [`ICU4XTime`] type (and others) as a string * * See the [Rust documentation for `TimeFormatter`](https://docs.rs/icu/latest/icu/datetime/struct.TimeFormatter.html) for more information.
*/ class ICU4XTimeFormatter { public:
/** * Creates a new [`ICU4XTimeFormatter`] from locale data. * * See the [Rust documentation for `try_new_with_length`](https://docs.rs/icu/latest/icu/datetime/struct.TimeFormatter.html#method.try_new_with_length) for more information.
*/ static diplomat::result<ICU4XTimeFormatter, ICU4XError> create_with_length(const ICU4XDataProvider& provider, const ICU4XLocale& locale, ICU4XTimeLength length);
/** * Formats a [`ICU4XTime`] to a string. * * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.TimeFormatter.html#method.format) for more information.
*/ template<typename W> diplomat::result<std::monostate, ICU4XError> format_time_to_writeable(const ICU4XTime& value, W& write) const;
/** * Formats a [`ICU4XDateTime`] to a string. * * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.TimeFormatter.html#method.format) for more information.
*/ template<typename W> diplomat::result<std::monostate, ICU4XError> format_datetime_to_writeable(const ICU4XDateTime& value, W& write) const;
/** * Formats a [`ICU4XIsoDateTime`] to a string. * * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.TimeFormatter.html#method.format) for more information.
*/ template<typename W> diplomat::result<std::monostate, ICU4XError> format_iso_datetime_to_writeable(const ICU4XIsoDateTime& value, W& write) const;
/** * Formats a [`ICU4XIsoDateTime`] to a string. * * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.TimeFormatter.html#method.format) for more information.
*/
diplomat::result<std::string, ICU4XError> format_iso_datetime(const ICU4XIsoDateTime& value) const; inlineconst capi::ICU4XTimeFormatter* AsFFI() const { return this->inner.get(); } inline capi::ICU4XTimeFormatter* AsFFIMut() { return this->inner.get(); } inlineexplicit ICU4XTimeFormatter(capi::ICU4XTimeFormatter* i) : inner(i) {}
ICU4XTimeFormatter() = default;
ICU4XTimeFormatter(ICU4XTimeFormatter&&) noexcept = default;
ICU4XTimeFormatter& operator=(ICU4XTimeFormatter&& other) noexcept = default; private:
std::unique_ptr<capi::ICU4XTimeFormatter, ICU4XTimeFormatterDeleter> 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.