ICU4X
International Components for Unicode
Loading...
Searching...
No Matches
ICU4XBidi Class Reference

#include <ICU4XBidi.hpp>

Public Member Functions

std::optional< ICU4XBidiInfofor_text (const std::string_view text, uint8_t default_level) const
 
ICU4XReorderedIndexMap reorder_visual (const diplomat::span< const uint8_t > levels) const
 
 ICU4XBidi (capi::ICU4XBidi *i)
 
 ICU4XBidi ()=default
 
 ICU4XBidi (ICU4XBidi &&) noexcept=default
 
ICU4XBidioperator= (ICU4XBidi &&other) noexcept=default
 

Static Public Member Functions

static diplomat::result< ICU4XBidi, ICU4XErrorcreate (const ICU4XDataProvider &provider)
 
static bool level_is_rtl (uint8_t level)
 
static bool level_is_ltr (uint8_t level)
 
static uint8_t level_rtl ()
 
static uint8_t level_ltr ()
 

Detailed Description

An ICU4X Bidi object, containing loaded bidi data

See the Rust documentation for BidiClassAdapter for more information.

Constructor & Destructor Documentation

◆ ICU4XBidi() [1/3]

ICU4XBidi::ICU4XBidi ( capi::ICU4XBidi * i)
inlineexplicit

◆ ICU4XBidi() [2/3]

ICU4XBidi::ICU4XBidi ( )
default

◆ ICU4XBidi() [3/3]

ICU4XBidi::ICU4XBidi ( ICU4XBidi && )
defaultnoexcept

Member Function Documentation

◆ create()

diplomat::result< ICU4XBidi, ICU4XError > ICU4XBidi::create ( const ICU4XDataProvider & provider)
inlinestatic

Creates a new [ICU4XBidi] from locale data.

See the Rust documentation for new for more information.

◆ for_text()

std::optional< ICU4XBidiInfo > ICU4XBidi::for_text ( const std::string_view text,
uint8_t default_level ) const
inline

Use the data loaded in this object to process a string and calculate bidi information

Takes in a Level for the default level, if it is an invalid value it will default to LTR

Returns nothing if text is invalid UTF-8.

See the Rust documentation for new_with_data_source for more information.

Lifetimes: text must live at least as long as the output.

◆ level_is_ltr()

bool ICU4XBidi::level_is_ltr ( uint8_t level)
inlinestatic

Check if a Level returned by level_at is an LTR level.

Invalid levels (numbers greater than 125) will be assumed LTR

See the Rust documentation for is_ltr for more information.

◆ level_is_rtl()

bool ICU4XBidi::level_is_rtl ( uint8_t level)
inlinestatic

Check if a Level returned by level_at is an RTL level.

Invalid levels (numbers greater than 125) will be assumed LTR

See the Rust documentation for is_rtl for more information.

◆ level_ltr()

uint8_t ICU4XBidi::level_ltr ( )
inlinestatic

Get a simple LTR Level value

See the Rust documentation for ltr for more information.

◆ level_rtl()

uint8_t ICU4XBidi::level_rtl ( )
inlinestatic

Get a basic RTL Level value

See the Rust documentation for rtl for more information.

◆ operator=()

ICU4XBidi & ICU4XBidi::operator= ( ICU4XBidi && other)
defaultnoexcept

◆ reorder_visual()

ICU4XReorderedIndexMap ICU4XBidi::reorder_visual ( const diplomat::span< const uint8_t > levels) const
inline

Utility function for producing reorderings given a list of levels

Produces a map saying which visual index maps to which source index.

The levels array must not have values greater than 126 (this is the Bidi maximum explicit depth plus one). Failure to follow this invariant may lead to incorrect results, but is still safe.

See the Rust documentation for reorder_visual for more information.


The documentation for this class was generated from the following file: