|author||Wyatt Hepler <firstname.lastname@example.org>||Fri Sep 16 00:21:22 2022 +0000|
|committer||CQ Bot Account <email@example.com>||Fri Sep 16 00:21:22 2022 +0000|
pw_protobuf: Distinguish between string and bytes fields Use a MessageField bit to indicate that the field is a string field, as opposed to a bytes field. Dedicating a bit to one specific type is an inefficient use of the field_info_ bits, but there were bits to spare and this was the simplest way to do this. If more field_info_ bits are needed in the future, a few of the existing fields could be consolidated into a single 4-bit field_type that specifies that precise type (e.g. int32, fixed64, message, etc.). It is necessary to distinguish between string and bytes in order to switch from using pw::Vector<char> to pw::InlineString<> for string fields. This change also updates C++ codegen to include /*attr_name=*/ comments for bool arguments to improve readability. Change-Id: I31a918e8716f330eefddcf22b844d693d382b688 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/110231 Pigweed-Auto-Submit: Wyatt Hepler <firstname.lastname@example.org> Reviewed-by: Armando Montanez <email@example.com> Commit-Queue: Auto-Submit <firstname.lastname@example.org>
Pigweed is an open source collection of embedded-targeted libraries–or as we like to call them, modules. These modules are building blocks and infrastructure that enable faster and more reliable development on small-footprint MMU-less 32-bit microcontrollers like the STMicroelectronics STM32L452 or the Nordic nRF52832.
For more information please see our website: https://pigweed.dev/.