PB_HTYPE_OPTIONAL 0x10 Use separate *has_<field>* boolean to specify
whether the field is present.
PB_HTYPE_ARRAY 0x20 A repeated field with preallocated array.
+ Separate *<field>_count* for number of items.
PB_HTYPE_CALLBACK 0x30 A field with dynamic storage size, data is
actually a pointer to a structure containing a
callback function.
This function only considers the LTYPE of the field. You can use it from your field callbacks, because the source generator writes correct LTYPE also for callback type fields.
+Wire type mapping is as follows:
+
+========================= ============
+LTYPEs Wire type
+========================= ============
+VARINT, SVARINT PB_WT_VARINT
+FIXED with data_size == 8 PB_WT_64BIT
+STRING, BYTES, SUBMESSAGE PB_WT_STRING
+FIXED with data_size == 4 PB_WT_32BIT
+========================= ============
+
pb_encode_string
----------------
Writes the length of a string as varint and then contents of the string. Used for writing fields with wire type PB_WT_STRING. ::