Zserio C++17 runtime library 1.3.0
Built for Zserio 2.20.0
Loading...
Searching...
No Matches
Bytes.cpp
Go to the documentation of this file.
1#include "zserio/Bytes.h"
3#include "zserio/Types.h"
4
5namespace zserio
6{
7
8namespace detail
9{
10
11void validate(BytesView, std::string_view)
12{
13 // always validate
14}
15
16BitSize bitSizeOf(BytesView bytesValue, BitSize)
17{
18 const VarSize bytesSize = fromCheckedValue<VarSize>(convertSizeToUInt32(bytesValue.size()));
19
20 // the bytes consists of varsize for size followed by the bytes
21 return bitSizeOf(bytesSize) + bytesSize * 8;
22}
23
24BitSize initializeOffsets(BytesView bytesValue, BitSize bitPosition)
25{
26 return bitSizeOf(bytesValue, bitPosition);
27}
28
29} // namespace detail
30
31} // namespace zserio
Span< const uint8_t > BytesView
Definition Bytes.h:30
unsigned int BitSize
Definition BitSize.h:8
uint32_t convertSizeToUInt32(size_t value)
detail::VarIntWrapper< uint32_t, detail::VarIntType::VARSIZE > VarSize
Definition Types.h:890