Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(469)

Side by Side Diff: lib/src/protobuf/generated_message.dart

Issue 886643002: pkg/protobuf: cleanup and prep for 0.3.5 release (Closed) Base URL: https://github.com/dart-lang/dart-protobuf.git@master
Patch Set: nits Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/src/protobuf/coded_buffer_reader.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of protobuf; 5 part of protobuf;
6 6
7 typedef GeneratedMessage CreateBuilderFunc(); 7 typedef GeneratedMessage CreateBuilderFunc();
8 typedef Object MakeDefaultFunc(); 8 typedef Object MakeDefaultFunc();
9 typedef ProtobufEnum ValueOfFunc(int value); 9 typedef ProtobufEnum ValueOfFunc(int value);
10 10
(...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after
1021 * or from a known extension. If the type is unknown, [null] is returned. 1021 * or from a known extension. If the type is unknown, [null] is returned.
1022 */ 1022 */
1023 int _getFieldType(int tagNumber) { 1023 int _getFieldType(int tagNumber) {
1024 int type = info_.fieldType(tagNumber); 1024 int type = info_.fieldType(tagNumber);
1025 if (type == null && _extensions.containsKey(tagNumber)) { 1025 if (type == null && _extensions.containsKey(tagNumber)) {
1026 type = _extensions[tagNumber].type; 1026 type = _extensions[tagNumber].type;
1027 } 1027 }
1028 return type; 1028 return type;
1029 } 1029 }
1030 1030
1031 /**
1032 * Returns the type associated with a given tag number, either from the
1033 * [BuilderInfo] associated with this [GeneratedMessage],
1034 * or from a known extension. If the type is unknown, [null] is returned.
1035 */
1036 int _getBaseFieldType(int tagNumber) {
1037 int type = info_.fieldType(tagNumber);
1038 if (type == null && _extensions.containsKey(tagNumber)) {
1039 type = _extensions[tagNumber].type;
1040 }
1041 return type;
1042 }
1043
1044 /* 1031 /*
1045 * Returns the base field type without any of the required, repeated 1032 * Returns the base field type without any of the required, repeated
1046 * and packed bits. 1033 * and packed bits.
1047 */ 1034 */
1048 int _toBaseFieldType(int fieldType) { 1035 int _toBaseFieldType(int fieldType) {
1049 return fieldType & ~(_REQUIRED_BIT | _REPEATED_BIT | _PACKED_BIT); 1036 return fieldType & ~(_REQUIRED_BIT | _REPEATED_BIT | _PACKED_BIT);
1050 } 1037 }
1051 1038
1052 GeneratedMessage _getEmptyMessage( 1039 GeneratedMessage _getEmptyMessage(
1053 int tagNumber, ExtensionRegistry extensionRegistry) { 1040 int tagNumber, ExtensionRegistry extensionRegistry) {
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
1236 _generateMessage(tagNumber, value, 'not a GeneratedMessage')); 1223 _generateMessage(tagNumber, value, 'not a GeneratedMessage'));
1237 } 1224 }
1238 break; 1225 break;
1239 default: 1226 default:
1240 throw new ArgumentError( 1227 throw new ArgumentError(
1241 _generateMessage(tagNumber, value, 'field has unknown type ' 1228 _generateMessage(tagNumber, value, 'field has unknown type '
1242 '$fieldType')); 1229 '$fieldType'));
1243 } 1230 }
1244 } 1231 }
1245 } 1232 }
OLDNEW
« no previous file with comments | « lib/src/protobuf/coded_buffer_reader.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698