/commonlibrary/ets_utils/js_api_module/buffer/ |
H A D | js_blob.cpp | 21 void Blob::Init(uint8_t *blob, unsigned int length) in Init() argument 24 this->raw_ = reinterpret_cast<uint8_t *>(malloc(length)); in Init() 28 this->length_ = length; in Init() 29 if (memcpy_s(raw_, length, blob, length) != EOK) { in Init() 30 HILOG_FATAL("Blob constructor(length) memcpy_s failed"); in Init() 66 unsigned int length = static_cast<unsigned int>(end - start); in Init() local 67 length = blob->length_ > length ? length in Init() 116 ReadBytes(uint8_t *data, int length) ReadBytes() argument [all...] |
H A D | js_buffer.cpp | 52 void Buffer::Init(Buffer *pool, unsigned int poolOffset, unsigned int length) in Init() argument 57 this->length_ = length; in Init() 62 void Buffer::Init(uint8_t *buffer, unsigned int byteOffset, unsigned int length) in Init() argument 66 this->length_ = length; in Init() 158 int Buffer::Compare(Buffer *tBuf, uint32_t targetStart, uint32_t sourceStart, uint32_t length) in Compare() argument 165 return memcmp(dest, src, length); in Compare() 291 void Buffer::ReadBytes(uint8_t *data, uint32_t offset, uint32_t length) in ReadBytes() argument 297 if (length == 0) { in ReadBytes() 301 if (memcpy_s(data, length, raw_ + byteOffset_ + offset, length) ! in ReadBytes() 306 ReadBytesForArrayBuffer(void *data, uint32_t length) ReadBytesForArrayBuffer() argument 330 WriteString(string value, unsigned int offset, unsigned int length) WriteString() argument 337 WriteStringLoop(string value, unsigned int offset, unsigned int end, unsigned int length) WriteStringLoop() argument 369 WriteString(std::u16string value, unsigned int offset, unsigned int length) WriteString() argument 476 WriteString(string value, unsigned int offset, unsigned int length, string encoding) WriteString() argument 490 ToBase64(uint32_t start, uint32_t length) ToBase64() argument 508 ToBase64Url(uint32_t start, uint32_t length) ToBase64Url() argument [all...] |
H A D | js_buffer.h | 35 void Init(Buffer *pool, unsigned int poolOffset, unsigned int length); 36 void Init(uint8_t *buffer, unsigned int byteOffset, unsigned int length); 49 void ReadBytes(uint8_t *data, uint32_t offset, uint32_t length); 50 void ReadBytesForArrayBuffer(void *data, uint32_t length); 57 unsigned int WriteString(std::string value, unsigned int offset, unsigned int length); 58 unsigned int WriteString(std::u16string value, unsigned int offset, unsigned int length); 59 unsigned int WriteString(std::string value, unsigned int offset, unsigned int length, std::string encoding); 63 int Compare(Buffer *tBuf, uint32_t targetStart, uint32_t sourceStart, uint32_t length); 66 std::string ToBase64(uint32_t start, uint32_t length); 67 std::string ToBase64Url(uint32_t start, uint32_t length); [all...] |
H A D | native_module_buffer.cpp | 99 buffer->WriteString(utf8Str, utf8Str.length()); in FromStringUtf8() 127 // 2 : the size of string is 2 times of u16str's length in FromStringUtf16LE() 164 buffer->WriteString(strDecoded, strDecoded.length()); in FromStringHex() 165 buffer->SetLength(strDecoded.length()); in FromStringHex() 210 uint32_t length = 0; in GetArray() local 211 napi_get_array_length(env, arr, &length); in GetArray() 214 for (size_t i = 0; i < length; i++) { in GetArray() 299 static Buffer* DealParaTypeBuffer(napi_env env, size_t argc, napi_value* argv, uint32_t length, Buffer*& buffer) in DealParaTypeBuffer() argument 310 napi_get_value_uint32(env, argv[3], &length) != napi_ok) { // 3 : the forth argument in DealParaTypeBuffer() 313 buffer->Init(valueBuffer, poolOffset, length); in DealParaTypeBuffer() 325 uint32_t length = 0; InitAnyArrayBuffer() local 341 buffer->Init(reinterpret_cast<uint8_t*>(data), byteOffset, length); InitAnyArrayBuffer() local 348 buffer->Init(reinterpret_cast<uint8_t*>(data), byteOffset, length); InitAnyArrayBuffer() local 359 uint32_t length = 0; BufferConstructorInner() local 535 uint32_t length = 0; WriteString() local 649 uint32_t length = buf->GetLength(); GetBufferData() local 675 uint32_t length = buf->GetLength(); GetArrayBuffer() local 857 uint32_t length = 0; Compare() local 893 uint32_t length = end - start; ToUtf8() local 914 uint32_t length = end - start; ToBase64() local 933 uint32_t length = end - start; ToBase64Url() local [all...] |
H A D | js_blob.h | 32 void Init(uint8_t *blob, unsigned int length); 39 void ReadBytes(uint8_t *data, int length);
|
/commonlibrary/rust/ylong_http/ylong_http_client/tests/tcp_server/ |
H A D | mod.rs | 91 let mut length = 0; variables 101 length += request_line.len(); 105 length += host.len(); 110 length += header_str.len(); 113 length += crlf.len(); 114 length += $req_body.len(); 116 if length > size { 119 assert_eq!(size + size2, length, "Incorrect total request bytes !"); 121 assert_eq!(size, length, "Incorrect total request bytes !"); 194 let mut length variables [all...] |
/commonlibrary/ets_utils/js_util_module/util/ |
H A D | js_textdecoder.cpp | 79 std::pair<char *, bool> TextDecoder::ConvertToChar(UChar *uchar, size_t length, char *tempCharArray) in ConvertToChar() argument 82 if (CanBeCompressed(uint16Data, length)) { in ConvertToChar() 83 if (length <= 0) { in ConvertToChar() 84 HILOG_ERROR("textencoder:: length is error"); in ConvertToChar() 88 if (length <= TEMP_CHAR_LENGTH) { in ConvertToChar() 91 strUtf8 = new (std::nothrow) char[length]; in ConvertToChar() 97 for (size_t i = 0; i < length; ++i) { in ConvertToChar() 112 size_t length = 0; in Decode() local 116 NAPI_CALL(env, napi_get_typedarray_info(env, src, &type, &length, &data, &arrayBuffer, &byteOffset)); in Decode() 117 const char *source = ReplaceNull(data, length); in Decode() 139 ucnv_toUnicode(GetConverterPtr(), &target, target + len, &source, source + length, nullptr, flush, &codeFlag); Decode() local 162 GetResultStr(napi_env env, UChar *arrDat, size_t length) GetResultStr() argument 197 size_t length = 0; DecodeToString() local 218 ucnv_toUnicode(GetConverterPtr(), &target, target + len, &source, source + length, nullptr, flush, &codeFlag); DecodeToString() local [all...] |
H A D | js_base64.cpp | 51 size_t length = 0;
in EncodeSync() local 53 napi_get_typedarray_info(env, src, &type, &length, &resultData, nullptr, nullptr);
in EncodeSync() 54 if (type != napi_uint8_array || length == 0) {
in EncodeSync() 56 "Parameter error. The type of Parameter must be Uint8Array and the length greater than zero.");
in EncodeSync() 60 unsigned char *rets = EncodeAchieve(inputEncode_, length, valueType);
in EncodeSync() 84 size_t length = 0;
in EncodeToStringSync() local 86 napi_get_typedarray_info(env, src, &type, &length, &resultData, nullptr, nullptr);
in EncodeToStringSync() 87 if (type != napi_uint8_array || length == 0) {
in EncodeToStringSync() 89 "Parameter error. The type of Parameter must be Uint8Array and the length greater than zero.");
in EncodeToStringSync() 93 unsigned char *ret = EncodeAchieve(inputEncode_, length, valueTyp in EncodeToStringSync() 202 size_t length = 0; DecodeSyncInner() local 367 size_t length = 0; Encode() local 384 size_t length = 0; EncodeToString() local 398 CreateEncodePromise(napi_env env, unsigned char *inputDecode, size_t length, Type valueType) CreateEncodePromise() argument 417 CreateEncodeToStringPromise(napi_env env, unsigned char *inputDecode, size_t length, Type valueType) CreateEncodeToStringPromise() argument 568 size_t length = 0; Decode() local 608 CreateDecodePromise(napi_env env, char *inputDecode, size_t length, Type valueType) CreateDecodePromise() argument [all...] |
H A D | js_textencoder.cpp | 28 NAPI_CALL(env, napi_create_string_utf8(env, orgEncoding_.c_str(), orgEncoding_.length(), &result));
in GetEncoding() 53 size_t length = 0;
in EncodeInto() local 56 NAPI_CALL(env, napi_get_typedarray_info(env, dest, &type, &length, &resultData, &resultBuffer, &byteOffset));
in EncodeInto() 63 EncodeToUtf8(encodeInfo, writeResult, &written, length, &nchars);
in EncodeInto()
|
H A D | js_stringdecoder.cpp | 32 size_t length = 0; in Write() local 43 napi_get_typedarray_info(env, src, &type, &length, &data, &arrayBuffer, &byteOffset); in Write() 45 size_t limit = static_cast<size_t>(ucnv_getMinCharSize(conv_)) * length; in Write() 56 ucnv_toUnicode(conv_, &target, target + len, &source, source + length, nullptr, flush, &codeFlag); in Write() 65 pend_ = source + length - pendingLen_; in Write()
|
H A D | js_textdecoder.h | 135 std::pair<char *, bool> ConvertToChar(UChar* uchar, size_t length, char* tempCharArray); 136 napi_value GetResultStr(napi_env env, UChar *arrDat, size_t length); 141 const char* ReplaceNull(void *data, size_t length) const;
|
/commonlibrary/ets_utils/platform/ohos/ |
H A D | util_helper.cpp | 45 std::string ConvertToString(UChar * uchar, size_t length) in ConvertToString() argument 108 void EncodeToUtf8(TextEcodeInfo encodeInfo, char* writeResult, uint32_t* written, size_t length, int32_t* nchars) in EncodeToUtf8() argument 111 EncodeTo16BE(encodeInfo, writeResult, written, length, nchars); in EncodeToUtf8() 113 OtherEncodeUtf8(encodeInfo, writeResult, written, length, nchars); in EncodeToUtf8() 123 outLen = u16Str.length() * 2; // 2:multiple in EncodeConversion() 135 outLen = u16LEStr.length() * 2; // 2:multiple in EncodeConversion() 178 std::string::size_type len = u8Str.length(); in Utf8ToUtf16BE() 235 for (unsigned int i = 0; i < wstr.length(); i++) { in Utf16BEToLE() 271 outLens = buffer.length(); in OtherEncode() 279 if (memcpy_s(writeResult + resultShifting, buffer.length(), in OtherEncode() 357 OtherEncodeUtf8(TextEcodeInfo encodeInfo, char* writeResult, uint32_t* written, size_t length, int32_t* nchar) OtherEncodeUtf8() argument 397 EncodeTo16BE(TextEcodeInfo encodeInfo, char* writeResult, uint32_t* written, size_t length, int32_t* nchars) EncodeTo16BE() argument [all...] |
/commonlibrary/ets_utils/platform/ |
H A D | util_helper.h | 57 OutBufferInfo(size_t length, std::string inputStr, size_t bufferLength, size_t cnt, std::string bufferRst) in OutBufferInfo() 58 : writedSize(length), in OutBufferInfo() 78 std::string ConvertToString(UChar* uchar, size_t length); 81 void EncodeToUtf8(TextEcodeInfo encodeInfo, char* writeResult, uint32_t* written, size_t length, int32_t* nchars); 91 void OtherEncodeUtf8(TextEcodeInfo encodeInfo, char* writeResult, uint32_t* written, size_t length, 93 void EncodeTo16BE(TextEcodeInfo encodeInfo, char* writeResult, uint32_t* written, size_t length, int32_t* nchars);
|
/commonlibrary/ets_utils/platform/default/ |
H A D | util_helper.cpp | 64 std::string ConvertToString(UChar * uchar, size_t length) in ConvertToString() argument 69 for (size_t i = 0; i < length; ++i) { in ConvertToString() 94 size_t outLen = buffer.length(); in EncodeConversion() 104 void EncodeToUtf8(TextEcodeInfo encodeInfo, char* writeResult, uint32_t* written, size_t length, int32_t* nchars) in EncodeToUtf8() argument 107 engine->EncodeToUtf8(encodeInfo.src, writeResult, written, length, nchars); in EncodeToUtf8()
|
/commonlibrary/ets_utils/js_sys_module/console/ |
H A D | console.cpp | 165 size_t length = number; in StringRepeat() local 166 for (size_t i = 0; i < length; i++) { in StringRepeat() 285 size_t length = groupIndent.size(); in GroupEnd() local 286 if (length > GROUPINDETATIONWIDTH) { in GroupEnd() 287 groupIndent = groupIndent.substr(0, length - GROUPINDETATIONWIDTH); in GroupEnd() 309 size_t length = columnWidths.size(); in RenderHead() local 310 for (size_t i = 0; i < length; i++) { in RenderHead() 325 if (i != length - 1) { in RenderHead() 346 stringLen = result.size(); // If element type is undefined, length is 0. in GetStringAndStringWidth() 353 size_t length in PrintRows() local 377 GraphTable(napi_env env, napi_value head, napi_value columns, const size_t& length) GraphTable() argument 447 GetValueArray(napi_env env, napi_value map, const size_t& length, napi_value keyArray) GetValueArray() argument 486 SetPrimitive(napi_env env, napi_value map, const size_t& length, napi_value valuesKeyArray, napi_value outputKeysArray, napi_value outputValuesArray) SetPrimitive() argument 540 InitializeValuesKeyArray(napi_env env, napi_value valuesKeyArray, uint32_t length) InitializeValuesKeyArray() argument 553 uint32_t length = 0; ProcessTabularData() local [all...] |
/commonlibrary/rust/ylong_http/ylong_http/src/body/mime/ |
H A D | simple.rs | 89 /// length of every parts, such as boundaries, headers, bodies, etc. 103 size += part.length?; in total_bytes() 280 length: Option<u64>, 299 length: None, in new() 352 /// Sets the length of body of this `Part`. 354 /// The length message will be set to `Content-Length` header. 361 /// let part = Part::new().length(Some(8)).body("xiaoming"); 363 pub fn length(mut self, length: Option<u64>) -> Self { in length() functions 364 self.length in length() [all...] |
/commonlibrary/c_utils/base/src/ |
H A D | string_ex.cpp | 54 strTmp.replace(pos, src.length(), dst); in ReplaceStr() 55 pos += dst.length(); in ReplaceStr() 213 string::size_type rightPos = str.find(right, leftPos + left.length()); in GetFirstSubStrBetween() 218 sub = str.substr((leftPos + left.length()), (rightPos - (leftPos + left.length()))); in GetFirstSubStrBetween() 248 size_t strLen = str.length(); in IsAsciiString() 281 size_t str16Len = str16.length(); in GetUtf16ToUtf8Length() 294 size_t str16Len = str16.length(); in Char16ToChar8()
|
H A D | parcel.cpp | 566 int32_t dataLength = value.length(); in WriteString() 586 int32_t dataLength = value.length(); in WriteString16() 667 const uint8_t *Parcel::ReadBuffer(size_t length, bool isValidate) in ReadBuffer() argument 669 if (GetReadableBytes() >= length) { in ReadBuffer() 672 size_t upperBound = readCursor_ + length; in ReadBuffer() 677 readCursor_ += length; in ReadBuffer() 821 const uint8_t *Parcel::ReadBuffer(size_t length) in ReadBuffer() argument 823 if (GetReadableBytes() >= length) { in ReadBuffer() 826 size_t upperBound = readCursor_ + length; in ReadBuffer() 831 readCursor_ += length; in ReadBuffer() 838 BasicReadBuffer([[maybe_unused]]size_t length) BasicReadBuffer() argument 855 ReadUnpadBuffer(size_t length) ReadUnpadBuffer() argument [all...] |
/commonlibrary/rust/ylong_http/ylong_http/src/h3/qpack/format/ |
H A D | decoder.rs | 518 length: IntegerDecoder, 522 fn new(is_huffman: bool, length: IntegerDecoder) -> Self { in new() 523 Self { is_huffman, length } in new() 534 match (self.length.next_byte(buf[buf_index - 1]), self.is_huffman) { in decode() 537 (Ok(Some(length)), true) => { in decode() 538 let res = HuffmanStringBytes::new(length).decode(&buf[buf_index..]); in decode() 545 (Ok(Some(length)), false) => { in decode() 546 let res = AsciiStringBytes::new(length).decode(&buf[buf_index..]); in decode() 561 length: usize, 565 fn new(length [all...] |
/commonlibrary/rust/ylong_http/ylong_http_client/src/async_impl/conn/ |
H A D | http1.rs | 209 let length = match BodyLengthParser::new(message.request.ref_mut().method(), &part).parse() { in decode_response() 210 Ok(length) => length, in decode_response() 217 let body = HttpBody::new(message.interceptor, length, Box::new(conn), pre)?; in decode_response()
|
/commonlibrary/ets_utils/js_concurrent_module/worker/test/ |
H A D | test_worker.cpp | 294 napi_create_string_utf8(env, funcName.c_str(), funcName.length(), &funcValue); in TestHostOnMessageInner() 329 napi_create_string_utf8(env, instanceName.c_str(), instanceName.length(), &args[0]); in HostOnGlobalCall() 330 napi_create_string_utf8(env, methodName.c_str(), methodName.length(), &args[1]); in HostOnGlobalCall() 352 napi_create_string_utf8(env, instanceName.c_str(), instanceName.length(), &args[0]); in HostOnGlobalCallInner001() 353 napi_create_string_utf8(env, methodName.c_str(), methodName.length(), &args[1]); in HostOnGlobalCallInner001() 378 napi_create_string_utf8(env, instanceName.c_str(), instanceName.length(), &args[0]); in HostOnGlobalCallInner002() 379 napi_create_string_utf8(env, methodName.c_str(), methodName.length(), &args[1]); in HostOnGlobalCallInner002() 393 napi_create_string_utf8(env, methodName.c_str(), methodName.length(), &methodValue); in HostOnGlobalCallInner002() 407 napi_create_string_utf8(env, instanceName.c_str(), instanceName.length(), &args[0]); in HostOnGlobalCallInner003() 408 napi_create_string_utf8(env, methodName.c_str(), methodName.length(), in HostOnGlobalCallInner003() [all...] |
/commonlibrary/rust/ylong_http/ylong_http/src/h3/qpack/ |
H A D | integer.rs | 28 pub(crate) fn length(length: usize, is_huffman: bool) -> Self { 30 int: IntegerEncoder::new(pre_mask(is_huffman), length, 0x7f),
|
/commonlibrary/rust/ylong_runtime/ylong_io/src/sys/unix/tcp/ |
H A D | listener.rs | 58 let mut length = size_of::<sockaddr_storage>() as socklen_t; in accept() variables 64 &mut length, in accept() 77 &mut length in accept()
|
/commonlibrary/ets_utils/js_api_module/xml/ |
H A D | js_xml.cpp | 75 size_t subLen = subStr.length(); in Replace() 76 size_t step = repStr.length(); in Replace() 97 size_t iLenTemp = out_.length(); in SetDeclaration() 120 size_t iLenTemp = out_.length(); in SetNamespace() 158 size_t iLenTemp = out_.length(); in StartElement() 180 size_t iLenTemp = out_.length(); in SetAttributes() 199 iLenTemp = out_.length(); in EndElement() 223 iLenTemp = out_.length(); in EndElement() 247 size_t iLenTemp = out_.length(); in AddEmptyElement() 266 size_t iLenTemp = out_.length(); in SetText() [all...] |
/commonlibrary/ets_utils/js_sys_module/test/ |
H A D | test_process.cpp | 110 napi_create_string_utf8(env, command.c_str(), command.length(), &temp); in HWTEST_F() 135 napi_create_string_utf8(env, command.c_str(), command.length(), &temp); in HWTEST_F() 160 napi_create_string_utf8(env, command.c_str(), command.length(), &temp); in HWTEST_F() 182 napi_create_string_utf8(env, command.c_str(), command.length(), &temp); in HWTEST_F() 318 napi_create_string_utf8(env, command.c_str(), command.length(), &temp); in HWTEST_F() 343 napi_create_string_utf8(env, command.c_str(), command.length(), &temp); in HWTEST_F() 388 napi_create_string_utf8(env, catalogue.c_str(), catalogue.length(), &temp); in HWTEST_F() 421 napi_create_string_utf8(env, cbNameEvent.c_str(), cbNameEvent.length(), &temp); in HWTEST_F() 444 napi_create_string_utf8(env, cbNameEvent.c_str(), cbNameEvent.length(), &temp); in HWTEST_F() 541 napi_create_string_utf8(env, envVar.c_str(), envVar.length(), in HWTEST_F() [all...] |