|
| pbf_builder (std::string &data) noexcept |
|
template<typename P > |
| pbf_builder (pbf_writer &parent_writer, P tag) noexcept |
|
void | add_bytes (T tag, const char *value, std::size_t size) |
|
void | add_bytes (T tag, const data_view &value) |
|
void | add_bytes (T tag, const std::string &value) |
|
void | add_bytes (T tag, const char *value) |
|
template<typename... Ts> |
void | add_bytes_vectored (T tag, Ts &&... values) |
|
void | add_string (T tag, const char *value, std::size_t size) |
|
void | add_string (T tag, const data_view &value) |
|
void | add_string (T tag, const std::string &value) |
|
void | add_string (T tag, const char *value) |
|
void | add_message (T tag, const char *value, std::size_t size) |
|
void | add_message (T tag, const data_view &value) |
|
void | add_message (T tag, const std::string &value) |
|
| pbf_writer (std::string &data) noexcept |
|
| pbf_writer () noexcept=default |
|
| pbf_writer (pbf_writer &parent_writer, pbf_tag_type tag, std::size_t size=0) |
|
| pbf_writer (const pbf_writer &)=delete |
| A pbf_writer object can not be copied.
|
|
pbf_writer & | operator= (const pbf_writer &)=delete |
| A pbf_writer object can not be copied.
|
|
| pbf_writer (pbf_writer &&other) noexcept |
|
pbf_writer & | operator= (pbf_writer &&other) noexcept |
|
bool | valid () const noexcept |
|
void | swap (pbf_writer &other) noexcept |
|
void | reserve (std::size_t size) |
|
void | commit () |
|
void | rollback () |
|
void | add_bool (pbf_tag_type tag, bool value) |
|
void | add_enum (pbf_tag_type tag, int32_t value) |
|
void | add_int32 (pbf_tag_type tag, int32_t value) |
|
void | add_sint32 (pbf_tag_type tag, int32_t value) |
|
void | add_uint32 (pbf_tag_type tag, uint32_t value) |
|
void | add_int64 (pbf_tag_type tag, int64_t value) |
|
void | add_sint64 (pbf_tag_type tag, int64_t value) |
|
void | add_uint64 (pbf_tag_type tag, uint64_t value) |
|
void | add_fixed32 (pbf_tag_type tag, uint32_t value) |
|
void | add_sfixed32 (pbf_tag_type tag, int32_t value) |
|
void | add_fixed64 (pbf_tag_type tag, uint64_t value) |
|
void | add_sfixed64 (pbf_tag_type tag, int64_t value) |
|
void | add_float (pbf_tag_type tag, float value) |
|
void | add_double (pbf_tag_type tag, double value) |
|
void | add_bytes (pbf_tag_type tag, const char *value, std::size_t size) |
|
void | add_bytes (pbf_tag_type tag, const data_view &value) |
|
void | add_bytes (pbf_tag_type tag, const std::string &value) |
|
void | add_bytes (pbf_tag_type tag, const char *value) |
|
template<typename... Ts> |
void | add_bytes_vectored (pbf_tag_type tag, Ts &&... values) |
|
void | add_string (pbf_tag_type tag, const char *value, std::size_t size) |
|
void | add_string (pbf_tag_type tag, const data_view &value) |
|
void | add_string (pbf_tag_type tag, const std::string &value) |
|
void | add_string (pbf_tag_type tag, const char *value) |
|
void | add_message (pbf_tag_type tag, const char *value, std::size_t size) |
|
void | add_message (pbf_tag_type tag, const data_view &value) |
|
void | add_message (pbf_tag_type tag, const std::string &value) |
|
template<typename InputIterator > |
void | add_packed_bool (pbf_tag_type tag, InputIterator first, InputIterator last) |
|
template<typename InputIterator > |
void | add_packed_enum (pbf_tag_type tag, InputIterator first, InputIterator last) |
|
template<typename InputIterator > |
void | add_packed_int32 (pbf_tag_type tag, InputIterator first, InputIterator last) |
|
template<typename InputIterator > |
void | add_packed_sint32 (pbf_tag_type tag, InputIterator first, InputIterator last) |
|
template<typename InputIterator > |
void | add_packed_uint32 (pbf_tag_type tag, InputIterator first, InputIterator last) |
|
template<typename InputIterator > |
void | add_packed_int64 (pbf_tag_type tag, InputIterator first, InputIterator last) |
|
template<typename InputIterator > |
void | add_packed_sint64 (pbf_tag_type tag, InputIterator first, InputIterator last) |
|
template<typename InputIterator > |
void | add_packed_uint64 (pbf_tag_type tag, InputIterator first, InputIterator last) |
|
template<typename InputIterator > |
void | add_packed_fixed32 (pbf_tag_type tag, InputIterator first, InputIterator last) |
|
template<typename InputIterator > |
void | add_packed_sfixed32 (pbf_tag_type tag, InputIterator first, InputIterator last) |
|
template<typename InputIterator > |
void | add_packed_fixed64 (pbf_tag_type tag, InputIterator first, InputIterator last) |
|
template<typename InputIterator > |
void | add_packed_sfixed64 (pbf_tag_type tag, InputIterator first, InputIterator last) |
|
template<typename InputIterator > |
void | add_packed_float (pbf_tag_type tag, InputIterator first, InputIterator last) |
|
template<typename InputIterator > |
void | add_packed_double (pbf_tag_type tag, InputIterator first, InputIterator last) |
|
template<typename T>
class protozero::pbf_builder< T >
The pbf_builder is used to write PBF formatted messages into a buffer. It is based on the pbf_writer class and has all the same methods. The difference is that while the pbf_writer class takes an integer tag, this template class takes a tag of the template type T. The idea is that T will be an enumeration value and this helps reduce the possibility of programming errors.
Almost all methods in this class can throw an std::bad_alloc exception if the std::string used as a buffer wants to resize.
Read the tutorial to understand how this class is used.