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

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

Issue 1277863003: cleanup: move fieldType constants and functions to a separate file (Closed) Base URL: git@github.com:dart-lang/dart-protobuf.git@master
Patch Set: _validateMessage should call _baseType, not callers Created 5 years, 4 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/generated_message.dart ('k') | lib/src/protobuf/wire_format.dart » ('j') | 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 class UnknownFieldSet { 7 class UnknownFieldSet {
8 8
9 final Map<int, UnknownFieldSetField> _fields = 9 final Map<int, UnknownFieldSetField> _fields =
10 new Map<int, UnknownFieldSetField>(); 10 new Map<int, UnknownFieldSetField>();
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 ..addAll(varints) 216 ..addAll(varints)
217 ..addAll(fixed32s) 217 ..addAll(fixed32s)
218 ..addAll(fixed64s) 218 ..addAll(fixed64s)
219 ..addAll(groups); 219 ..addAll(groups);
220 220
221 void writeTo(int fieldNumber, CodedBufferWriter output) { 221 void writeTo(int fieldNumber, CodedBufferWriter output) {
222 write(type, value) { 222 write(type, value) {
223 output.writeField(fieldNumber, type, value); 223 output.writeField(fieldNumber, type, value);
224 } 224 }
225 225
226 write(GeneratedMessage._REPEATED_UINT64, varints); 226 write(FieldType._REPEATED_UINT64, varints);
227 write(GeneratedMessage._REPEATED_FIXED32, fixed32s); 227 write(FieldType._REPEATED_FIXED32, fixed32s);
228 write(GeneratedMessage._REPEATED_FIXED64, fixed64s); 228 write(FieldType._REPEATED_FIXED64, fixed64s);
229 write(GeneratedMessage._REPEATED_BYTES, lengthDelimited); 229 write(FieldType._REPEATED_BYTES, lengthDelimited);
230 write(GeneratedMessage._REPEATED_GROUP, groups); 230 write(FieldType._REPEATED_GROUP, groups);
231 } 231 }
232 232
233 void addGroup(UnknownFieldSet value) { 233 void addGroup(UnknownFieldSet value) {
234 groups.add(value); 234 groups.add(value);
235 } 235 }
236 236
237 void addLengthDelimited(List<int> value) { 237 void addLengthDelimited(List<int> value) {
238 lengthDelimited.add(value); 238 lengthDelimited.add(value);
239 } 239 }
240 240
241 void addFixed32(int value) { 241 void addFixed32(int value) {
242 fixed32s.add(value); 242 fixed32s.add(value);
243 } 243 }
244 244
245 void addFixed64(Int64 value) { 245 void addFixed64(Int64 value) {
246 fixed64s.add(value); 246 fixed64s.add(value);
247 } 247 }
248 248
249 void addVarint(Int64 value) { 249 void addVarint(Int64 value) {
250 varints.add(value); 250 varints.add(value);
251 } 251 }
252 252
253 bool hasRequiredFields() => false; 253 bool hasRequiredFields() => false;
254 254
255 bool isInitialized() => true; 255 bool isInitialized() => true;
256 256
257 int get length => values.length; 257 int get length => values.length;
258 } 258 }
OLDNEW
« no previous file with comments | « lib/src/protobuf/generated_message.dart ('k') | lib/src/protobuf/wire_format.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698