Calculate the actual length an SwString will be including the terminating null character padding to bring it to the next uint32_t boundary but minus the leading uint32_t encoding the size to allow the offset to be correctly updated when decoding a binary packet.
| 20 | // padding to bring it to the next uint32_t boundary but minus the leading uint32_t encoding |
| 21 | // the size to allow the offset to be correctly updated when decoding a binary packet. |
| 22 | uint32_t CalculateSizeOfPaddedSwString(const std::string& str) |
| 23 | { |
| 24 | std::vector<uint32_t> swTraceString; |
| 25 | StringToSwTraceString<SwTraceCharPolicy>(str, swTraceString); |
| 26 | unsigned int uint32_t_size = sizeof(uint32_t); |
| 27 | uint32_t size = (numeric_cast<uint32_t>(swTraceString.size()) - 1) * uint32_t_size; |
| 28 | return size; |
| 29 | } |
| 30 | |
| 31 | // Read TimelineMessageDirectoryPacket from given IPacketBuffer and offset |
| 32 | SwTraceMessage ReadSwTraceMessage(const unsigned char* packetBuffer, |
no test coverage detected