• Home
  • Raw
  • Download

Lines Matching refs:pos

40 Iterator writeBigEndian(T value, Iterator pos) {
42 *pos++ = static_cast<uint8_t>(value >> (8 * (sizeof(value) - 1)));
45 return pos;
268 uint8_t* encodeHeader(MajorType type, uint64_t addlInfo, uint8_t* pos, const uint8_t* end) { in encodeHeader() argument
270 if (end - pos < static_cast<ssize_t>(sz)) return nullptr; in encodeHeader()
273 *pos++ = type | static_cast<uint8_t>(addlInfo); in encodeHeader()
274 return pos; in encodeHeader()
276 *pos++ = type | ONE_BYTE_LENGTH; in encodeHeader()
277 *pos++ = static_cast<uint8_t>(addlInfo); in encodeHeader()
278 return pos; in encodeHeader()
280 *pos++ = type | TWO_BYTE_LENGTH; in encodeHeader()
281 return writeBigEndian(static_cast<uint16_t>(addlInfo), pos); in encodeHeader()
283 *pos++ = type | FOUR_BYTE_LENGTH; in encodeHeader()
284 return writeBigEndian(static_cast<uint32_t>(addlInfo), pos); in encodeHeader()
286 *pos++ = type | EIGHT_BYTE_LENGTH; in encodeHeader()
287 return writeBigEndian(addlInfo, pos); in encodeHeader()
381 uint8_t* Bstr::encode(uint8_t* pos, const uint8_t* end) const { in encode() argument
382 pos = encodeHeader(mValue.size(), pos, end); in encode()
383 if (!pos || end - pos < static_cast<ptrdiff_t>(mValue.size())) return nullptr; in encode()
384 return std::copy(mValue.begin(), mValue.end(), pos); in encode()
393 uint8_t* ViewBstr::encode(uint8_t* pos, const uint8_t* end) const { in encode() argument
394 pos = encodeHeader(mView.size(), pos, end); in encode()
395 if (!pos || end - pos < static_cast<ptrdiff_t>(mView.size())) return nullptr; in encode()
396 return std::copy(mView.begin(), mView.end(), pos); in encode()
405 uint8_t* Tstr::encode(uint8_t* pos, const uint8_t* end) const { in encode() argument
406 pos = encodeHeader(mValue.size(), pos, end); in encode()
407 if (!pos || end - pos < static_cast<ptrdiff_t>(mValue.size())) return nullptr; in encode()
408 return std::copy(mValue.begin(), mValue.end(), pos); in encode()
417 uint8_t* ViewTstr::encode(uint8_t* pos, const uint8_t* end) const { in encode() argument
418 pos = encodeHeader(mView.size(), pos, end); in encode()
419 if (!pos || end - pos < static_cast<ptrdiff_t>(mView.size())) return nullptr; in encode()
420 return std::copy(mView.begin(), mView.end(), pos); in encode()
437 uint8_t* Array::encode(uint8_t* pos, const uint8_t* end) const { in encode() argument
438 pos = encodeHeader(size(), pos, end); in encode()
439 if (!pos) return nullptr; in encode()
441 pos = entry->encode(pos, end); in encode()
442 if (!pos) return nullptr; in encode()
444 return pos; in encode()
471 uint8_t* Map::encode(uint8_t* pos, const uint8_t* end) const { in encode() argument
472 pos = encodeHeader(size(), pos, end); in encode()
473 if (!pos) return nullptr; in encode()
475 pos = entry.first->encode(pos, end); in encode()
476 if (!pos) return nullptr; in encode()
477 pos = entry.second->encode(pos, end); in encode()
478 if (!pos) return nullptr; in encode()
480 return pos; in encode()
565 uint8_t* SemanticTag::encode(uint8_t* pos, const uint8_t* end) const { in encode() argument
568 pos = ::cppbor::encodeHeader(kMajorType, mValue, pos, end); in encode()
569 if (!pos) return nullptr; in encode()
570 return mTaggedItem->encode(pos, end); in encode()