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

Method verify

proto/proto_models.cpp:59–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59bool FieldModel<::proto::Order>::verify(bool fbe_verify_type) const noexcept
60{
61 if ((_buffer.offset() + fbe_offset() + fbe_size()) > _buffer.size())
62 return true;
63
64 uint32_t fbe_struct_offset = *((const uint32_t*)(_buffer.data() + _buffer.offset() + fbe_offset()));
65 if ((fbe_struct_offset == 0) || ((_buffer.offset() + fbe_struct_offset + 4 + 4) > _buffer.size()))
66 return false;
67
68 uint32_t fbe_struct_size = *((const uint32_t*)(_buffer.data() + _buffer.offset() + fbe_struct_offset));
69 if (fbe_struct_size < (4 + 4))
70 return false;
71
72 uint32_t fbe_struct_type = *((const uint32_t*)(_buffer.data() + _buffer.offset() + fbe_struct_offset + 4));
73 if (fbe_verify_type && (fbe_struct_type != fbe_type()))
74 return false;
75
76 _buffer.shift(fbe_struct_offset);
77 bool fbe_result = verify_fields(fbe_struct_size);
78 _buffer.unshift(fbe_struct_offset);
79 return fbe_result;
80}
81
82bool FieldModel<::proto::Order>::verify_fields(size_t fbe_struct_size) const noexcept
83{

Callers 1

verify_fieldsMethod · 0.45

Calls 8

offsetMethod · 0.45
sizeMethod · 0.45
dataMethod · 0.45
shiftMethod · 0.45
unshiftMethod · 0.45
bufferMethod · 0.45
fbe_offsetMethod · 0.45
fbe_sizeMethod · 0.45

Tested by

no test coverage detected