Zserio C++17 runtime library 1.3.0
Built for Zserio 2.20.0
Loading...
Searching...
No Matches
String.cpp
Go to the documentation of this file.
2#include "zserio/String.h"
3#include "zserio/Types.h"
4
5namespace zserio
6{
7
8namespace detail
9{
10
11void validate(std::string_view, std::string_view)
12{
13 // always validate
14}
15
16BitSize bitSizeOf(std::string_view stringValue, BitSize)
17{
18 const VarSize stringSize = fromCheckedValue<VarSize>(convertSizeToUInt32(stringValue.size()));
19
20 // the string consists of varsize for size followed by the UTF-8 encoded string
21 return bitSizeOf(stringSize) + stringSize * 8;
22}
23
24BitSize initializeOffsets(std::string_view stringValue, BitSize bitPosition)
25{
26 return bitSizeOf(stringValue, bitPosition);
27}
28
29} // namespace detail
30
31} // namespace zserio
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