Beispiel #1
0
bool is_map_field(const upb_fielddef *field) {
  const upb_msgdef* subdef = tryget_map_entry_msgdef(field);
  if (subdef == NULL) return false;

  // Map fields are a proto3 feature.
  // If we're using proto2 syntax we need to fallback to the repeated field.
  return upb_msgdef_syntax(subdef) == UPB_SYNTAX_PROTO3;
}
Beispiel #2
0
const upb_msgdef *map_entry_msgdef(const upb_fielddef* field) {
  const upb_msgdef* subdef = tryget_map_entry_msgdef(field);
  assert(subdef);
  return subdef;
}
Beispiel #3
0
bool is_map_field(const upb_fielddef *field) {
  return tryget_map_entry_msgdef(field) != NULL;
}