Lines Matching refs:field

92   // oneof_case is a field index, so find that field.
110 // Check if the field is a well known wrapper type
111 bool is_wrapper_type_field(const upb_fielddef* field) {
113 if (upb_fielddef_type(field) != UPB_TYPE_MESSAGE) {
116 m = upb_fielddef_msgsubdef(field);
194 // Find the field name
198 // Check if field exists and is a wrapper type
221 // Find enum field name
225 // Check if enum field exists
237 // Verify the name corresponds to a oneof or field in this message.
242 // Method calls like 'has_foo?' are not allowed if field "foo" does not have
265 * message fields according to their field names.
267 * For any field whose name does not conflict with a built-in method, an
268 * accessor is provided with the same name as the field, and a setter is
269 * provided with the name of the field plus the '=' suffix. Thus, given a
270 * message instance 'msg' with field 'foo', the following code is valid:
277 * the name of the field in that oneof that is currently set, or nil if none.
280 * of the field 'fieldname'. For basic data types, this will set the default
281 * value of the field.
284 * true if the field 'fieldname' is set in the message object, else false. For
285 * 'proto3' syntax, calling this for a basic type field will result in an error.
330 // Otherwise we're operating on a single proto field
425 "Unknown field name '%s' in initialization map entry.", name);
437 "Expected Hash object as initializer value for map field '%s' (given %s).",
448 "Expected array as initializer value for repeated field '%s' (given %s).",
475 * provided with keywords corresponding to field names.
548 * if they have the same type and if each field is equal according to the :==
550 * field is of a primitive type).
574 * Returns a hash value that represents this message's field values.
589 * field's value is represented according to its own #inspect method.
619 // This is unfortunate, we should key behaviors off field attributes (like
620 // whether a field has presence), not proto2 vs. proto3. We should see if we
628 const upb_fielddef* field = upb_msg_iter_field(&it);
633 if (is_proto2 && upb_fielddef_haspresence(field) &&
634 !layout_has(self->descriptor->layout, Message_data(self), field)) {
638 msg_value = layout_get(self->descriptor->layout, Message_data(self), field);
639 msg_key = ID2SYM(rb_intern(upb_fielddef_name(field)));
640 if (is_map_field(field)) {
642 } else if (upb_fielddef_label(field) == UPB_LABEL_REPEATED) {
648 if (upb_fielddef_type(field) == UPB_TYPE_MESSAGE) {
657 upb_fielddef_type(field) == UPB_TYPE_MESSAGE) {
671 * Accesses a field's value by field name. The provided field name should be a
676 const upb_fielddef* field;
679 field = upb_msgdef_ntofz(self->descriptor->msgdef, RSTRING_PTR(field_name));
680 if (field == NULL) {
683 return layout_get(self->descriptor->layout, Message_data(self), field);
690 * Sets a field's value by field name. The provided field name should be a
695 const upb_fielddef* field;
698 field = upb_msgdef_ntofz(self->descriptor->msgdef, RSTRING_PTR(field_name));
699 if (field == NULL) {
700 rb_raise(rb_eArgError, "Unknown field: %s", RSTRING_PTR(field_name));
702 layout_set(self->descriptor->layout, Message_data(self), field, value);