Lines Matching refs:maxLength
241 int TextCoder::Utf8ToGsm7bit(uint8_t *dest, int maxLength, const uint8_t *src, int srcLength, MSG_L… in Utf8ToGsm7bit() argument
247 if (srcLength <= 0 || src == nullptr || dest == nullptr || maxLength <= 0) { in Utf8ToGsm7bit()
270 … return Ucs2ToGsm7bit(dest, maxLength, reinterpret_cast<uint8_t *>(pUcs2Text), ucs2Length, langId); in Utf8ToGsm7bit()
273 int TextCoder::Utf8ToUcs2(uint8_t *dest, int maxLength, const uint8_t *src, int srcLength) in Utf8ToUcs2() argument
279 if (srcLength <= 0 || src == nullptr || dest == nullptr || maxLength <= 0) { in Utf8ToUcs2()
286 gsize remainedLength = static_cast<gsize>(maxLength); in Utf8ToUcs2()
294 return (err != 0) ? -1 : (maxLength - static_cast<int>(remainedLength)); in Utf8ToUcs2()
297 int TextCoder::GsmUtf8ToAuto(uint8_t *dest, int maxLength, const uint8_t *src, int srcLength, DataC… in GsmUtf8ToAuto() argument
318 tempTextLen = (srcLength > maxLength) ? maxLength : srcLength; in GsmUtf8ToAuto()
325 …int gsm7bitLength = Ucs2ToGsm7bitAuto(dest, maxLength, reinterpret_cast<uint8_t *>(pUcs2Text), ucs… in GsmUtf8ToAuto()
331 tempTextLen = (ucs2Length > maxLength) ? maxLength : ucs2Length; in GsmUtf8ToAuto()
341 int TextCoder::CdmaUtf8ToAuto(uint8_t *dest, int maxLength, const uint8_t *src, int srcLength, Data… in CdmaUtf8ToAuto() argument
362 tempTextLen = (srcLength > maxLength) ? maxLength : srcLength; in CdmaUtf8ToAuto()
369 …int gsm7bitLength = Ucs2ToAscii(dest, maxLength, reinterpret_cast<uint8_t *>(pUcs2Text), ucs2Lengt… in CdmaUtf8ToAuto()
375 tempTextLen = (ucs2Length > maxLength) ? maxLength : ucs2Length; in CdmaUtf8ToAuto()
392 uint8_t *dest, int maxLength, const uint8_t *src, int srcLength, const MsgLangInfo &langInfo) in Gsm7bitToUtf8() argument
410 TELEPHONY_LOGI("max dest Length = %{public}d", maxLength); in Gsm7bitToUtf8()
413 if (ucs2Length > maxLength) { in Gsm7bitToUtf8()
417 return Ucs2ToUtf8(dest, maxLength, reinterpret_cast<uint8_t *>(pUcs2Text), ucs2Length); in Gsm7bitToUtf8()
420 int TextCoder::Ucs2ToUtf8(uint8_t *dest, int maxLength, const uint8_t *src, int srcLength) in Ucs2ToUtf8() argument
426 if (srcLength <= 0 || src == nullptr || dest == nullptr || maxLength <= 0) { in Ucs2ToUtf8()
433 gsize remainedLength = static_cast<gsize>(maxLength); in Ucs2ToUtf8()
443 int utf8Length = maxLength - static_cast<int>(remainedLength); in Ucs2ToUtf8()
444 if (utf8Length < 0 || utf8Length >= maxLength) { in Ucs2ToUtf8()
451 int TextCoder::EuckrToUtf8(uint8_t *dest, int maxLength, const uint8_t *src, int srcLength) in EuckrToUtf8() argument
457 if (srcLength <= 0 || src == nullptr || dest == nullptr || maxLength <= 0) { in EuckrToUtf8()
463 gsize remainedLength = static_cast<gsize>(maxLength); in EuckrToUtf8()
474 int utf8Length = maxLength - static_cast<int>(remainedLength); in EuckrToUtf8()
475 if (utf8Length < 0 || utf8Length >= maxLength) { in EuckrToUtf8()
482 int TextCoder::ShiftjisToUtf8(uint8_t *dest, int maxLength, const uint8_t *src, int srcLength) const in ShiftjisToUtf8() argument
488 if (srcLength <= 0 || src == nullptr || dest == nullptr || maxLength <= 0) { in ShiftjisToUtf8()
494 gsize remainedLength = static_cast<gsize>(maxLength); in ShiftjisToUtf8()
503 int utf8Length = maxLength - static_cast<int>(remainedLength); in ShiftjisToUtf8()
504 if (utf8Length < 0 || utf8Length >= maxLength) { in ShiftjisToUtf8()
511 int TextCoder::Ucs2ToGsm7bit(uint8_t *dest, int maxLength, const uint8_t *src, int srcLength, MSG_L… in Ucs2ToGsm7bit() argument
513 if (srcLength <= 0 || src == nullptr || dest == nullptr || maxLength <= 0) { in Ucs2ToGsm7bit()
531 remainLen = maxLength - outTextLen; in Ucs2ToGsm7bit()
536 remainLen = maxLength - outTextLen; in Ucs2ToGsm7bit()
541 remainLen = maxLength - outTextLen; in Ucs2ToGsm7bit()
546 remainLen = maxLength - outTextLen; in Ucs2ToGsm7bit()
556 if (maxLength <= outTextLen) { in Ucs2ToGsm7bit()
564 int TextCoder::Ucs2ToGsm7bitAuto(uint8_t *dest, int maxLength, const uint8_t *src, int srcLength, b… in Ucs2ToGsm7bitAuto() argument
566 if (srcLength <= 0 || src == nullptr || dest == nullptr || maxLength <= 0) { in Ucs2ToGsm7bitAuto()
588 if (maxLength <= outTextLen + 1) { in Ucs2ToGsm7bitAuto()
596 if (maxLength <= outTextLen) { in Ucs2ToGsm7bitAuto()
604 int TextCoder::Ucs2ToAscii(uint8_t *dest, int maxLength, const uint8_t *src, int srcLength, bool &u… in Ucs2ToAscii() argument
606 if (srcLength <= 0 || src == nullptr || dest == nullptr || maxLength <= 0) { in Ucs2ToAscii()
626 if (maxLength <= outTextLen) { in Ucs2ToAscii()
662 int TextCoder::FindGsm7bitExt(uint8_t *dest, int maxLength, const uint16_t inText) in FindGsm7bitExt() argument
665 if (dest == nullptr || maxLength <= 0) { in FindGsm7bitExt()
676 if (maxLength <= outTextLen + 1) { in FindGsm7bitExt()
685 int TextCoder::FindTurkish(uint8_t *dest, int maxLength, const uint16_t inText) in FindTurkish() argument
688 if (dest == nullptr || maxLength <= 0) { in FindTurkish()
699 if (maxLength <= outTextLen + 1) { in FindTurkish()
708 int TextCoder::FindSpanish(uint8_t *dest, int maxLength, const uint16_t inText) in FindSpanish() argument
711 if (dest == nullptr || maxLength <= 0) { in FindSpanish()
722 if (maxLength <= outTextLen + 1) { in FindSpanish()
731 int TextCoder::FindPortu(uint8_t *dest, int maxLength, const uint16_t inText) in FindPortu() argument
734 if (dest == nullptr || maxLength <= 0) { in FindPortu()
745 if (maxLength <= outTextLen + 1) { in FindPortu()
767 uint8_t *dest, int maxLength, const uint8_t *src, int srcLength, const MsgLangInfo &langInfo) in Gsm7bitToUcs2() argument
769 if (srcLength == 0 || src == nullptr || dest == nullptr || maxLength <= 0) { in Gsm7bitToUcs2()
778 for (int i = 0; i < srcLength && maxLength > UCS2_LEN_MIN; i++) { in Gsm7bitToUcs2()
801 maxLength -= 0x02; in Gsm7bitToUcs2()