PrevUpHomeNext

Function template bidirectional_subranges

boost::text::v1::bidirectional_subranges

Synopsis

// In header: <boost/text/bidirectional.hpp>


template<code_point_range R, typename Extent, 
         line_break_cp_extent_func< std::ranges::iterator_t< R >, Extent > Func> 
  unspecified bidirectional_subranges(R && r, Extent max_extent, 
                                      Func cp_extent, 
                                      int paragraph_embedding_level = -1, 
                                      bool break_overlong_lines = true);

Description

Returns a view of code point subranges in range; each subrange is one of three kinds: a forward-subrange; a reverse-subrange; or a one-code-point subrange used to subtitute a reversed bracketing code point (e.g. <lsquo></lsquo><rsquo></rsquo>[') for its couterpart (e.g.']'`). There is a single iterator type used in the resulting subranges, so this distinction is not exposed in the subrange API.

Line breaks are determined within the algorithm by calling lines(first, last, max_extent, cp_extent, break_overlong_lines). Note that Func must have a polymorphic call operator. That is, it must be a template or generic lambda that accepts two parameters whose type models code_point_iter.

If a non-negative paragraph_embedding_level is provided, it will be used instead of the initial paragraph embedding level computed by the bidirectional algorithm. This applies to all paragraphs found in range.

Code points that are used to control the left-to-right or right-to-left direction of code points within the text will not appear in the output. The Unicode bidirectional algorithm specifies that code points with classes RLE, LRE, RLO, LRO, PDF, and BN not appear in the output; this implementation additionally removes code points with classes FSI, LRI, RLI, and PDI.

Extent must model std::integral or std::floating_point.

Returns a view of grapheme subranges in range; each subrange is one of three kinds: a forward-subrange; a reverse-subrange; or a one-grapheme subrange used to subtitute a reversed bracketing grapheme (e.g. <lsquo></lsquo><rsquo></rsquo>[') for its couterpart (e.g.']'`). There is a single iterator type used in the resulting subranges, so this distinction is not exposed in the subrange API.

Line breaks are determined within the algorithm by calling lines(first, last, max_extent, cp_extent, break_overlong_lines). Note that Func must have a polymorphic call operator. That is, it must be a template or generic lambda that accepts two parameters whose type models code_point_iter.

If a non-negative paragraph_embedding_level is provided, it will be used instead of the initial paragraph embedding level computed by the bidirectional algorithm. This applies to all paragraphs found in range.

Graphemes that are used to control the left-to-right or right-to-left direction of graphemes within the text will not appear in the output. The Unicode bidirectional algorithm specifies that graphemes with classes RLE, LRE, RLO, LRO, PDF, and BN not appear in the output; this implementation additionally removes graphemes with classes FSI, LRI, RLI, and PDI.


PrevUpHomeNext