25#include <com/sun/star/lang/Locale.hpp>
26#include <com/sun/star/uno/RuntimeException.hpp>
27#include <rtl/character.hxx>
29#include <unicode/uchar.h>
43const Mapping mapping_0049[] = {{0, 2, {0x0069, 0x0307, 0}},{0, 1, {0x0131, 0, 0}},{0, 1, {0x0069, 0, 0}}};
47#define langIs(lang) (aLocale.Language == lang)
50#define type_i(ch) ((ch) == 0x0069 || (ch) == 0x006a)
58 int cmv_idx = (cmi << 8) + (
ch & 0xff);
64#define accent_above(ch) (((ch) >= 0x0300 && (ch) <= 0x0314) || ((ch) >= 0x033D && (ch) <= 0x0344) || (ch) == 0x0346 || ((ch) >= 0x034A && (ch) <= 0x034C))
66const Mapping& casefolding::getConditionalValue(
const sal_Unicode* str, sal_Int32 pos, sal_Int32 len, Locale
const & aLocale,
MappingType nMappingType)
97 if (pos > 0 && rtl::isHighSurrogate(str[pos-1]) && rtl::isLowSurrogate(str[pos]))
98 return { 0, 0, { 0, 0, 0 } };
103 if (pos + 1 < len && rtl::isHighSurrogate(str[pos]) && rtl::isLowSurrogate(str[pos + 1]))
104 c = rtl::combineSurrogates(str[pos], str[pos + 1]);
108 sal_Int16 address = -1;
113 address = (address << 8) + (c & 0xFF);
118 return getConditionalValue(str, pos, len, aLocale, nMappingType);
124 return getConditionalValue(str, pos, len, aLocale, nMappingType);
147 sal_uInt32
value = c;
148 switch (nMappingType)
152 value = u_tolower(c);
156 value = u_toupper(c);
159 value = u_totitle(c);
163 value = u_foldCase(c, U_FOLD_CASE_DEFAULT);
168 dummy.nmap = rtl::splitSurrogates(value, dummy.map);
176 if (next != 0x3099 && next != 0x309a)
178 sal_Unicode c = widthfolding::getCompositionChar(current, next);
188 e = MappingElement();
195 if( e.current >= e.element.nmap ) {
196 e.element =
getValue(str, idx++, len, aLocale, nMappingType);
199 c = e.element.map[e.current++];
205 if ((0x3040 <= c && c <= 0x3094) || (0x309d <= c && c <= 0x309f))
211 static oneToOneMapping& half2fullTable = widthfolding::gethalf2fullTable();
212 c = half2fullTable[c];
213 if (0x3040 <= c && c <= 0x30ff && idx < len &&
#define MaxCaseMappingExtras
#define SAL_N_ELEMENTS(arr)
const Mapping mapping_03a3[]
const Mapping mapping_0130[]
const Mapping mapping_0069[]
const Mapping mapping_0049[]
const Mapping mapping_0307[]
const Mapping mapping_00cd[]
static bool cased_letter(sal_Unicode ch)
Mapping const CaseMappingExtra[]
const sal_Int8 CaseMappingIndex[]
const Mapping mapping_004a[]
const Mapping mapping_00cc[]
const Mapping mapping_0128[]
const Mapping mapping_012e[]
const Value CaseMappingValue[]
static bool is_ja_voice_sound_mark(sal_Unicode ¤t, sal_Unicode next)
css::beans::Optional< css::uno::Any > getValue(std::u16string_view id)
std::map< OUString, rtl::Reference< Entity > > map
TransliterationFlags
This is a superset type of the com::sun::star::i18n::TransliterationModules and TransliterationModule...
@ IGNORE_WIDTH
Ignore full width and half width character when comparing strings by transliteration service.
@ IGNORE_KANA
Ignore Hiragana and Katakana when comparing strings by transliteration service.
@ IGNORE_CASE
Ignore case when comparing strings by transliteration service.