internal static T GetField <T>(ErrorCodeResponse_Accessor accessor, string fieldName, int field_name_idx) { uint member_id; int field_divider_idx = fieldName.IndexOf('.', field_name_idx); if (-1 != field_divider_idx) { string member_name_string = fieldName.Substring(field_name_idx, field_divider_idx - field_name_idx); if (!FieldLookupTable_ErrorCodeResponse.TryGetValue(member_name_string, out member_id)) { Throw.undefined_field(); } switch (member_id) { default: Throw.member_access_on_non_struct__field(member_name_string); break; } } fieldName = fieldName.Substring(field_name_idx); if (!FieldLookupTable_ErrorCodeResponse.TryGetValue(fieldName, out member_id)) { Throw.undefined_field(); } switch (member_id) { case 0: return(TypeConverter <T> .ConvertFrom_int(accessor.errno)); break; } /* Should not reach here */ throw new Exception("Internal error T5008"); }
internal static void SetField <T>(ErrorCodeResponse_Accessor accessor, string fieldName, int field_name_idx, T value) { uint member_id; int field_divider_idx = fieldName.IndexOf('.', field_name_idx); if (-1 != field_divider_idx) { string member_name_string = fieldName.Substring(field_name_idx, field_divider_idx - field_name_idx); if (!FieldLookupTable_ErrorCodeResponse.TryGetValue(member_name_string, out member_id)) { Throw.undefined_field(); } switch (member_id) { default: Throw.member_access_on_non_struct__field(member_name_string); break; } return; } fieldName = fieldName.Substring(field_name_idx); if (!FieldLookupTable_ErrorCodeResponse.TryGetValue(fieldName, out member_id)) { Throw.undefined_field(); } switch (member_id) { case 0: { int conversion_result = TypeConverter <T> .ConvertTo_int(value); { accessor.errno = conversion_result; } break; } } }