Lines Matching refs:maxLength

390     inline size_t CopyDataUtf8(uint8_t *buf, size_t maxLength, bool modify = true) const
392 if (maxLength == 0) {
393 return 1; // maxLength was -1 at napi
396 if (length > maxLength) {
400 buf[maxLength - 1] = '\0';
402 return CopyDataRegionUtf8(buf, 0, length, maxLength, modify) + 1; // add place for zero in the end
405 // It allows user to copy into buffer even if maxLength < length
406 inline size_t WriteUtf8(uint8_t *buf, size_t maxLength, bool isWriteBuffer = false) const
408 if (maxLength == 0) {
409 return 1; // maxLength was -1 at napi
412 buf[maxLength - 1] = '\0';
413 return CopyDataRegionUtf8(buf, 0, GetLength(), maxLength, true, isWriteBuffer) + 1;
442 // It allows user to copy into buffer even if maxLength < length
452 size_t WriteOneByte(uint8_t *buf, size_t maxLength) const
454 if (maxLength == 0) {
458 buf[maxLength - 1] = '\0';
463 if (length > maxLength) {
464 length = maxLength;
466 if (memcpy_s(buf, maxLength, data, length) != EOK) {
475 if (length > maxLength) {
476 return base::utf_helper::ConvertRegionUtf16ToLatin1(data, buf, maxLength, maxLength);
478 return base::utf_helper::ConvertRegionUtf16ToLatin1(data, buf, length, maxLength);
481 size_t CopyDataRegionUtf8(uint8_t *buf, size_t start, size_t length, size_t maxLength,
495 // Only copy maxLength number of chars into buffer if length > maxLength
496 auto dataLen = std::min(length, maxLength);
502 if (length > maxLength) {
503 return base::utf_helper::ConvertRegionUtf16ToUtf8(data, buf, maxLength, maxLength, start,
506 return base::utf_helper::ConvertRegionUtf16ToUtf8(data, buf, length, maxLength, start,
510 inline uint32_t CopyDataUtf16(uint16_t *buf, uint32_t maxLength) const
513 if (length > maxLength) {
520 if (memcpy_s(buf, maxLength * sizeof(uint16_t), data, length * sizeof(uint16_t)) != EOK) {
528 return base::utf_helper::ConvertRegionUtf8ToUtf16(data, buf, length, maxLength);
715 static void WriteToFlat(EcmaString *src, Char *buf, uint32_t maxLength);
1257 uint32_t WriteToFlatUtf8(uint8_t *buf, uint32_t maxLength, bool isWriteBuffer = false)
1259 return string_->WriteUtf8(buf, maxLength, isWriteBuffer);
1267 uint32_t WriteToOneByte(uint8_t *buf, uint32_t maxLength)
1269 return string_->WriteOneByte(buf, maxLength);
1274 uint32_t WriteToFlatUtf16(uint16_t *buf, uint32_t maxLength) const
1276 return string_->CopyDataUtf16(buf, maxLength);
1286 static void WriteToFlat(EcmaString *src, Char *buf, uint32_t maxLength)
1288 src->WriteToFlat(src, buf, maxLength);