/** * A destruction policy for using ICU4XReorderedIndexMap with std::unique_ptr.
*/ struct ICU4XReorderedIndexMapDeleter { voidoperator()(capi::ICU4XReorderedIndexMap* l) const noexcept {
capi::ICU4XReorderedIndexMap_destroy(l);
}
};
/** * Thin wrapper around a vector that maps visual indices to source indices * * `map[visualIndex] = sourceIndex` * * Produced by `reorder_visual()` on [`ICU4XBidi`].
*/ class ICU4XReorderedIndexMap { public:
/** * Get this as a slice/array of indices * * Lifetimes: `this` must live at least as long as the output.
*/ const diplomat::span<const size_t> as_slice() const;
/** * The length of this map
*/
size_t len() const;
/** * Whether this map is empty
*/ bool is_empty() const;
/** * Get element at `index`. Returns 0 when out of bounds * (note that 0 is also a valid in-bounds value, please use `len()` * to avoid out-of-bounds)
*/
size_t get(size_t index) const; inlineconst capi::ICU4XReorderedIndexMap* AsFFI() const { return this->inner.get(); } inline capi::ICU4XReorderedIndexMap* AsFFIMut() { return this->inner.get(); } inlineexplicit ICU4XReorderedIndexMap(capi::ICU4XReorderedIndexMap* i) : inner(i) {}
ICU4XReorderedIndexMap() = default;
ICU4XReorderedIndexMap(ICU4XReorderedIndexMap&&) noexcept = default;
ICU4XReorderedIndexMap& operator=(ICU4XReorderedIndexMap&& other) noexcept = default; private:
std::unique_ptr<capi::ICU4XReorderedIndexMap, ICU4XReorderedIndexMapDeleter> 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.