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
"
2
#include "
zserio/SizeConvertUtil.h
"
3
#include "
zserio/Types.h
"
4
5
namespace
zserio
6
{
7
8
namespace
detail
9
{
10
11
void
validate(
BytesView
, std::string_view)
12
{
13
// always validate
14
}
15
16
BitSize
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
24
BitSize
initializeOffsets(
BytesView
bytesValue,
BitSize
bitPosition)
25
{
26
return
bitSizeOf(bytesValue, bitPosition);
27
}
28
29
}
// namespace detail
30
31
}
// namespace zserio
Bytes.h
SizeConvertUtil.h
Types.h
zserio
Definition
AllocatorHolder.h:8
zserio::BytesView
Span< const uint8_t > BytesView
Definition
Bytes.h:30
zserio::BitSize
unsigned int BitSize
Definition
BitSize.h:8
zserio::convertSizeToUInt32
uint32_t convertSizeToUInt32(size_t value)
Definition
SizeConvertUtil.cpp:11
zserio::VarSize
detail::VarIntWrapper< uint32_t, detail::VarIntType::VARSIZE > VarSize
Definition
Types.h:890
zserio
Bytes.cpp
Generated by
1.9.8