/** * A destruction policy for using ICU4XBidiParagraph with std::unique_ptr.
*/ struct ICU4XBidiParagraphDeleter { voidoperator()(capi::ICU4XBidiParagraph* l) const noexcept {
capi::ICU4XBidiParagraph_destroy(l);
}
};
/** * Bidi information for a single processed paragraph
*/ class ICU4XBidiParagraph { public:
/** * Given a paragraph index `n` within the surrounding text, this sets this * object to the paragraph at that index. Returns `ICU4XError::OutOfBoundsError` when out of bounds. * * This is equivalent to calling `paragraph_at()` on `ICU4XBidiInfo` but doesn't * create a new object
*/
diplomat::result<std::monostate, ICU4XError> set_paragraph_in_text(size_t n);
/** * The start index of this paragraph within the source text
*/
size_t range_start() const;
/** * The end index of this paragraph within the source text
*/
size_t range_end() const;
/** * Reorder a line based on display order. The ranges are specified relative to the source text and must be contained * within this paragraph's range. * * See the [Rust documentation for `level_at`](https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.Paragraph.html#method.level_at) for more information.
*/ template<typename W> diplomat::result<std::monostate, ICU4XError> reorder_line_to_writeable(size_t range_start, size_t range_end, W& out) const;
/** * Reorder a line based on display order. The ranges are specified relative to the source text and must be contained * within this paragraph's range. * * See the [Rust documentation for `level_at`](https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.Paragraph.html#method.level_at) for more information.
*/
diplomat::result<std::string, ICU4XError> reorder_line(size_t range_start, size_t range_end) const;
/** * Get the BIDI level at a particular byte index in this paragraph. * This integer is conceptually a `unicode_bidi::Level`, * and can be further inspected using the static methods on ICU4XBidi. * * Returns 0 (equivalent to `Level::ltr()`) on error * * See the [Rust documentation for `level_at`](https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.Paragraph.html#method.level_at) for more information.
*/
uint8_t level_at(size_t pos) const; inlineconst capi::ICU4XBidiParagraph* AsFFI() const { return this->inner.get(); } inline capi::ICU4XBidiParagraph* AsFFIMut() { return this->inner.get(); } inlineexplicit ICU4XBidiParagraph(capi::ICU4XBidiParagraph* i) : inner(i) {}
ICU4XBidiParagraph() = default;
ICU4XBidiParagraph(ICU4XBidiParagraph&&) noexcept = default;
ICU4XBidiParagraph& operator=(ICU4XBidiParagraph&& other) noexcept = default; private:
std::unique_ptr<capi::ICU4XBidiParagraph, ICU4XBidiParagraphDeleter> 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.