Lines Matching refs:maxLength

240 int TextCoder::Utf8ToGsm7bit(uint8_t *dest, int maxLength, const uint8_t *src, int srcLength, MSG_LANGUAGE_ID_T &langId)
246 if (srcLength <= 0 || src == nullptr || dest == nullptr || maxLength <= 0) {
269 return Ucs2ToGsm7bit(dest, maxLength, reinterpret_cast<uint8_t *>(pUcs2Text), ucs2Length, langId);
272 int TextCoder::Utf8ToUcs2(uint8_t *dest, int maxLength, const uint8_t *src, int srcLength)
278 if (srcLength <= 0 || src == nullptr || dest == nullptr || maxLength <= 0) {
285 gsize remainedLength = static_cast<gsize>(maxLength);
293 return (err != 0) ? -1 : (maxLength - static_cast<int>(remainedLength));
296 int TextCoder::GsmUtf8ToAuto(uint8_t *dest, int maxLength, const uint8_t *src, int srcLength,
318 tempTextLen = (srcLength > maxLength) ? maxLength : srcLength;
325 int length = Ucs2ToGsm7bitAuto(dest, maxLength, reinterpret_cast<uint8_t *>(pUcs2Text), ucs2Length,
332 tempTextLen = (ucs2Length > maxLength) ? maxLength : ucs2Length;
343 int TextCoder::CdmaUtf8ToAuto(uint8_t *dest, int maxLength, const uint8_t *src, int srcLength, DataCodingScheme &scheme)
364 tempTextLen = (srcLength > maxLength) ? maxLength : srcLength;
371 int gsm7bitLength = Ucs2ToAscii(dest, maxLength, reinterpret_cast<uint8_t *>(pUcs2Text), ucs2Length, unknown);
377 tempTextLen = (ucs2Length > maxLength) ? maxLength : ucs2Length;
394 uint8_t *dest, int maxLength, const uint8_t *src, int srcLength, const MsgLangInfo &langInfo)
411 TELEPHONY_LOGI("max dest Length = %{public}d, srcLength = %{public}d", maxLength, srcLength);
414 if (ucs2Length > maxLength) {
415 // Usually, maxLength is a large number, like 1530, 4200. But when you decode the address, maxLength is only 21.
418 // If the value of maxLength is large(1530 4200), and the first condition is met, this condition is also met,
421 TELEPHONY_LOGI("src over size, ucs2Length = %{public}d, maxLength = %{public}d", ucs2Length,
426 return Ucs2ToUtf8(dest, maxLength, reinterpret_cast<uint8_t *>(pUcs2Text), ucs2Length);
429 int TextCoder::Ucs2ToUtf8(uint8_t *dest, int maxLength, const uint8_t *src, int srcLength)
436 if (srcLength <= 0 || src == nullptr || dest == nullptr || maxLength <= 0) {
443 gsize remainedLength = static_cast<gsize>(maxLength);
453 int length = maxLength - static_cast<int>(remainedLength);
454 if (length < 0 || length >= maxLength) {
460 int TextCoder::EuckrToUtf8(uint8_t *dest, int maxLength, const uint8_t *src, int srcLength)
466 if (srcLength <= 0 || src == nullptr || dest == nullptr || maxLength <= 0) {
471 gsize remainedLength = static_cast<gsize>(maxLength);
483 int utf8Length = maxLength - static_cast<int>(remainedLength);
484 if (utf8Length < 0 || utf8Length >= maxLength) {
491 int TextCoder::ShiftjisToUtf8(uint8_t *dest, int maxLength, const uint8_t *src, int srcLength) const
497 if (srcLength <= 0 || src == nullptr || dest == nullptr || maxLength <= 0) {
503 gsize remainedLength = static_cast<gsize>(maxLength);
512 int utf8Length = maxLength - static_cast<int>(remainedLength);
513 if (utf8Length < 0 || utf8Length >= maxLength) {
520 int TextCoder::Ucs2ToGsm7bit(uint8_t *dest, int maxLength, const uint8_t *src, int srcLength, MSG_LANGUAGE_ID_T &langId)
522 if (srcLength <= 0 || src == nullptr || dest == nullptr || maxLength <= 0) {
540 remainLen = maxLength - outTextLen;
545 remainLen = maxLength - outTextLen;
550 remainLen = maxLength - outTextLen;
555 remainLen = maxLength - outTextLen;
565 if (maxLength <= outTextLen) {
596 int TextCoder::Ucs2ToGsm7bitAuto(uint8_t *dest, int maxLength, const uint8_t *src, int srcLength,
599 if (srcLength <= 0 || src == nullptr || dest == nullptr || maxLength <= 0) {
622 if (maxLength <= outTextLen + 1) {
630 if (maxLength <= outTextLen) {
638 int TextCoder::Ucs2ToAscii(uint8_t *dest, int maxLength, const uint8_t *src, int srcLength, bool &unknown)
640 if (srcLength <= 0 || src == nullptr || dest == nullptr || maxLength <= 0) {
660 if (maxLength <= outTextLen) {
696 int TextCoder::FindGsm7bitExt(uint8_t *dest, int maxLength, const uint16_t inText)
699 if (dest == nullptr || maxLength <= 0) {
710 if (maxLength <= outTextLen + 1) {
719 int TextCoder::FindTurkish(uint8_t *dest, int maxLength, const uint16_t inText)
722 if (dest == nullptr || maxLength <= 0) {
733 if (maxLength <= outTextLen + 1) {
742 int TextCoder::FindSpanish(uint8_t *dest, int maxLength, const uint16_t inText)
745 if (dest == nullptr || maxLength <= 0) {
756 if (maxLength <= outTextLen + 1) {
765 int TextCoder::FindPortu(uint8_t *dest, int maxLength, const uint16_t inText)
768 if (dest == nullptr || maxLength <= 0) {
779 if (maxLength <= outTextLen + 1) {
801 uint8_t *dest, int maxLength, const uint8_t *src, int srcLength, const MsgLangInfo &langInfo)
803 if (srcLength == 0 || src == nullptr || dest == nullptr || maxLength <= 0) {
812 for (int i = 0; i < srcLength && maxLength > UCS2_LEN_MIN; i++) {
835 maxLength -= 0x02;