Home
last modified time | relevance | path

Searched refs:offset (Results 1 - 25 of 26) sorted by relevance

12

/commonlibrary/ets_utils/js_api_module/buffer/
H A Djs_buffer.cpp212 void Buffer::WriteInt32BE(int32_t value, uint32_t offset) in WriteInt32BE() argument
217 WriteBytes(data_, 4, raw_ + byteOffset_ + offset); in WriteInt32BE()
220 int32_t Buffer::ReadInt32BE(uint32_t offset) in ReadInt32BE() argument
223 ReadBytes(data_, offset, 4); in ReadInt32BE()
228 void Buffer::WriteInt32LE(int32_t value, uint32_t offset) in WriteInt32LE() argument
233 WriteBytes(data_, 4, raw_ + byteOffset_ + offset); in WriteInt32LE()
236 int32_t Buffer::ReadInt32LE(uint32_t offset) in ReadInt32LE() argument
239 ReadBytes(data_, offset, 4); in ReadInt32LE()
244 void Buffer::WriteUInt32BE(int32_t value, uint32_t offset) in WriteUInt32BE() argument
249 WriteBytes(data_, 4, raw_ + byteOffset_ + offset); in WriteUInt32BE()
252 ReadUInt32BE(uint32_t offset) ReadUInt32BE() argument
260 WriteUInt32LE(int32_t value, uint32_t offset) WriteUInt32LE() argument
268 ReadUInt32LE(uint32_t offset) ReadUInt32LE() argument
291 ReadBytes(uint8_t *data, uint32_t offset, uint32_t length) ReadBytes() argument
318 WriteByte(uint8_t number, uint32_t offset) WriteByte() 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
375 WriteStringLoop(std::u16string value, unsigned int offset, unsigned int end) WriteStringLoop() argument
398 SetArray(vector<uint8_t> array, unsigned int offset) SetArray() argument
405 FillBuffer(Buffer *buffer, unsigned int offset, unsigned int end) FillBuffer() argument
424 FillNumber(vector<uint8_t> numbers, unsigned int offset, unsigned int end) FillNumber() argument
464 FillString(string value, unsigned int offset, unsigned int end, string encoding) FillString() argument
476 WriteString(string value, unsigned int offset, unsigned int length, string encoding) WriteString() argument
526 IndexOf(const char *data, uint32_t offset, uint32_t len, uint64_t &resultIndex) IndexOf() argument
550 LastIndexOf(const char *data, uint32_t offset, uint32_t len) LastIndexOf() argument
[all...]
H A Djs_buffer.h44 void WriteInt32BE(int32_t value, uint32_t offset);
45 void WriteInt32LE(int32_t value, uint32_t offset);
46 void WriteUInt32BE(int32_t value, uint32_t offset);
47 void WriteUInt32LE(int32_t value, uint32_t offset);
49 void ReadBytes(uint8_t *data, uint32_t offset, uint32_t length);
51 int32_t ReadInt32BE(uint32_t offset);
52 int32_t ReadInt32LE(uint32_t offset);
53 uint32_t ReadUInt32BE(uint32_t offset);
54 uint32_t ReadUInt32LE(uint32_t offset);
57 unsigned int WriteString(std::string value, unsigned int offset, unsigne
[all...]
H A Dnative_module_buffer.cpp378 size_t offset = 0; in BufferConstructorInner() local
382 if (napi_get_typedarray_info(env, argv[1], &type, &aryLen, &resultData, &resultBuffer, &offset) != napi_ok) { in BufferConstructorInner()
386 buffer->Init(reinterpret_cast<uint8_t *>(resultData) - offset, offset, aryLen); in BufferConstructorInner()
452 uint32_t offset = 0; in WriteInt32BE() local
453 Buffer *buf = GetValueOffsetAndBuf(env, info, &value, &offset); in WriteInt32BE()
455 buf->WriteInt32BE(value, offset); in WriteInt32BE()
464 uint32_t offset = 0; in ReadInt32BE() local
465 Buffer *buf = GetOffsetAndBuf(env, info, &offset); in ReadInt32BE()
468 res = buf->ReadInt32BE(offset); in ReadInt32BE()
534 uint32_t offset = 0; WriteString() local
562 uint32_t offset = 0; FillString() local
586 uint32_t offset = 0; FillNumbers() local
611 uint32_t offset = 0; FillBuffer() local
724 uint32_t offset = 0; WriteInt32LE() local
736 uint32_t offset = 0; ReadInt32LE() local
750 uint32_t offset = 0; WriteUInt32BE() local
762 uint32_t offset = 0; ReadUInt32BE() local
776 uint32_t offset = 0; WriteUInt32LE() local
788 uint32_t offset = 0; ReadUInt32LE() local
978 uint32_t offset = 0; IndexOf() local
[all...]
/commonlibrary/c_utils/base/src/
H A Dashmem.cpp255 bool Ashmem::WriteToAshmem(const void *data, int32_t size, int32_t offset) const in WriteToAshmem()
257 bool Ashmem::WriteToAshmem(const void *data, int32_t size, int32_t offset) in WriteToAshmem()
264 if (!CheckValid(size, offset, PROT_WRITE)) { in WriteToAshmem()
270 int ret = memcpy_s(tmpData + offset, memorySize_ - offset, reinterpret_cast<const char *>(data), size); in WriteToAshmem()
280 const void *Ashmem::ReadFromAshmem(int32_t size, int32_t offset) const in ReadFromAshmem()
282 const void *Ashmem::ReadFromAshmem(int32_t size, int32_t offset) in ReadFromAshmem()
285 if (!CheckValid(size, offset, PROT_READ)) { in ReadFromAshmem()
290 return reinterpret_cast<const char *>(startAddr_) + offset; in ReadFromAshmem()
293 bool Ashmem::CheckValid(int32_t size, int32_t offset, in argument
[all...]
H A Dparcel.cpp162 auto offset = objects[nextObj]; in IsReadObjectData() local
163 auto currentObject = reinterpret_cast<parcel_flat_binder_object *>(data_ + offset); in IsReadObjectData()
684 bool Parcel::WriteObjectOffset(binder_size_t offset) in WriteObjectOffset() argument
686 if (offset > dataSize_) { in WriteObjectOffset()
691 if (objectOffsets_[index] == offset) { in WriteObjectOffset()
696 objectOffsets_[objectCursor_] = offset; in WriteObjectOffset()
H A Dmapped_file.cpp30 MappedFile::MappedFile(std::string& path, MapMode mode, off_t offset, off_t size, const char *hint) in MappedFile() argument
31 :path_(path), size_(size), offset_(offset), mode_(mode), hint_(hint) {} in MappedFile()
145 // offset in Normalize()
147 UTILS_LOGE("%{public}s: Failed. Invalid offset: %{public}lld", __FUNCTION__, static_cast<long long>(offset_)); in Normalize()
429 // if not mapped, turnNext() will set offset to next page of PageSize() in TurnNext()
/commonlibrary/rust/ylong_http/ylong_http_client/src/util/h3/
H A Dio_manager.rs126 if self.send_data.buf_size == self.send_data.offset { in poll_io_send()
139 self.send_data.offset = 0; in poll_io_send()
144 &self.send_data.buf[self.send_data.offset..self.send_data.buf_size], in poll_io_send()
147 self.send_data.offset += size; in poll_io_send()
148 if self.send_data.offset != self.send_data.buf_size { in poll_io_send()
152 self.send_data.offset = 0; in poll_io_send()
214 pub(crate) offset: usize,
222 offset: 0,
/commonlibrary/c_utils/base/include/
H A Dashmem.h148 bool WriteToAshmem(const void *data, int32_t size, int32_t offset) const;
149 const void *ReadFromAshmem(int32_t size, int32_t offset) const;
197 * @brief Writes data to the `offset` position of this <b>Ashmem</b> region.
203 * @param offset Indicates the offset from the start position of the
210 bool WriteToAshmem(const void *data, int32_t size, int32_t offset);
213 * @brief Reads data from the `offset` position of this <b>Ashmem</b> region.
218 * @param offset Indicates the offset from the start position of
225 const void *ReadFromAshmem(int32_t size, int32_t offset);
[all...]
H A Dmapped_file.h51 off_t offset = 0,
141 bool ChangeOffset(off_t offset);
H A Dparcel.h204 * @brief Obtains the position (offset) of every object written
612 * @param newPosition Indicates the position, represented by the offset
622 * @param offsets Indicates the position, represented by the offset
632 * @return Returns the position, represented by the offset (in bytes)
640 * @return Returns the position, represented by the offset (in bytes)
786 * by the offset from the beginning of the data region.
788 * @param offset Indicates the position.
792 bool WriteObjectOffset(binder_size_t offset);
833 bool WriteParcelableOffset(size_t offset);
/commonlibrary/c_utils/base/src/rust/
H A Dashmem.rs94 offset: i32, in WriteToAshmem()
101 pub unsafe fn ReadFromAshmem(self: &Ashmem, size: i32, offset: i32) -> *const c_void; in ReadFromAshmem()
168 pub unsafe fn write_to_ashmem(&self, data: *const c_char, size: i32, offset: i32) -> bool { in write_to_ashmem()
170 self.c_ashmem.WriteToAshmem(c_void_ptr, size, offset) in write_to_ashmem()
184 pub unsafe fn read_from_ashmem(&self, size: i32, offset: i32) -> *const c_char { in read_from_ashmem()
185 let c_void_ptr = self.c_ashmem.ReadFromAshmem(size, offset); in read_from_ashmem()
/commonlibrary/rust/ylong_http/ylong_http_client/src/async_impl/conn/
H A Dhttp3.rs154 pub(crate) offset: usize,
188 offset: 0,
203 text_io.offset = 0; in match_channel_message()
213 text_io.offset += fill_len; in match_channel_message()
242 text_io.offset = 0; in end_read()
262 let data_len = data.len() - text_io.offset; in read_remaining_data()
267 buf.append_slice(&data[text_io.offset..text_io.offset + fill_len]); in read_remaining_data()
268 text_io.offset += fill_len; in read_remaining_data()
271 buf.append_slice(&data[text_io.offset in read_remaining_data()
[all...]
H A Dhttp2.rs202 pub(crate) offset: usize,
236 offset: 0,
251 text_io.offset = 0; in match_channel_message()
261 text_io.offset += fill_len; in match_channel_message()
294 text_io.offset = 0; in end_read()
317 let data_len = data.len() - text_io.offset; in read_remaining_data()
322 buf.append_slice(&data[text_io.offset..text_io.offset + fill_len]); in read_remaining_data()
323 text_io.offset += fill_len; in read_remaining_data()
326 buf.append_slice(&data[text_io.offset in read_remaining_data()
[all...]
/commonlibrary/rust/ylong_http/ylong_http/src/h3/qpack/
H A Ddecoder.rs114 (offset, EncoderInstruction::SetCap { capacity }) => {
115 cnt += offset;
122 offset,
129 cnt += offset;
133 offset,
140 cnt += offset;
143 (offset, EncoderInstruction::Duplicate { index }) => {
144 cnt += offset;
222 Some((offset, repr)) => match repr { in decode_buffered_repr()
228 cnt += offset; in decode_buffered_repr()
[all...]
/commonlibrary/rust/ylong_http/ylong_http/src/h3/
H A Ddecoder.rs83 offset: usize,
235 let reader = ReadableBytes::from(&stream.buffer.as_slice()[stream.offset..]); in decode()
242 let reader = ReadableBytes::from(&stream.buffer.as_slice()[stream.offset..]); in decode()
287 offset: 0,
362 self.offset = 0; in clear_buffer()
381 let mut reader = ReadableBytes::from(&self.buffer.as_slice()[self.offset..]); in decode_stream_type()
384 self.offset += reader.index(); in decode_stream_type()
399 let mut reader = ReadableBytes::from(&self.buffer.as_slice()[self.offset..]); in decode_push_id()
404 self.offset += reader.index(); in decode_push_id()
417 let mut reader = ReadableBytes::from(&self.buffer.as_slice()[self.offset in decode_frame_type()
[all...]
/commonlibrary/utils_lite/hals/file/
H A Dhal_file.c58 int HalFileSeek(int fd, int offset, unsigned int whence) in HalFileSeek() argument
60 return lseek(fd, offset, whence); in HalFileSeek()
H A Dhal_file.h37 int HalFileSeek(int fd, int offset, unsigned int whence);
/commonlibrary/utils_lite/file/src/file_impl_hal/
H A Dfile.c56 int UtilsFileSeek(int fd, int offset, unsigned int whence) in UtilsFileSeek() argument
58 return HalFileSeek(fd, offset, whence); in UtilsFileSeek()
/commonlibrary/c_utils/base/test/benchmarktest/mapped_benchmark_test/
H A Dmapped_benchmark_test.cpp100 bool SaveStringToFile(const std::string& filePath, const std::string& content, off_t offset, bool truncated /*= true*/) in SaveStringToFile() argument
118 file.seekp(offset, std::ios::beg); in SaveStringToFile()
184 // check offset in BENCHMARK_F()
290 off_t offset = 4 * 1024; in BENCHMARK_F() local
293 MappedFile mf(filename, MapMode::DEFAULT | MapMode::CREATE_IF_ABSENT, offset, size, hint); in BENCHMARK_F()
306 // Exact file size should be offset + mapped size, contents will be zero-filled. in BENCHMARK_F()
307 AssertEqual(stb.st_size, offset + size, "stb.st_size did not equal offset + size as expected.", state); in BENCHMARK_F()
311 // check specified offset in BENCHMARK_F()
312 AssertEqual(mf.StartOffset(), offset, "m in BENCHMARK_F()
1065 off_t offset = 100; // Specify offset that is not multiple of page-size. BENCHMARK_F() local
1099 off_t offset = 4 * 1024; // Specify offset excessing the substantial size of the file. BENCHMARK_F() local
1444 off_t offset = 4 * 1024; BENCHMARK_F() local
1485 off_t offset = mf.StartOffset(); BENCHMARK_F() local
1548 off_t offset = mf.StartOffset(); BENCHMARK_F() local
1621 off_t offset = mf1.StartOffset(); BENCHMARK_F() local
1679 off_t offset = mf1.StartOffset(); BENCHMARK_F() local
[all...]
/commonlibrary/c_utils/base/test/unittest/common/
H A Dutils_mapped_file_test.cpp88 bool SaveStringToFile(const std::string& filePath, const std::string& content, off_t offset, bool truncated /*= true*/) in SaveStringToFile() argument
105 file.seekp(offset, std::ios::beg); in SaveStringToFile()
324 // check offset in HWTEST_F()
421 off_t offset = 4 * 1024; in HWTEST_F() local
424 MappedFile mf(filename, MapMode::DEFAULT | MapMode::CREATE_IF_ABSENT, offset, size, hint); in HWTEST_F()
437 // Exact file size should be offset + mapped size, contents will be zero-filled. in HWTEST_F()
438 EXPECT_EQ(stb.st_size, offset + size); in HWTEST_F()
442 // check specified offset in HWTEST_F()
443 ASSERT_EQ(mf.StartOffset(), offset); in HWTEST_F()
463 SaveStringToFile(filename, toRead, offset, tru in HWTEST_F()
1004 off_t offset = 100; // Specify offset that is not multiple of page-size. HWTEST_F() local
1033 off_t offset = 4 * 1024; // Specify offset excessing the substantial size of the file. HWTEST_F() local
1319 off_t offset = 4 * 1024; HWTEST_F() local
1357 off_t offset = mf.StartOffset(); HWTEST_F() local
1406 off_t offset = mf.StartOffset(); HWTEST_F() local
1463 off_t offset = mf1.StartOffset(); HWTEST_F() local
1508 off_t offset = mf1.StartOffset(); HWTEST_F() local
[all...]
/commonlibrary/rust/ylong_runtime/ylong_runtime/src/io/buffered/
H A Dasync_buf_reader.rs229 if let Some(offset) = n.checked_sub(remainder) { in poll_seek()
232 .poll_seek(cx, SeekFrom::Current(offset)))? in poll_seek()
/commonlibrary/utils_lite/include/
H A Dutils_file.h56 * @brief Defines the offset position used by {@link UtilsFileSeek}
65 * @brief Defines the offset position used by {@link UtilsFileSeek}
74 * @brief Defines the offset position used by {@link UtilsFileSeek}
223 * @brief Adjusts the read and write position offset in a file.
225 * @param fd Indicates the file descriptor of the file where the read and write position offset needs adjustment.
226 * @param offset Indicates the offset of the read and write position based on the <b>whence</b> parameter.
228 * @param whence Indicates the start position of the offset. The following start positions are supported.
232 * ^ | Then adds the offset after the read and write position.
233 * SEEK_CUR_FS | Adds the offset afte
[all...]
/commonlibrary/ets_utils/js_api_module/buffer/test/
H A Dtest_napi.cpp253 * @tc.desc: Writes value to buf at the specified offset as big-endian. The value must be a valid signed 32-bit integer
254 * Reads a signed, big-endian 32-bit integer from buf at the specified offset.
270 * @tc.desc: Writes value to buf at the specified offset as big-endian. The value must be a valid signed 32-bit integer
271 * Reads a signed, big-endian 32-bit integer from buf at the specified offset.
287 * @tc.desc: Writes value to buf at the specified offset as big-endian. The value must be a valid signed 32-bit integer
288 * Reads a signed, big-endian 32-bit integer from buf at the specified offset.
304 * @tc.desc: Writes value to buf at the specified offset as little-endian.
306 * Reads a signed, little-endian 32-bit integer from buf at the specified offset.
324 * @tc.desc: Writes value to buf at the specified offset as little-endian.
326 * Reads a signed, little-endian 32-bit integer from buf at the specified offset
1012 unsigned int offset = 0; HWTEST_F() local
1036 unsigned int offset = 0; HWTEST_F() local
1062 unsigned int offset = 0; HWTEST_F() local
1086 unsigned int offset = 0; HWTEST_F() local
1105 unsigned int offset = 0; HWTEST_F() local
1125 unsigned int offset = 0; HWTEST_F() local
[all...]
/commonlibrary/rust/ylong_http/ylong_http/src/h2/
H A Ddecoder.rs176 offset: usize,
294 offset: 0, in default()
391 let frame_end_index = self.header.payload_length - self.offset;
393 self.offset += buf.len();
413 if self.offset != 0 {
414 self.offset = 0;
425 let buf = if self.offset != 0 { in decode_ping_payload()
427 self.offset += buf.len(); in decode_ping_payload()
457 let buf = if self.offset != 0 { in decode_priority_payload()
459 self.offset in decode_priority_payload()
[all...]
H A Dencoder.rs1451 let offset = i * 6; in ut_settings_frame_encoding()
1460 expected_encoded_settings[offset] = (id >> 8) as u8; in ut_settings_frame_encoding()
1461 expected_encoded_settings[offset + 1] = (id & 0xFF) as u8; in ut_settings_frame_encoding()
1462 expected_encoded_settings[offset + 2] = (value >> 24) as u8; in ut_settings_frame_encoding()
1463 expected_encoded_settings[offset + 3] = ((value >> 16) & 0xFF) as u8; in ut_settings_frame_encoding()
1464 expected_encoded_settings[offset + 4] = ((value >> 8) & 0xFF) as u8; in ut_settings_frame_encoding()
1465 expected_encoded_settings[offset + 5] = (value & 0xFF) as u8; in ut_settings_frame_encoding()

Completed in 23 milliseconds

12