unicode::bidi - Man Page

unicode bi-directional algorithm

Synopsis

#include <courier-unicode.h>
struct unicode::bidi_calc_types {
  bidi_calc_types(const std::u32string & string);
  std::vector<unicode_bidi_type_t> types ;
  void setbnl(std::u32string & string);
}.fi

std::tuple<std::vector<unicode_bidi_level_t>, struct unicode_bidi_direction> unicode::bidi_calc(const unicode::bidi_calc_types &ustring);

std::tuple<std::vector<unicode_bidi_level_t>, struct unicode_bidi_direction> unicode::bidi_calc(const unicode::bidi_calc_types &ustring, unicode_bidi_level_t embedding_level);

int unicode::bidi_reorder(std::u32string &string, std::vector<unicode_bidi_level_t> &embedding_level, const std::function<void (size_t, size_t)> &reorder_callback=[](size_t, size_t){}, size_t starting_pos=0, size_t n=(size_t)-1);

void unicode::bidi_reorder(std::vector<unicode_bidi_level_t> &embedding_level, const std::function<void (size_t, size_t)> &reorder_callback=[](size_t, size_t){}, size_t starting_pos=0, size_t n=(size_t)-1);

void unicode::bidi_cleanup(std::u32string &string, const std::function<void (size_t)> &removed_callback=[](size_t){}, int cleanup_options);

int unicode::bidi_cleanup(std::u32string &string, std::vector <unicode_bidi_level_t> &levels, const std::function<void (size_t)> &removed_callback=[](size_t){}, int cleanup_options=0);

int unicode::bidi_cleanup(std::u32string &string, std::vector <unicode_bidi_level_t> &levels, const std::function<void (size_t)> &removed_callback, int cleanup_options, size_t starting_pos, size_t n);

int unicode::bidi_logical_order(std::u32string &string, std::vector <unicode_bidi_level_t> &levels, unicode_bidi_level_t paragraph_embedding, const std::function<void (size_t, size_t)> &reorder_callback=[](size_t, size_t){}, size_t starting_pos=0, size_t n=(size_t)-1);

void unicode::bidi_combinings(const std::u32string &string, const std::vector <unicode_bidi_level_t> &levels, const std::function <void (unicode_bidi_level_t level, size_t level_start, size_t n_chars, size_t comb_start, size_t n_comb_chars)> &callback);

void unicode::bidi_combinings(const std::u32string &string, const std::function <void (unicode_bidi_level_t level, size_t level_start, size_t n_chars, size_t comb_start, size_t n_comb_chars)> &callback);

void unicode::bidi_logical_order(std::vector <unicode_bidi_level_t> &levels, unicode_bidi_level_t paragraph_embedding, const std::function<void (size_t, size_t)> &reorder_callback, size_t starting_pos=0, size_t n=(size_t)-1);

bool unicode::bidi_needs_embed(const std::u32string &string, const std::vector <unicode_bidi_level_t> &levels, const unicode_bidi_level_t (paragraph_embedding=NULL, size_t starting_pos=0, size_t n=(size_t)-1);

int unicode::bidi_embed(const std::u32string &string, const std::vector <unicode_bidi_level_t> &levels, unicode_bidi_level_t paragraph_embedding, const std::function<void (const char32_t *, size_t, bool)> &callback);

std::u32string unicode::bidi_embed(const std::u32string &string, const std::vector <unicode_bidi_level_t> &levels, unicode_bidi_level_t paragraph_embedding);

char32_t unicode_bidi_embed_paragraph_level(const std::u32string &string, unicode_bidi_level_t paragraph_embedding);

unicode_bidi_direction bidi_get_direction(const std::u32string &string, size_t starting_pos=0, size_t n=(size_t)-1);

std::u32string bidi_override(const std::u32string &string, unicode_bidi_level_t direction, int cleanup_options=0);

Description

These functions implement the C++ interface for the Unicode Bi-Directional algorithm[1]. See the description of the underlying unicode_bidi(3) C library API for more information. C++ specific notes:

unicode::literals namespace

using namespace unicode::literals;

std::u32string foo(std::u32string bar)
{
	return bar + LRO;
}

This namespace contains the following constexpr definitions:

  • char32_t arrays with literal Unicode character strings containing Unicode directional, isolate, and override markers, like LRO, RLO and others.
  • CLEANUP_EXTRA, CLEANUP_BNL, and CLEANUP_CANONICAL options for unicode::bidi_cleanup().

See Also

courier-unicode(7), unicode_bidi(3).

Author

Sam Varshavchik

Author

Notes

1.

Unicode Bi-Directional algorithm
https://www.unicode.org/reports/tr9/tr9-42.html

Referenced By

courier-unicode(7), unicode_bidi(3).

The man pages unicode::bidi_calc(3), unicode::bidi_calc_types(3), unicode::bidi_cleanup(3), unicode::bidi_combinings(3), unicode::bidi_embed(3), unicode::bidi_embed_paragraph_level(3), unicode::bidi_get_direction(3), unicode::bidi_logical_order(3), unicode::bidi_needs_embed(3), unicode::bidi_override(3) and unicode::bidi_reorder(3) are aliases of unicode::bidi(3).

05/31/2022 Courier Unicode Library