Changeset 4068 for trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.ProtobufCS/0.9.1/ProtobufCS/src/ProtocolBuffers
- Timestamp:
- 07/22/10 00:44:01 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.ProtobufCS/0.9.1/ProtobufCS/src/ProtocolBuffers
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.ProtobufCS/0.9.1/ProtobufCS/src/ProtocolBuffers/Collections/Dictionaries.cs
r3857 r4068 30 30 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 31 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 using System;33 32 using System.Collections; 34 33 using System.Collections.Generic; … … 50 49 return false; 51 50 } 52 foreach (KeyValuePair<TKey,TValue> leftEntry in left) 53 { 51 foreach (KeyValuePair<TKey, TValue> leftEntry in left) { 54 52 TValue rightValue; 55 53 if (!right.TryGetValue(leftEntry.Key, out rightValue)) { … … 72 70 } 73 71 74 public static IDictionary<TKey, TValue> AsReadOnly<TKey, TValue> 72 public static IDictionary<TKey, TValue> AsReadOnly<TKey, TValue>(IDictionary<TKey, TValue> dictionary) { 75 73 return dictionary.IsReadOnly ? dictionary : new ReadOnlyDictionary<TKey, TValue>(dictionary); 76 74 } -
trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.ProtobufCS/0.9.1/ProtobufCS/src/ProtocolBuffers/Collections/PopsicleList.cs
r3857 r4068 31 31 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 32 using System; 33 using System.Collections; 33 34 using System.Collections.Generic; 34 using System.Collections;35 35 36 36 namespace Google.ProtocolBuffers.Collections { -
trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.ProtobufCS/0.9.1/ProtobufCS/src/ProtocolBuffers/DescriptorProtos/CSharpOptions.cs
r3857 r4068 2 2 3 3 using pb = global::Google.ProtocolBuffers; 4 using pbc = global::Google.ProtocolBuffers.Collections;5 4 using pbd = global::Google.ProtocolBuffers.Descriptors; 6 using scg = global::System.Collections.Generic;7 5 namespace Google.ProtocolBuffers.DescriptorProtos { 8 6 9 7 public static partial class CSharpOptions { 10 8 11 9 #region Extension registration 12 10 public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { … … 21 19 public static pb::GeneratedExtensionBase<global::Google.ProtocolBuffers.DescriptorProtos.CSharpFieldOptions> CSharpFieldOptions; 22 20 #endregion 23 21 24 22 #region Static variables 25 23 internal static pbd::MessageDescriptor internal__static_google_protobuf_CSharpFileOptions__Descriptor; … … 33 31 } 34 32 private static pbd::FileDescriptor descriptor; 35 33 36 34 static CSharpOptions() { 37 35 byte[] descriptorData = global::System.Convert.FromBase64String( 38 "CiRnb29nbGUvcHJvdG9idWYvY3NoYXJwX29wdGlvbnMucHJvdG8SD2dvb2ds" + 39 "ZS5wcm90b2J1ZhogZ29vZ2xlL3Byb3RvYnVmL2Rlc2NyaXB0b3IucHJvdG8i" + 40 "zAEKEUNTaGFycEZpbGVPcHRpb25zEhEKCW5hbWVzcGFjZRgBIAEoCRIaChJ1" + 41 "bWJyZWxsYV9jbGFzc25hbWUYAiABKAkSHAoOcHVibGljX2NsYXNzZXMYAyAB" + 42 "KAg6BHRydWUSFgoObXVsdGlwbGVfZmlsZXMYBCABKAgSFAoMbmVzdF9jbGFz" + 43 "c2VzGAUgASgIEhYKDmNvZGVfY29udHJhY3RzGAYgASgIEiQKHGV4cGFuZF9u" + 44 "YW1lc3BhY2VfZGlyZWN0b3JpZXMYByABKAgiKwoSQ1NoYXJwRmllbGRPcHRp" + 45 "b25zEhUKDXByb3BlcnR5X25hbWUYASABKAk6XgoTY3NoYXJwX2ZpbGVfb3B0" + 46 "aW9ucxIcLmdvb2dsZS5wcm90b2J1Zi5GaWxlT3B0aW9ucxjoByABKAsyIi5n" + 47 "b29nbGUucHJvdG9idWYuQ1NoYXJwRmlsZU9wdGlvbnM6YQoUY3NoYXJwX2Zp" + 48 "ZWxkX29wdGlvbnMSHS5nb29nbGUucHJvdG9idWYuRmllbGRPcHRpb25zGOgH" + 36 "CiRnb29nbGUvcHJvdG9idWYvY3NoYXJwX29wdGlvbnMucHJvdG8SD2dvb2ds" + 37 "ZS5wcm90b2J1ZhogZ29vZ2xlL3Byb3RvYnVmL2Rlc2NyaXB0b3IucHJvdG8i" + 38 "zAEKEUNTaGFycEZpbGVPcHRpb25zEhEKCW5hbWVzcGFjZRgBIAEoCRIaChJ1" + 39 "bWJyZWxsYV9jbGFzc25hbWUYAiABKAkSHAoOcHVibGljX2NsYXNzZXMYAyAB" + 40 "KAg6BHRydWUSFgoObXVsdGlwbGVfZmlsZXMYBCABKAgSFAoMbmVzdF9jbGFz" + 41 "c2VzGAUgASgIEhYKDmNvZGVfY29udHJhY3RzGAYgASgIEiQKHGV4cGFuZF9u" + 42 "YW1lc3BhY2VfZGlyZWN0b3JpZXMYByABKAgiKwoSQ1NoYXJwRmllbGRPcHRp" + 43 "b25zEhUKDXByb3BlcnR5X25hbWUYASABKAk6XgoTY3NoYXJwX2ZpbGVfb3B0" + 44 "aW9ucxIcLmdvb2dsZS5wcm90b2J1Zi5GaWxlT3B0aW9ucxjoByABKAsyIi5n" + 45 "b29nbGUucHJvdG9idWYuQ1NoYXJwRmlsZU9wdGlvbnM6YQoUY3NoYXJwX2Zp" + 46 "ZWxkX29wdGlvbnMSHS5nb29nbGUucHJvdG9idWYuRmllbGRPcHRpb25zGOgH" + 49 47 "IAEoCzIjLmdvb2dsZS5wcm90b2J1Zi5DU2hhcnBGaWVsZE9wdGlvbnM="); 50 48 pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { 51 49 descriptor = root; 52 50 internal__static_google_protobuf_CSharpFileOptions__Descriptor = Descriptor.MessageTypes[0]; 53 internal__static_google_protobuf_CSharpFileOptions__FieldAccessorTable = 51 internal__static_google_protobuf_CSharpFileOptions__FieldAccessorTable = 54 52 new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.DescriptorProtos.CSharpFileOptions, global::Google.ProtocolBuffers.DescriptorProtos.CSharpFileOptions.Builder>(internal__static_google_protobuf_CSharpFileOptions__Descriptor, 55 53 new string[] { "Namespace", "UmbrellaClassname", "PublicClasses", "MultipleFiles", "NestClasses", "CodeContracts", "ExpandNamespaceDirectories", }); 56 54 internal__static_google_protobuf_CSharpFieldOptions__Descriptor = Descriptor.MessageTypes[1]; 57 internal__static_google_protobuf_CSharpFieldOptions__FieldAccessorTable = 55 internal__static_google_protobuf_CSharpFieldOptions__FieldAccessorTable = 58 56 new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.DescriptorProtos.CSharpFieldOptions, global::Google.ProtocolBuffers.DescriptorProtos.CSharpFieldOptions.Builder>(internal__static_google_protobuf_CSharpFieldOptions__Descriptor, 59 57 new string[] { "PropertyName", }); … … 68 66 } 69 67 #endregion 70 68 71 69 } 72 70 #region Messages … … 76 74 get { return defaultInstance; } 77 75 } 78 76 79 77 public override CSharpFileOptions DefaultInstanceForType { 80 78 get { return defaultInstance; } 81 79 } 82 80 83 81 protected override CSharpFileOptions ThisMessage { 84 82 get { return this; } 85 83 } 86 84 87 85 public static pbd::MessageDescriptor Descriptor { 88 86 get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.internal__static_google_protobuf_CSharpFileOptions__Descriptor; } 89 87 } 90 88 91 89 protected override pb::FieldAccess.FieldAccessorTable<CSharpFileOptions, CSharpFileOptions.Builder> InternalFieldAccessors { 92 90 get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.internal__static_google_protobuf_CSharpFileOptions__FieldAccessorTable; } 93 91 } 94 92 95 93 public const int NamespaceFieldNumber = 1; 96 94 private bool hasNamespace; … … 102 100 get { return namespace_; } 103 101 } 104 102 105 103 public const int UmbrellaClassnameFieldNumber = 2; 106 104 private bool hasUmbrellaClassname; … … 112 110 get { return umbrellaClassname_; } 113 111 } 114 112 115 113 public const int PublicClassesFieldNumber = 3; 116 114 private bool hasPublicClasses; … … 122 120 get { return publicClasses_; } 123 121 } 124 122 125 123 public const int MultipleFilesFieldNumber = 4; 126 124 private bool hasMultipleFiles; … … 132 130 get { return multipleFiles_; } 133 131 } 134 132 135 133 public const int NestClassesFieldNumber = 5; 136 134 private bool hasNestClasses; … … 142 140 get { return nestClasses_; } 143 141 } 144 142 145 143 public const int CodeContractsFieldNumber = 6; 146 144 private bool hasCodeContracts; … … 152 150 get { return codeContracts_; } 153 151 } 154 152 155 153 public const int ExpandNamespaceDirectoriesFieldNumber = 7; 156 154 private bool hasExpandNamespaceDirectories; … … 162 160 get { return expandNamespaceDirectories_; } 163 161 } 164 162 165 163 public override bool IsInitialized { 166 164 get { … … 168 166 } 169 167 } 170 168 171 169 public override void WriteTo(pb::CodedOutputStream output) { 172 170 int size = SerializedSize; … … 194 192 UnknownFields.WriteTo(output); 195 193 } 196 194 197 195 private int memoizedSerializedSize = -1; 198 196 public override int SerializedSize { … … 200 198 int size = memoizedSerializedSize; 201 199 if (size != -1) return size; 202 200 203 201 size = 0; 204 202 if (HasNamespace) { … … 228 226 } 229 227 } 230 228 231 229 public static CSharpFileOptions ParseFrom(pb::ByteString data) { 232 return ((Builder) 230 return ((Builder)CreateBuilder().MergeFrom(data)).BuildParsed(); 233 231 } 234 232 public static CSharpFileOptions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { 235 return ((Builder) 233 return ((Builder)CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); 236 234 } 237 235 public static CSharpFileOptions ParseFrom(byte[] data) { 238 return ((Builder) 236 return ((Builder)CreateBuilder().MergeFrom(data)).BuildParsed(); 239 237 } 240 238 public static CSharpFileOptions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { 241 return ((Builder) 239 return ((Builder)CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); 242 240 } 243 241 public static CSharpFileOptions ParseFrom(global::System.IO.Stream input) { 244 return ((Builder) 242 return ((Builder)CreateBuilder().MergeFrom(input)).BuildParsed(); 245 243 } 246 244 public static CSharpFileOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { 247 return ((Builder) 245 return ((Builder)CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); 248 246 } 249 247 public static CSharpFileOptions ParseDelimitedFrom(global::System.IO.Stream input) { … … 254 252 } 255 253 public static CSharpFileOptions ParseFrom(pb::CodedInputStream input) { 256 return ((Builder) 254 return ((Builder)CreateBuilder().MergeFrom(input)).BuildParsed(); 257 255 } 258 256 public static CSharpFileOptions ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { 259 return ((Builder) 257 return ((Builder)CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); 260 258 } 261 259 public static Builder CreateBuilder() { return new Builder(); } … … 263 261 public override Builder CreateBuilderForType() { return new Builder(); } 264 262 public static Builder CreateBuilder(CSharpFileOptions prototype) { 265 return (Builder) 266 } 267 263 return (Builder)new Builder().MergeFrom(prototype); 264 } 265 268 266 public sealed partial class Builder : pb::GeneratedBuilder<CSharpFileOptions, Builder> { 269 267 protected override Builder ThisBuilder { 270 268 get { return this; } 271 269 } 272 public Builder() { }273 270 public Builder() { } 271 274 272 CSharpFileOptions result = new CSharpFileOptions(); 275 273 276 274 protected override CSharpFileOptions MessageBeingBuilt { 277 275 get { return result; } 278 276 } 279 277 280 278 public override Builder Clear() { 281 279 result = new CSharpFileOptions(); 282 280 return this; 283 281 } 284 282 285 283 public override Builder Clone() { 286 284 return new Builder().MergeFrom(result); 287 285 } 288 286 289 287 public override pbd::MessageDescriptor DescriptorForType { 290 288 get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpFileOptions.Descriptor; } 291 289 } 292 290 293 291 public override CSharpFileOptions DefaultInstanceForType { 294 292 get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpFileOptions.DefaultInstance; } 295 293 } 296 294 297 295 public override CSharpFileOptions BuildPartial() { 298 296 if (result == null) { … … 303 301 return returnMe; 304 302 } 305 303 306 304 public override Builder MergeFrom(pb::IMessage other) { 307 305 if (other is CSharpFileOptions) { 308 return MergeFrom((CSharpFileOptions) 306 return MergeFrom((CSharpFileOptions)other); 309 307 } else { 310 308 base.MergeFrom(other); … … 312 310 } 313 311 } 314 312 315 313 public override Builder MergeFrom(CSharpFileOptions other) { 316 314 if (other == global::Google.ProtocolBuffers.DescriptorProtos.CSharpFileOptions.DefaultInstance) return this; … … 339 337 return this; 340 338 } 341 339 342 340 public override Builder MergeFrom(pb::CodedInputStream input) { 343 341 return MergeFrom(input, pb::ExtensionRegistry.Empty); 344 342 } 345 343 346 344 public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { 347 345 pb::UnknownFieldSet.Builder unknownFields = null; … … 350 348 switch (tag) { 351 349 case 0: { 352 if (unknownFields != null) {353 this.UnknownFields = unknownFields.Build();354 }355 return this;356 }357 default: {358 if (pb::WireFormat.IsEndGroupTag(tag)) {359 350 if (unknownFields != null) { 360 351 this.UnknownFields = unknownFields.Build(); … … 362 353 return this; 363 354 } 364 if (unknownFields == null) { 365 unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); 366 } 367 ParseUnknownField(input, unknownFields, extensionRegistry, tag); 368 break; 369 } 355 default: { 356 if (pb::WireFormat.IsEndGroupTag(tag)) { 357 if (unknownFields != null) { 358 this.UnknownFields = unknownFields.Build(); 359 } 360 return this; 361 } 362 if (unknownFields == null) { 363 unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); 364 } 365 ParseUnknownField(input, unknownFields, extensionRegistry, tag); 366 break; 367 } 370 368 case 10: { 371 Namespace = input.ReadString();372 break;373 }369 Namespace = input.ReadString(); 370 break; 371 } 374 372 case 18: { 375 UmbrellaClassname = input.ReadString();376 break;377 }373 UmbrellaClassname = input.ReadString(); 374 break; 375 } 378 376 case 24: { 379 PublicClasses = input.ReadBool();380 break;381 }377 PublicClasses = input.ReadBool(); 378 break; 379 } 382 380 case 32: { 383 MultipleFiles = input.ReadBool();384 break;385 }381 MultipleFiles = input.ReadBool(); 382 break; 383 } 386 384 case 40: { 387 NestClasses = input.ReadBool();388 break;389 }385 NestClasses = input.ReadBool(); 386 break; 387 } 390 388 case 48: { 391 CodeContracts = input.ReadBool();392 break;393 }389 CodeContracts = input.ReadBool(); 390 break; 391 } 394 392 case 56: { 395 ExpandNamespaceDirectories = input.ReadBool();396 break;397 }393 ExpandNamespaceDirectories = input.ReadBool(); 394 break; 395 } 398 396 } 399 397 } 400 398 } 401 402 399 400 403 401 public bool HasNamespace { 404 402 get { return result.HasNamespace; } … … 419 417 return this; 420 418 } 421 419 422 420 public bool HasUmbrellaClassname { 423 421 get { return result.HasUmbrellaClassname; } … … 438 436 return this; 439 437 } 440 438 441 439 public bool HasPublicClasses { 442 440 get { return result.HasPublicClasses; } … … 456 454 return this; 457 455 } 458 456 459 457 public bool HasMultipleFiles { 460 458 get { return result.HasMultipleFiles; } … … 474 472 return this; 475 473 } 476 474 477 475 public bool HasNestClasses { 478 476 get { return result.HasNestClasses; } … … 492 490 return this; 493 491 } 494 492 495 493 public bool HasCodeContracts { 496 494 get { return result.HasCodeContracts; } … … 510 508 return this; 511 509 } 512 510 513 511 public bool HasExpandNamespaceDirectories { 514 512 get { return result.HasExpandNamespaceDirectories; } … … 533 531 } 534 532 } 535 533 536 534 public sealed partial class CSharpFieldOptions : pb::GeneratedMessage<CSharpFieldOptions, CSharpFieldOptions.Builder> { 537 535 private static readonly CSharpFieldOptions defaultInstance = new Builder().BuildPartial(); … … 539 537 get { return defaultInstance; } 540 538 } 541 539 542 540 public override CSharpFieldOptions DefaultInstanceForType { 543 541 get { return defaultInstance; } 544 542 } 545 543 546 544 protected override CSharpFieldOptions ThisMessage { 547 545 get { return this; } 548 546 } 549 547 550 548 public static pbd::MessageDescriptor Descriptor { 551 549 get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.internal__static_google_protobuf_CSharpFieldOptions__Descriptor; } 552 550 } 553 551 554 552 protected override pb::FieldAccess.FieldAccessorTable<CSharpFieldOptions, CSharpFieldOptions.Builder> InternalFieldAccessors { 555 553 get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.internal__static_google_protobuf_CSharpFieldOptions__FieldAccessorTable; } 556 554 } 557 555 558 556 public const int PropertyNameFieldNumber = 1; 559 557 private bool hasPropertyName; … … 565 563 get { return propertyName_; } 566 564 } 567 565 568 566 public override bool IsInitialized { 569 567 get { … … 571 569 } 572 570 } 573 571 574 572 public override void WriteTo(pb::CodedOutputStream output) { 575 573 int size = SerializedSize; … … 579 577 UnknownFields.WriteTo(output); 580 578 } 581 579 582 580 private int memoizedSerializedSize = -1; 583 581 public override int SerializedSize { … … 585 583 int size = memoizedSerializedSize; 586 584 if (size != -1) return size; 587 585 588 586 size = 0; 589 587 if (HasPropertyName) { … … 595 593 } 596 594 } 597 595 598 596 public static CSharpFieldOptions ParseFrom(pb::ByteString data) { 599 return ((Builder) 597 return ((Builder)CreateBuilder().MergeFrom(data)).BuildParsed(); 600 598 } 601 599 public static CSharpFieldOptions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { 602 return ((Builder) 600 return ((Builder)CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); 603 601 } 604 602 public static CSharpFieldOptions ParseFrom(byte[] data) { 605 return ((Builder) 603 return ((Builder)CreateBuilder().MergeFrom(data)).BuildParsed(); 606 604 } 607 605 public static CSharpFieldOptions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { 608 return ((Builder) 606 return ((Builder)CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); 609 607 } 610 608 public static CSharpFieldOptions ParseFrom(global::System.IO.Stream input) { 611 return ((Builder) 609 return ((Builder)CreateBuilder().MergeFrom(input)).BuildParsed(); 612 610 } 613 611 public static CSharpFieldOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { 614 return ((Builder) 612 return ((Builder)CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); 615 613 } 616 614 public static CSharpFieldOptions ParseDelimitedFrom(global::System.IO.Stream input) { … … 621 619 } 622 620 public static CSharpFieldOptions ParseFrom(pb::CodedInputStream input) { 623 return ((Builder) 621 return ((Builder)CreateBuilder().MergeFrom(input)).BuildParsed(); 624 622 } 625 623 public static CSharpFieldOptions ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { 626 return ((Builder) 624 return ((Builder)CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); 627 625 } 628 626 public static Builder CreateBuilder() { return new Builder(); } … … 630 628 public override Builder CreateBuilderForType() { return new Builder(); } 631 629 public static Builder CreateBuilder(CSharpFieldOptions prototype) { 632 return (Builder) 633 } 634 630 return (Builder)new Builder().MergeFrom(prototype); 631 } 632 635 633 public sealed partial class Builder : pb::GeneratedBuilder<CSharpFieldOptions, Builder> { 636 634 protected override Builder ThisBuilder { 637 635 get { return this; } 638 636 } 639 public Builder() { }640 637 public Builder() { } 638 641 639 CSharpFieldOptions result = new CSharpFieldOptions(); 642 640 643 641 protected override CSharpFieldOptions MessageBeingBuilt { 644 642 get { return result; } 645 643 } 646 644 647 645 public override Builder Clear() { 648 646 result = new CSharpFieldOptions(); 649 647 return this; 650 648 } 651 649 652 650 public override Builder Clone() { 653 651 return new Builder().MergeFrom(result); 654 652 } 655 653 656 654 public override pbd::MessageDescriptor DescriptorForType { 657 655 get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpFieldOptions.Descriptor; } 658 656 } 659 657 660 658 public override CSharpFieldOptions DefaultInstanceForType { 661 659 get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpFieldOptions.DefaultInstance; } 662 660 } 663 661 664 662 public override CSharpFieldOptions BuildPartial() { 665 663 if (result == null) { … … 670 668 return returnMe; 671 669 } 672 670 673 671 public override Builder MergeFrom(pb::IMessage other) { 674 672 if (other is CSharpFieldOptions) { 675 return MergeFrom((CSharpFieldOptions) 673 return MergeFrom((CSharpFieldOptions)other); 676 674 } else { 677 675 base.MergeFrom(other); … … 679 677 } 680 678 } 681 679 682 680 public override Builder MergeFrom(CSharpFieldOptions other) { 683 681 if (other == global::Google.ProtocolBuffers.DescriptorProtos.CSharpFieldOptions.DefaultInstance) return this; … … 688 686 return this; 689 687 } 690 688 691 689 public override Builder MergeFrom(pb::CodedInputStream input) { 692 690 return MergeFrom(input, pb::ExtensionRegistry.Empty); 693 691 } 694 692 695 693 public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { 696 694 pb::UnknownFieldSet.Builder unknownFields = null; … … 699 697 switch (tag) { 700 698 case 0: { 701 if (unknownFields != null) {702 this.UnknownFields = unknownFields.Build();703 }704 return this;705 }706 default: {707 if (pb::WireFormat.IsEndGroupTag(tag)) {708 699 if (unknownFields != null) { 709 700 this.UnknownFields = unknownFields.Build(); … … 711 702 return this; 712 703 } 713 if (unknownFields == null) { 714 unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); 715 } 716 ParseUnknownField(input, unknownFields, extensionRegistry, tag); 717 break; 718 } 704 default: { 705 if (pb::WireFormat.IsEndGroupTag(tag)) { 706 if (unknownFields != null) { 707 this.UnknownFields = unknownFields.Build(); 708 } 709 return this; 710 } 711 if (unknownFields == null) { 712 unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); 713 } 714 ParseUnknownField(input, unknownFields, extensionRegistry, tag); 715 break; 716 } 719 717 case 10: { 720 PropertyName = input.ReadString();721 break;722 }718 PropertyName = input.ReadString(); 719 break; 720 } 723 721 } 724 722 } 725 723 } 726 727 724 725 728 726 public bool HasPropertyName { 729 727 get { return result.HasPropertyName; } … … 749 747 } 750 748 } 751 749 752 750 #endregion 753 751 754 752 } -
trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.ProtobufCS/0.9.1/ProtobufCS/src/ProtocolBuffers/Descriptors/DescriptorPool.cs
r3857 r4068 1 using System; 1 2 // Protocol Buffers - Google's data interchange format 2 3 // Copyright 2008 Google Inc. All rights reserved. … … 31 32 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 33 using System.Collections.Generic; 33 using System;34 34 using System.Text; 35 35 using System.Text.RegularExpressions; -
trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.ProtobufCS/0.9.1/ProtobufCS/src/ProtocolBuffers/ExtensionRegistry.cs
r3857 r4068 33 33 #endregion 34 34 35 using System; 35 36 using System.Collections.Generic; 36 37 using Google.ProtocolBuffers.Descriptors; 37 using System;38 38 39 39 namespace Google.ProtocolBuffers { … … 156 156 /// Add an extension from a generated file to the registry. 157 157 /// </summary> 158 public void Add<TExtension> 158 public void Add<TExtension>(GeneratedExtensionBase<TExtension> extension) { 159 159 if (extension.Descriptor.MappedType == MappedType.Message) { 160 160 Add(new ExtensionInfo(extension.Descriptor, extension.MessageDefaultInstance)); -
trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.ProtobufCS/0.9.1/ProtobufCS/src/ProtocolBuffers/GeneratedMessage.cs
r3857 r4068 34 34 35 35 using System; 36 using System.Collections; 36 37 using System.Collections.Generic; 37 38 using Google.ProtocolBuffers.Collections; 38 39 using Google.ProtocolBuffers.Descriptors; 39 40 using Google.ProtocolBuffers.FieldAccess; 40 using System.Collections;41 41 42 42 namespace Google.ProtocolBuffers { 43 43 44 44 /// <summary> 45 45 /// All generated protocol message classes extend this class. It implements … … 48 48 /// </summary> 49 49 public abstract class GeneratedMessage<TMessage, TBuilder> : AbstractMessage<TMessage, TBuilder> 50 where TMessage : GeneratedMessage<TMessage, TBuilder>51 50 where TMessage : GeneratedMessage<TMessage, TBuilder> 51 where TBuilder : GeneratedBuilder<TMessage, TBuilder> { 52 52 53 53 private UnknownFieldSet unknownFields = UnknownFieldSet.DefaultInstance; … … 100 100 // We know it's an IList<T>, but not the exact type - so 101 101 // IEnumerable is the best we can do. (C# generics aren't covariant yet.) 102 foreach (IMessage element in (IEnumerable) 102 foreach (IMessage element in (IEnumerable)this[field]) { 103 103 if (!element.IsInitialized) { 104 104 return false; … … 106 106 } 107 107 } else { 108 if (HasField(field) && !((IMessage) 108 if (HasField(field) && !((IMessage)this[field]).IsInitialized) { 109 109 return false; 110 110 } … … 148 148 internal void SetUnknownFields(UnknownFieldSet fieldSet) { 149 149 unknownFields = fieldSet; 150 } 150 } 151 151 } 152 152 } -
trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.ProtobufCS/0.9.1/ProtobufCS/src/ProtocolBuffers/GeneratedRepeatExtension.cs
r3857 r4068 34 34 35 35 using System; 36 using System.Collections; 36 37 using System.Collections.Generic; 37 38 using Google.ProtocolBuffers.Descriptors; 38 using System.Collections;39 39 40 40 namespace Google.ProtocolBuffers { … … 43 43 /// </summary> 44 44 public sealed class GeneratedRepeatExtension<TExtensionElement> : GeneratedExtensionBase<IList<TExtensionElement>> { 45 private GeneratedRepeatExtension(FieldDescriptor field) : base(field, typeof(TExtensionElement)) { 45 private GeneratedRepeatExtension(FieldDescriptor field) 46 : base(field, typeof(TExtensionElement)) { 46 47 } 47 48 … … 65 66 // Must convert the whole list. 66 67 List<TExtensionElement> result = new List<TExtensionElement>(); 67 foreach (object element in (IEnumerable) 68 result.Add((TExtensionElement) 68 foreach (object element in (IEnumerable)value) { 69 result.Add((TExtensionElement)SingularFromReflectionType(element)); 69 70 } 70 71 return result; -
trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.ProtobufCS/0.9.1/ProtobufCS/src/ProtocolBuffers/MessageStreamIterator.cs
r3857 r4068 34 34 35 35 using System; 36 using System.Collections; 36 37 using System.Collections.Generic; 37 using System.Collections;38 38 using System.IO; 39 39 using System.Reflection; … … 91 91 return (Func<CodedInputStream, ExtensionRegistry, TMessage>)Delegate.CreateDelegate( 92 92 typeof(Func<CodedInputStream, ExtensionRegistry, TMessage>), builderBuilder, buildMethod); 93 } catch (ArgumentException e) { 93 } 94 catch (ArgumentException e) { 94 95 typeInitializationException = e; 95 } catch (InvalidOperationException e) { 96 } 97 catch (InvalidOperationException e) { 96 98 typeInitializationException = e; 97 } catch (InvalidCastException e) { 99 } 100 catch (InvalidCastException e) { 98 101 // Can't see why this would happen, but best to know about it. 99 102 typeInitializationException = e; … … 125 128 } 126 129 127 // This is only ever fetched by reflection, so the compiler may128 // complain that it's unused130 // This is only ever fetched by reflection, so the compiler may 131 // complain that it's unused 129 132 #pragma warning disable 0169 130 133 /// <summary> … … 136 139 /// be the same type when we construct the generic method by reflection. 137 140 /// </summary> 138 private static TMessage BuildImpl<TMessage2, TBuilder>(Func<TBuilder> builderBuilder, CodedInputStream input, ExtensionRegistry registry) 139 140 141 private static TMessage BuildImpl<TMessage2, TBuilder>(Func<TBuilder> builderBuilder, CodedInputStream input, ExtensionRegistry registry) 142 where TBuilder : IBuilder<TMessage2, TBuilder> 143 where TMessage2 : TMessage, IMessage<TMessage2, TBuilder> { 141 144 TBuilder builder = builderBuilder(); 142 145 input.ReadMessage(builder, registry); … … 156 159 } 157 160 158 private MessageStreamIterator(StreamProvider streamProvider, ExtensionRegistry extensionRegistry) 159 : this 161 private MessageStreamIterator(StreamProvider streamProvider, ExtensionRegistry extensionRegistry) 162 : this(streamProvider, extensionRegistry, CodedInputStream.DefaultSizeLimit) { 160 163 } 161 164 -
trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.ProtobufCS/0.9.1/ProtobufCS/src/ProtocolBuffers/NameHelpers.cs
r3857 r4068 33 33 #endregion 34 34 35 using System.Globalization; 35 36 using System.Text; 36 using System.Globalization;37 37 38 38 namespace Google.ProtocolBuffers { -
trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.ProtobufCS/0.9.1/ProtobufCS/src/ProtocolBuffers/Properties/AssemblyInfo.cs
r3857 r4068 32 32 using System; 33 33 using System.Reflection; 34 using System.Runtime.CompilerServices; 34 35 using System.Runtime.InteropServices; 35 using System.Runtime.CompilerServices;36 36 37 37 // General Information about an assembly is controlled through the following … … 69 69 #endif 70 70 71 [assembly: InternalsVisibleTo("Google.ProtocolBuffers.Test,PublicKey="+72 "00240000048000009400000006020000002400005253413100040000010001008179f2dd31a648" +73 "2a2359dbe33e53701167a888e7c369a9ae3210b64f93861d8a7d286447e58bc167e3d99483beda" +74 "72f738140072bb69990bc4f98a21365de2c105e848974a3d210e938b0a56103c0662901efd6b78" +75 "0ee6dbe977923d46a8fda18fb25c65dd73b149a5cd9f3100668b56649932dadd8cf5be52eb1dce" +71 [assembly: InternalsVisibleTo("Google.ProtocolBuffers.Test,PublicKey=" + 72 "00240000048000009400000006020000002400005253413100040000010001008179f2dd31a648" + 73 "2a2359dbe33e53701167a888e7c369a9ae3210b64f93861d8a7d286447e58bc167e3d99483beda" + 74 "72f738140072bb69990bc4f98a21365de2c105e848974a3d210e938b0a56103c0662901efd6b78" + 75 "0ee6dbe977923d46a8fda18fb25c65dd73b149a5cd9f3100668b56649932dadd8cf5be52eb1dce" + 76 76 "ad5cedbf")] 77 77 [assembly: InternalsVisibleTo("ProtoGen,PublicKey=" + -
trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.ProtobufCS/0.9.1/ProtobufCS/src/ProtocolBuffers/TextFormat.cs
r3857 r4068 34 34 35 35 using System; 36 using System.Collections; 36 37 using System.Collections.Generic; 37 38 using System.Globalization; … … 39 40 using System.Text; 40 41 using Google.ProtocolBuffers.Descriptors; 41 using System.Collections;42 42 43 43 namespace Google.ProtocolBuffers { … … 87 87 if (field.IsRepeated) { 88 88 // Repeated field. Print each element. 89 foreach (object element in (IEnumerable) 89 foreach (object element in (IEnumerable)value) { 90 90 PrintSingleField(field, element, generator); 91 91 } … … 102 102 && field.FieldType == FieldType.Message 103 103 && field.IsOptional 104 104 // object equality (TODO(jonskeet): Work out what this comment means!) 105 105 && field.ExtensionScope == field.MessageType) { 106 106 generator.Print(field.MessageType.FullName); … … 150 150 // The simple Object.ToString converts using the current culture. 151 151 // We want to always use the invariant culture so it's predictable. 152 generator.Print(((IConvertible) 152 generator.Print(((IConvertible)value).ToString(CultureInfo.InvariantCulture)); 153 153 break; 154 154 case FieldType.Bool: 155 155 // Explicitly use the Java true/false 156 generator.Print((bool) 156 generator.Print((bool)value ? "true" : "false"); 157 157 break; 158 158 159 159 case FieldType.String: 160 160 generator.Print("\""); 161 generator.Print(EscapeText((string) 161 generator.Print(EscapeText((string)value)); 162 162 generator.Print("\""); 163 163 break; 164 164 165 165 case FieldType.Bytes: { 166 generator.Print("\"");167 generator.Print(EscapeBytes((ByteString)value));168 generator.Print("\"");169 break;170 }166 generator.Print("\""); 167 generator.Print(EscapeBytes((ByteString)value)); 168 generator.Print("\""); 169 break; 170 } 171 171 172 172 case FieldType.Enum: { 173 generator.Print(((EnumValueDescriptor)value).Name);174 break;175 }173 generator.Print(((EnumValueDescriptor)value).Name); 174 break; 175 } 176 176 177 177 case FieldType.Message: 178 178 case FieldType.Group: 179 Print((IMessage) 179 Print((IMessage)value, generator); 180 180 break; 181 181 } … … 220 220 221 221 internal static ulong ParseUInt64(string text) { 222 return (ulong) 222 return (ulong)ParseInteger(text, false, true); 223 223 } 224 224 … … 228 228 229 229 internal static uint ParseUInt32(string text) { 230 return (uint) 230 return (uint)ParseInteger(text, false, false); 231 231 } 232 232 233 233 internal static int ParseInt32(string text) { 234 return (int) 234 return (int)ParseInteger(text, true, false); 235 235 } 236 236 … … 269 269 } 270 270 } 271 271 272 272 /// <summary> 273 273 /// Parses an integer in hex (leading 0x), decimal (no prefix) or octal (leading 0). … … 298 298 // We should be able to use Convert.ToUInt64 for all cases. 299 299 result = radix == 10 ? ulong.Parse(text) : Convert.ToUInt64(text, radix); 300 } catch (OverflowException) { 300 } 301 catch (OverflowException) { 301 302 // Convert OverflowException to FormatException so there's a single exception type this method can throw. 302 303 string numberDescription = string.Format("{0}-bit {1}signed integer", isLong ? 64 : 32, isSigned ? "" : "un"); … … 310 311 throw new FormatException("Number out of range for " + numberDescription + ": " + original); 311 312 } 312 return -((long) 313 } else { 314 ulong max = isSigned 315 ? (isLong ? (ulong) 313 return -((long)result); 314 } else { 315 ulong max = isSigned 316 ? (isLong ? (ulong)long.MaxValue : int.MaxValue) 316 317 : (isLong ? ulong.MaxValue : uint.MaxValue); 317 318 if (result > max) { … … 319 320 throw new FormatException("Number out of range for " + numberDescription + ": " + original); 320 321 } 321 return (long) 322 return (long)result; 322 323 } 323 324 } … … 384 385 switch (b) { 385 386 // C# does not use \a or \v 386 case 0x07: builder.Append("\\a" 387 case (byte)'\b': builder.Append("\\b" 388 case (byte)'\f': builder.Append("\\f" 389 case (byte)'\n': builder.Append("\\n" 390 case (byte)'\r': builder.Append("\\r" 391 case (byte)'\t': builder.Append("\\t" 392 case 0x0b: builder.Append("\\v" 387 case 0x07: builder.Append("\\a"); break; 388 case (byte)'\b': builder.Append("\\b"); break; 389 case (byte)'\f': builder.Append("\\f"); break; 390 case (byte)'\n': builder.Append("\\n"); break; 391 case (byte)'\r': builder.Append("\\r"); break; 392 case (byte)'\t': builder.Append("\\t"); break; 393 case 0x0b: builder.Append("\\v"); break; 393 394 case (byte)'\\': builder.Append("\\\\"); break; 394 395 case (byte)'\'': builder.Append("\\\'"); break; 395 case (byte)'"' 396 case (byte)'"': builder.Append("\\\""); break; 396 397 default: 397 398 if (b >= 0x20 && b < 128) { 398 builder.Append((char) 399 builder.Append((char)b); 399 400 } else { 400 401 builder.Append('\\'); 401 builder.Append((char) 402 builder.Append((char) 403 builder.Append((char) 402 builder.Append((char)('0' + ((b >> 6) & 3))); 403 builder.Append((char)('0' + ((b >> 3) & 7))); 404 builder.Append((char)('0' + (b & 7))); 404 405 } 405 406 break; … … 421 422 } 422 423 if (c != '\\') { 423 result[pos++] = (byte) 424 result[pos++] = (byte)c; 424 425 continue; 425 426 } … … 433 434 // Octal escape. 434 435 int code = ParseDigit(c); 435 if (i + 1 < input.Length && IsOctal(input[i +1])) {436 if (i + 1 < input.Length && IsOctal(input[i + 1])) { 436 437 i++; 437 438 code = code * 8 + ParseDigit(input[i]); 438 439 } 439 if (i + 1 < input.Length && IsOctal(input[i +1])) {440 if (i + 1 < input.Length && IsOctal(input[i + 1])) { 440 441 i++; 441 442 code = code * 8 + ParseDigit(input[i]); 442 443 } 443 result[pos++] = (byte) 444 result[pos++] = (byte)code; 444 445 } else { 445 446 switch (c) { 446 447 case 'a': result[pos++] = 0x07; break; 447 case 'b': result[pos++] = (byte) 448 case 'f': result[pos++] = (byte) 449 case 'n': result[pos++] = (byte) 450 case 'r': result[pos++] = (byte) 451 case 't': result[pos++] = (byte) 448 case 'b': result[pos++] = (byte)'\b'; break; 449 case 'f': result[pos++] = (byte)'\f'; break; 450 case 'n': result[pos++] = (byte)'\n'; break; 451 case 'r': result[pos++] = (byte)'\r'; break; 452 case 't': result[pos++] = (byte)'\t'; break; 452 453 case 'v': result[pos++] = 0x0b; break; 453 case '\\': result[pos++] = (byte) 454 case '\'': result[pos++] = (byte) 455 case '"': result[pos++] = (byte) 454 case '\\': result[pos++] = (byte)'\\'; break; 455 case '\'': result[pos++] = (byte)'\''; break; 456 case '"': result[pos++] = (byte)'\"'; break; 456 457 457 458 case 'x': 458 459 // hex escape 459 460 int code; 460 if (i + 1 < input.Length && IsHex(input[i +1])) {461 if (i + 1 < input.Length && IsHex(input[i + 1])) { 461 462 i++; 462 463 code = ParseDigit(input[i]); … … 464 465 throw new FormatException("Invalid escape sequence: '\\x' with no digits"); 465 466 } 466 if (i + 1 < input.Length && IsHex(input[i +1])) {467 if (i + 1 < input.Length && IsHex(input[i + 1])) { 467 468 ++i; 468 469 code = code * 16 + ParseDigit(input[i]); … … 636 637 637 638 case FieldType.Enum: { 638 EnumDescriptor enumType = field.EnumType; 639 640 if (tokenizer.LookingAtInteger()) { 641 int number = tokenizer.ConsumeInt32(); 642 value = enumType.FindValueByNumber(number); 643 if (value == null) { 644 throw tokenizer.CreateFormatExceptionPreviousToken( 645 "Enum type \"" + enumType.FullName + 646 "\" has no value with number " + number + "."); 639 EnumDescriptor enumType = field.EnumType; 640 641 if (tokenizer.LookingAtInteger()) { 642 int number = tokenizer.ConsumeInt32(); 643 value = enumType.FindValueByNumber(number); 644 if (value == null) { 645 throw tokenizer.CreateFormatExceptionPreviousToken( 646 "Enum type \"" + enumType.FullName + 647 "\" has no value with number " + number + "."); 648 } 649 } else { 650 String id = tokenizer.ConsumeIdentifier(); 651 value = enumType.FindValueByName(id); 652 if (value == null) { 653 throw tokenizer.CreateFormatExceptionPreviousToken( 654 "Enum type \"" + enumType.FullName + 655 "\" has no value named \"" + id + "\"."); 656 } 647 657 } 648 } else { 649 String id = tokenizer.ConsumeIdentifier(); 650 value = enumType.FindValueByName(id); 651 if (value == null) { 652 throw tokenizer.CreateFormatExceptionPreviousToken( 653 "Enum type \"" + enumType.FullName + 654 "\" has no value named \"" + id + "\"."); 655 } 658 659 break; 656 660 } 657 658 break;659 }660 661 661 662 case FieldType.Message: -
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.