class ICU4XDataProvider; class ICU4XLocale; struct ICU4XCollatorOptionsV1; class ICU4XCollator; #include"ICU4XError.hpp" #include"ICU4XOrdering.hpp" struct ICU4XCollatorResolvedOptionsV1;
/** * A destruction policy for using ICU4XCollator with std::unique_ptr.
*/ struct ICU4XCollatorDeleter { voidoperator()(capi::ICU4XCollator* l) const noexcept {
capi::ICU4XCollator_destroy(l);
}
};
/** * Construct a new Collator instance. * * See the [Rust documentation for `try_new`](https://docs.rs/icu/latest/icu/collator/struct.Collator.html#method.try_new) for more information.
*/ static diplomat::result<ICU4XCollator, ICU4XError> create_v1(const ICU4XDataProvider& provider, const ICU4XLocale& locale, ICU4XCollatorOptionsV1 options);
/** * Compare two strings. * * Ill-formed input is treated as if errors had been replaced with REPLACEMENT CHARACTERs according * to the WHATWG Encoding Standard. * * See the [Rust documentation for `compare_utf8`](https://docs.rs/icu/latest/icu/collator/struct.Collator.html#method.compare_utf8) for more information.
*/
ICU4XOrdering compare(const std::string_view left, const std::string_view right) const;
/** * Compare two strings. * * See the [Rust documentation for `compare`](https://docs.rs/icu/latest/icu/collator/struct.Collator.html#method.compare) for more information. * * Warning: Passing ill-formed UTF-8 is undefined behavior (and may be memory-unsafe).
*/
ICU4XOrdering compare_valid_utf8(const std::string_view left, const std::string_view right) const;
/** * Compare two strings. * * Ill-formed input is treated as if errors had been replaced with REPLACEMENT CHARACTERs according * to the WHATWG Encoding Standard. * * See the [Rust documentation for `compare_utf16`](https://docs.rs/icu/latest/icu/collator/struct.Collator.html#method.compare_utf16) for more information.
*/
ICU4XOrdering compare_utf16(const std::u16string_view left, const std::u16string_view right) const;
/** * The resolved options showing how the default options, the requested options, * and the options from locale data were combined. None of the struct fields * will have `Auto` as the value. * * See the [Rust documentation for `resolved_options`](https://docs.rs/icu/latest/icu/collator/struct.Collator.html#method.resolved_options) for more information.
*/
ICU4XCollatorResolvedOptionsV1 resolved_options() const; inlineconst capi::ICU4XCollator* AsFFI() const { return this->inner.get(); } inline capi::ICU4XCollator* AsFFIMut() { return this->inner.get(); } inlineexplicit ICU4XCollator(capi::ICU4XCollator* i) : inner(i) {}
ICU4XCollator() = default;
ICU4XCollator(ICU4XCollator&&) noexcept = default;
ICU4XCollator& operator=(ICU4XCollator&& other) noexcept = default; private:
std::unique_ptr<capi::ICU4XCollator, ICU4XCollatorDeleter> 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.