WPILibC++ 2025.1.1
|
Class for wrapping a nanopb ostream. More...
#include <wpi/protobuf/Protobuf.h>
Public Member Functions | |
ProtoOutputStream (pb_ostream_t *stream) | |
Constructs a nanopb ostream from an existing ostream object Generally used internally for encoding messages. | |
ProtoOutputStream (detail::SmallVectorType &out) | |
Constructs a nanopb ostream from a buffer. | |
ProtoOutputStream (detail::StdVectorType &out) | |
Constructs a nanopb ostream from a buffer. | |
ProtoOutputStream () | |
Constructs a empty nanopb stream. | |
pb_ostream_t * | Stream () noexcept |
Gets the backing nanopb stream object. | |
bool | IsSubmessage () const noexcept |
Gets if this stream points to a submessage, and will call pb_encode_submessage instead of pb_encode. | |
const pb_msgdesc_t * | MsgDesc () const noexcept |
Gets the nanopb message descriptor. | |
bool | Encode (const typename Protobuf< std::remove_cvref_t< T > >::MessageStruct &msg) |
Decodes a protobuf. | |
Class for wrapping a nanopb ostream.
|
inlineexplicit |
Constructs a nanopb ostream from an existing ostream object Generally used internally for encoding messages.
This constructor will cause Encode
to call pb_encode_submessage instead of pb_encode_ex
[in] | stream | the nanopb ostream |
|
inlineexplicit |
Constructs a nanopb ostream from a buffer.
This constructor will cause Encode
to call pb_encode_ex`
[in] | out | the stream buffer |
|
inlineexplicit |
Constructs a nanopb ostream from a buffer.
This constructor will cause Encode
to call pb_encode_ex`
[in] | out | the stream buffer |
|
inline |
Constructs a empty nanopb stream.
You must fill out the stream returned from Stream
before calling Encode.
This constructor exists to cause Encode
to call pb_encode_ex`, but allow manipulating the stream manually.
|
inline |
Decodes a protobuf.
Flags are the same flags passed to pb_decode_ex.
[in] | msg | The message to encode from |
|
inlinenoexcept |
Gets if this stream points to a submessage, and will call pb_encode_submessage instead of pb_encode.
|
inlinenoexcept |
Gets the nanopb message descriptor.
|
inlinenoexcept |
Gets the backing nanopb stream object.