MCPcopy Create free account
hub / github.com/chronoxor/FastBinaryEncoding / get_begin

Method get_begin

proto/enums_models.cpp:665–682  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

663}
664
665size_t FieldModel<::enums::Enums>::get_begin() const noexcept
666{
667 if ((_buffer.offset() + fbe_offset() + fbe_size()) > _buffer.size())
668 return 0;
669
670 uint32_t fbe_struct_offset = *((const uint32_t*)(_buffer.data() + _buffer.offset() + fbe_offset()));
671 assert(((fbe_struct_offset > 0) && ((_buffer.offset() + fbe_struct_offset + 4 + 4) <= _buffer.size())) && "Model is broken!");
672 if ((fbe_struct_offset == 0) || ((_buffer.offset() + fbe_struct_offset + 4 + 4) > _buffer.size()))
673 return 0;
674
675 uint32_t fbe_struct_size = *((const uint32_t*)(_buffer.data() + _buffer.offset() + fbe_struct_offset));
676 assert((fbe_struct_size >= (4 + 4)) && "Model is broken!");
677 if (fbe_struct_size < (4 + 4))
678 return 0;
679
680 _buffer.shift(fbe_struct_offset);
681 return fbe_struct_offset;
682}
683
684void FieldModel<::enums::Enums>::get_end(size_t fbe_begin) const noexcept
685{

Callers

nothing calls this directly

Calls 4

offsetMethod · 0.45
sizeMethod · 0.45
dataMethod · 0.45
shiftMethod · 0.45

Tested by

no test coverage detected