Changeset 4068 for trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.ProtobufCS/0.9.1/ProtobufCS/src/ProtocolBuffers/UnknownFieldSet.cs
- Timestamp:
- 07/22/10 00:44:01 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.ProtobufCS/0.9.1/ProtobufCS/src/ProtocolBuffers/UnknownFieldSet.cs
r3857 r4068 38 38 using Google.ProtocolBuffers.Collections; 39 39 using Google.ProtocolBuffers.Descriptors; 40 using Google.ProtocolBuffers.DescriptorProtos;41 40 42 41 namespace Google.ProtocolBuffers { … … 121 120 /// Gets the number of bytes required to encode this set. 122 121 /// </summary> 123 public int SerializedSize { 122 public int SerializedSize { 124 123 get { 125 124 int result = 0; … … 128 127 } 129 128 return result; 130 } 129 } 131 130 } 132 131 … … 241 240 /// Builder for UnknownFieldSets. 242 241 /// </summary> 243 public sealed class Builder 244 { 242 public sealed class Builder { 245 243 /// <summary> 246 244 /// Mapping from number to field. Note that by using a SortedList we ensure … … 320 318 return this; 321 319 } 322 320 323 321 /// <summary> 324 322 /// Parse an entire message from <paramref name="input"/> and merge … … 335 333 } 336 334 337 338 339 340 341 342 343 335 /// <summary> 336 /// Parse a single field from <paramref name="input"/> and merge it 337 /// into this set. 338 /// </summary> 339 /// <param name="tag">The field's tag number, which was already parsed.</param> 340 /// <param name="input">The coded input stream containing the field</param> 341 /// <returns>false if the tag is an "end group" tag, true otherwise</returns> 344 342 [CLSCompliant(false)] 345 343 public bool MergeFieldFrom(uint tag, CodedInputStream input) { … … 356 354 return true; 357 355 case WireFormat.WireType.StartGroup: { 358 Builder subBuilder = CreateBuilder();359 input.ReadUnknownGroup(number, subBuilder);360 GetFieldBuilder(number).AddGroup(subBuilder.Build());361 return true;362 }356 Builder subBuilder = CreateBuilder(); 357 input.ReadUnknownGroup(number, subBuilder); 358 GetFieldBuilder(number).AddGroup(subBuilder.Build()); 359 return true; 360 } 363 361 case WireFormat.WireType.EndGroup: 364 362 return false; … … 428 426 public Builder MergeFrom(UnknownFieldSet other) { 429 427 if (other != DefaultInstance) { 430 foreach (KeyValuePair<int, UnknownField> entry in other.fields) {428 foreach (KeyValuePair<int, UnknownField> entry in other.fields) { 431 429 MergeField(entry.Key, entry.Value); 432 430 } … … 486 484 /// <param name="tag">The tag, which should already have been read from the input</param> 487 485 /// <returns>true unless the tag is an end-group tag</returns> 488 internal bool MergeFieldFrom(CodedInputStream input, 486 internal bool MergeFieldFrom(CodedInputStream input, 489 487 ExtensionRegistry extensionRegistry, IBuilder builder, uint tag) { 490 488
Note: See TracChangeset
for help on using the changeset viewer.