commit | 364991493b41173e9b6009d234af31cacaad5b3e | [log] [tgz] |
---|---|---|
author | Wyatt Hepler <hepler@google.com> | Fri Sep 16 00:21:22 2022 +0000 |
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | Fri Sep 16 00:21:22 2022 +0000 |
tree | 0f39138cd6afc9d154e8211da7ecdcc6bece9166 | |
parent | d4260beae8c08c77390c9ca632523bb0466f24fd [diff] |
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 <hepler@google.com> Reviewed-by: Armando Montanez <amontanez@google.com> Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
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/.