diff options
Diffstat (limited to 'unicode/unicodecpp.C')
| -rw-r--r-- | unicode/unicodecpp.C | 15 | 
1 files changed, 14 insertions, 1 deletions
| diff --git a/unicode/unicodecpp.C b/unicode/unicodecpp.C index 10156a4..babb6bb 100644 --- a/unicode/unicodecpp.C +++ b/unicode/unicodecpp.C @@ -1,5 +1,5 @@  /* -** Copyright 2011-2020 Double Precision, Inc. +** Copyright 2011-2021 Double Precision, Inc.  ** See COPYING for distribution information.  **  */ @@ -919,3 +919,16 @@ char32_t unicode::bidi_embed_paragraph_level(const std::u32string &string,  						  string.size(),  						  level);  } + +unicode_bidi_direction unicode::bidi_get_direction(const std::u32string &string, +						   size_t starting_pos, +						   size_t n) +{ +	if (starting_pos >= string.size()) +		starting_pos=string.size(); + +	if (string.size()-starting_pos < n) +		n=string.size()-starting_pos; + +	return unicode_bidi_get_direction(string.c_str()+starting_pos, n); +} | 
