| 34 | } |
| 35 | |
| 36 | size_t OutputStream::encode(const pb_msgdesc_t* fields, const void* src_struct) |
| 37 | { |
| 38 | pb_ostream_t os{}; |
| 39 | os.state = const_cast<OutputStream*>(this); |
| 40 | os.callback = buf_write; |
| 41 | os.max_size = SIZE_MAX; |
| 42 | |
| 43 | return pb_encode(&os, fields, src_struct) ? os.bytes_written : 0; |
| 44 | } |
| 45 | |
| 46 | } // namespace Protobuf |
no outgoing calls