22#include <com/sun/star/i18n/MultipleCharsOutputException.hpp>
23#include <com/sun/star/i18n/TransliterationType.hpp>
25#include <rtl/ustring.hxx>
26#include <rtl/ustrbuf.hxx>
37 return TransliterationType::ONE_TO_ONE| TransliterationType::IGNORE;
45 sal_uInt16 address =
idx[0][
ch>>8];
46 if (address != 0xFFFF)
48 &
idx[2][
idx[1][address + (
ch & 0xFF)]]);
58 const sal_Unicode * chArr = inStr.getStr() + startPos;
63 if (startPos +
nCount > inStr.getLength())
64 nCount = inStr.getLength() - startPos;
66 auto ppOffset = pOffset ? pOffset->getArray() :
nullptr;
74 ppOffset[
i + 1] = (*pOffset)[
i] + pron.getLength();
76 return sb.makeStringAndClear();
89 if (!pron || !pron[0])
92 throw MultipleCharsOutputException();
98 const OUString & str2, sal_Int32 pos2, sal_Int32 nCount2, sal_Int32 & nMatch2)
104 if (nCount1 + pos1 > str1.getLength())
105 nCount1 = str1.getLength() - pos1;
107 if (nCount2 + pos2 > str2.getLength())
108 nCount2 = str2.getLength() - pos2;
110 realCount = std::min(nCount1, nCount2);
112 s1 = str1.getStr() + pos1;
113 s2 = str2.getStr() + pos2;
114 for (
i = 0;
i < realCount;
i++) {
117 if (pron1 != pron2) {
118 nMatch1 = nMatch2 =
i;
122 nMatch1 = nMatch2 = realCount;
123 return (nCount1 == nCount2);
126#ifdef DISABLE_DYNLOADING
130sal_uInt16
const ** get_zh_zhuyin(sal_Int16 & max_index);
131sal_uInt16
const ** get_zh_pinyin(sal_Int16 & max_index);
137TextToPinyin_zh_CN::TextToPinyin_zh_CN() :
138#ifndef DISABLE_DYNLOADING
139 TextToPronounce_zh(
"get_zh_pinyin")
141 TextToPronounce_zh(get_zh_pinyin)
148TextToChuyin_zh_TW::TextToChuyin_zh_TW() :
149#ifndef DISABLE_DYNLOADING
150 TextToPronounce_zh(
"get_zh_zhuyin")
152 TextToPronounce_zh(get_zh_zhuyin)
159#ifndef DISABLE_DYNLOADING
170 hModule = osl_loadModuleRelative(
171 &
thisModule, lib.pData, SAL_LOADMODULE_DEFAULT );
174 sal_uInt16
const ** (*function)(sal_Int16 &) =
reinterpret_cast<sal_uInt16
const ** (*)(sal_Int16 &)
>(osl_getFunctionSymbol(
hModule, OUString::createFromAscii(func_name).
pData));
191#ifndef DISABLE_DYNLOADING
OUString foldingImpl(const OUString &inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 > *pOffset) override
sal_Unicode SAL_CALL transliterateChar2Char(sal_Unicode inChar) override
sal_Int16 SAL_CALL getType() override
const sal_Unicode * getPronounce(const sal_Unicode ch)
virtual ~TextToPronounce_zh() override
TextToPronounce_zh(const char *func_name)
sal_Bool SAL_CALL equals(const OUString &str1, sal_Int32 pos1, sal_Int32 nCount1, sal_Int32 &nMatch1, const OUString &str2, sal_Int32 pos2, sal_Int32 nCount2, sal_Int32 &nMatch2) override
OUString SAL_CALL transliterateChar2String(sal_Unicode inChar) override
const char * transliterationName
const char * implementationName
std::unique_ptr< sal_Int32[]> pData
Constant values shared between i18npool and, for example, the number formatter.
constexpr T & temporary(T &&x)