diff options
author | Jisi Liu <jisi.liu@gmail.com> | 2015-10-05 13:54:05 -0700 |
---|---|---|
committer | Jisi Liu <jisi.liu@gmail.com> | 2015-10-05 13:54:05 -0700 |
commit | 8d8177c75701014dfe27fec4cdd2b1647aefcb67 (patch) | |
tree | fdc5d0d0f2fd57f2ca641069c20b34ddf90ec919 | |
parent | 46e8ff63cb67a6520711da5317aaaef04d0414d0 (diff) | |
parent | cccf6fed7e2fad1240bb48ba0c47f3978ff7433d (diff) | |
download | protobuf-8d8177c75701014dfe27fec4cdd2b1647aefcb67.tar.gz protobuf-8d8177c75701014dfe27fec4cdd2b1647aefcb67.tar.bz2 protobuf-8d8177c75701014dfe27fec4cdd2b1647aefcb67.zip |
Merge remote-tracking branch 'origin/master' into fix-author
86 files changed, 4997 insertions, 2090 deletions
diff --git a/Makefile.am b/Makefile.am index e4dce6e5..62233012 100644 --- a/Makefile.am +++ b/Makefile.am @@ -95,6 +95,7 @@ csharp_EXTRA_DIST= \ csharp/src/Google.Protobuf.Test/TestProtos/UnittestIssues.cs \ csharp/src/Google.Protobuf.Test/TestProtos/UnittestProto3.cs \ csharp/src/Google.Protobuf.Test/TestProtos/UnittestWellKnownTypes.cs \ + csharp/src/Google.Protobuf.Test/WellKnownTypes/AnyTest.cs \ csharp/src/Google.Protobuf.Test/WellKnownTypes/DurationTest.cs \ csharp/src/Google.Protobuf.Test/WellKnownTypes/TimestampTest.cs \ csharp/src/Google.Protobuf.Test/WellKnownTypes/WrappersTest.cs \ @@ -149,6 +150,7 @@ csharp_EXTRA_DIST= \ csharp/src/Google.Protobuf/Reflection/ServiceDescriptor.cs \ csharp/src/Google.Protobuf/Reflection/SingleFieldAccessor.cs \ csharp/src/Google.Protobuf/WellKnownTypes/Any.cs \ + csharp/src/Google.Protobuf/WellKnownTypes/AnyPartial.cs \ csharp/src/Google.Protobuf/WellKnownTypes/Api.cs \ csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs \ csharp/src/Google.Protobuf/WellKnownTypes/DurationPartial.cs \ @@ -454,6 +456,7 @@ objectivec_EXTRA_DIST= \ objectivec/Tests/GPBMessageTests+Runtime.m \ objectivec/Tests/GPBMessageTests+Serialization.m \ objectivec/Tests/GPBMessageTests.m \ + objectivec/Tests/GPBObjectiveCPlusPlusTest.mm \ objectivec/Tests/GPBPerfTests.m \ objectivec/Tests/GPBStringTests.m \ objectivec/Tests/GPBSwiftTests.swift \ diff --git a/Protobuf.podspec b/Protobuf.podspec index 5cfc02b4..92ff2904 100644 --- a/Protobuf.podspec +++ b/Protobuf.podspec @@ -5,7 +5,7 @@ # dependent projects use the :git notation to refer to the library. Pod::Spec.new do |s| s.name = 'Protobuf' - s.version = '3.0.0-alpha-4' + s.version = '3.0.0-alpha-4.1' s.summary = 'Protocol Buffers v.3 runtime library for Objective-C.' s.homepage = 'https://github.com/google/protobuf' s.license = 'New BSD' @@ -21,7 +21,7 @@ Pod::Spec.new do |s| 'objectivec/google/protobuf/SourceContext.pbobjc.{h,m}', 'objectivec/google/protobuf/Struct.pbobjc.{h,m}', 'objectivec/google/protobuf/Timestamp.pbobjc.h', - 'objectivec/google/protobuf/Type.pbobjc.{h,m}' + 'objectivec/google/protobuf/Type.pbobjc.{h,m}', 'objectivec/google/protobuf/Wrappers.pbobjc.{h,m}' # Timestamp.pbobjc.m and Duration.pbobjc.m are #imported by GPBWellKnownTypes.m. So we can't # compile them (duplicate symbols), but we need them available for the importing: diff --git a/cmake/libprotoc.cmake b/cmake/libprotoc.cmake index 7aa92ee1..35e5faf2 100644 --- a/cmake/libprotoc.cmake +++ b/cmake/libprotoc.cmake @@ -14,6 +14,7 @@ set(libprotoc_files ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_service.cc ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_string_field.cc + ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_doc_comment.cc ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_enum.cc ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_enum_field.cc ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_field_base.cc diff --git a/csharp/generate_protos.sh b/csharp/generate_protos.sh index 0d217a9d..3a556b0e 100755 --- a/csharp/generate_protos.sh +++ b/csharp/generate_protos.sh @@ -35,11 +35,10 @@ if [ -z "$PROTOC" ]; then fi fi -# Descriptor proto -$PROTOC -Isrc --csharp_out=csharp/src/Google.Protobuf/Reflection \ - src/google/protobuf/descriptor.proto - -$PROTOC -Isrc --csharp_out=csharp/src/Google.Protobuf/WellKnownTypes \ +# descriptor.proto and well-known types +$PROTOC -Isrc --csharp_out=csharp/src/Google.Protobuf \ + --csharp_opt=base_namespace=Google.Protobuf \ + src/google/protobuf/descriptor.proto \ src/google/protobuf/any.proto \ src/google/protobuf/api.proto \ src/google/protobuf/duration.proto \ @@ -51,15 +50,18 @@ $PROTOC -Isrc --csharp_out=csharp/src/Google.Protobuf/WellKnownTypes \ src/google/protobuf/type.proto \ src/google/protobuf/wrappers.proto -$PROTOC -Isrc --csharp_out=csharp/src/Google.Protobuf.Test/TestProtos \ +# Test protos where the namespace matches the target location +$PROTOC -Isrc --csharp_out=csharp/src/Google.Protobuf.Test \ + --csharp_opt=base_namespace=Google.Protobuf \ src/google/protobuf/map_unittest_proto3.proto \ src/google/protobuf/unittest_proto3.proto \ src/google/protobuf/unittest_import_proto3.proto \ src/google/protobuf/unittest_import_public_proto3.proto \ src/google/protobuf/unittest_well_known_types.proto - -$PROTOC -Icsharp/protos --csharp_out=csharp/src/Google.Protobuf.Test/TestProtos \ +# Different base namespace to the protos above +$PROTOC -Icsharp/protos --csharp_out=csharp/src/Google.Protobuf.Test \ + --csharp_opt=base_namespace=UnitTest.Issues \ csharp/protos/unittest_issues.proto # AddressBook sample protos diff --git a/csharp/src/AddressBook/Addressbook.cs b/csharp/src/AddressBook/Addressbook.cs index f2be5bae..a830418a 100644 --- a/csharp/src/AddressBook/Addressbook.cs +++ b/csharp/src/AddressBook/Addressbook.cs @@ -9,10 +9,12 @@ using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; namespace Google.Protobuf.Examples.AddressBook { + /// <summary>Holder for reflection information generated from addressbook.proto</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Addressbook { #region Descriptor + /// <summary>File descriptor for addressbook.proto</summary> public static pbr::FileDescriptor Descriptor { get { return descriptor; } } @@ -21,14 +23,14 @@ namespace Google.Protobuf.Examples.AddressBook { static Addressbook() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "ChFhZGRyZXNzYm9vay5wcm90bxIIdHV0b3JpYWwi1QEKBlBlcnNvbhIMCgRu", - "YW1lGAEgASgJEgoKAmlkGAIgASgFEg0KBWVtYWlsGAMgASgJEiwKBnBob25l", - "cxgEIAMoCzIcLnR1dG9yaWFsLlBlcnNvbi5QaG9uZU51bWJlchpHCgtQaG9u", - "ZU51bWJlchIOCgZudW1iZXIYASABKAkSKAoEdHlwZRgCIAEoDjIaLnR1dG9y", - "aWFsLlBlcnNvbi5QaG9uZVR5cGUiKwoJUGhvbmVUeXBlEgoKBk1PQklMRRAA", - "EggKBEhPTUUQARIICgRXT1JLEAIiLwoLQWRkcmVzc0Jvb2sSIAoGcGVvcGxl", - "GAEgAygLMhAudHV0b3JpYWwuUGVyc29uQlAKFGNvbS5leGFtcGxlLnR1dG9y", - "aWFsQhFBZGRyZXNzQm9va1Byb3Rvc6oCJEdvb2dsZS5Qcm90b2J1Zi5FeGFt", + "ChFhZGRyZXNzYm9vay5wcm90bxIIdHV0b3JpYWwi1QEKBlBlcnNvbhIMCgRu", + "YW1lGAEgASgJEgoKAmlkGAIgASgFEg0KBWVtYWlsGAMgASgJEiwKBnBob25l", + "cxgEIAMoCzIcLnR1dG9yaWFsLlBlcnNvbi5QaG9uZU51bWJlchpHCgtQaG9u", + "ZU51bWJlchIOCgZudW1iZXIYASABKAkSKAoEdHlwZRgCIAEoDjIaLnR1dG9y", + "aWFsLlBlcnNvbi5QaG9uZVR5cGUiKwoJUGhvbmVUeXBlEgoKBk1PQklMRRAA", + "EggKBEhPTUUQARIICgRXT1JLEAIiLwoLQWRkcmVzc0Jvb2sSIAoGcGVvcGxl", + "GAEgAygLMhAudHV0b3JpYWwuUGVyc29uQlAKFGNvbS5leGFtcGxlLnR1dG9y", + "aWFsQhFBZGRyZXNzQm9va1Byb3Rvc6oCJEdvb2dsZS5Qcm90b2J1Zi5FeGFt", "cGxlcy5BZGRyZXNzQm9va2IGcHJvdG8z")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbr::FileDescriptor[] { }, @@ -71,6 +73,7 @@ namespace Google.Protobuf.Examples.AddressBook { return new Person(this); } + /// <summary>Field number for the "name" field.</summary> public const int NameFieldNumber = 1; private string name_ = ""; public string Name { @@ -80,8 +83,12 @@ namespace Google.Protobuf.Examples.AddressBook { } } + /// <summary>Field number for the "id" field.</summary> public const int IdFieldNumber = 2; private int id_; + /// <summary> + /// Unique ID number for this person. + /// </summary> public int Id { get { return id_; } set { @@ -89,6 +96,7 @@ namespace Google.Protobuf.Examples.AddressBook { } } + /// <summary>Field number for the "email" field.</summary> public const int EmailFieldNumber = 3; private string email_ = ""; public string Email { @@ -98,6 +106,7 @@ namespace Google.Protobuf.Examples.AddressBook { } } + /// <summary>Field number for the "phones" field.</summary> public const int PhonesFieldNumber = 4; private static readonly pb::FieldCodec<global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneNumber> _repeated_phones_codec = pb::FieldCodec.ForMessage(34, global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneNumber.Parser); @@ -212,6 +221,7 @@ namespace Google.Protobuf.Examples.AddressBook { } #region Nested types + /// <summary>Container for nested types declared in the Person message type.</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Types { public enum PhoneType { @@ -248,6 +258,7 @@ namespace Google.Protobuf.Examples.AddressBook { return new PhoneNumber(this); } + /// <summary>Field number for the "number" field.</summary> public const int NumberFieldNumber = 1; private string number_ = ""; public string Number { @@ -257,6 +268,7 @@ namespace Google.Protobuf.Examples.AddressBook { } } + /// <summary>Field number for the "type" field.</summary> public const int TypeFieldNumber = 2; private global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType type_ = global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.MOBILE; public global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType Type { @@ -353,6 +365,9 @@ namespace Google.Protobuf.Examples.AddressBook { } + /// <summary> + /// Our address book file is just one of these. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class AddressBook : pb::IMessage<AddressBook> { private static readonly pb::MessageParser<AddressBook> _parser = new pb::MessageParser<AddressBook>(() => new AddressBook()); @@ -380,6 +395,7 @@ namespace Google.Protobuf.Examples.AddressBook { return new AddressBook(this); } + /// <summary>Field number for the "people" field.</summary> public const int PeopleFieldNumber = 1; private static readonly pb::FieldCodec<global::Google.Protobuf.Examples.AddressBook.Person> _repeated_people_codec = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.Examples.AddressBook.Person.Parser); diff --git a/csharp/src/Google.Protobuf.Conformance/Conformance.cs b/csharp/src/Google.Protobuf.Conformance/Conformance.cs index e905d4e4..dfd331ae 100644 --- a/csharp/src/Google.Protobuf.Conformance/Conformance.cs +++ b/csharp/src/Google.Protobuf.Conformance/Conformance.cs @@ -9,10 +9,12 @@ using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; namespace Conformance { + /// <summary>Holder for reflection information generated from conformance.proto</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Conformance { #region Descriptor + /// <summary>File descriptor for conformance.proto</summary> public static pbr::FileDescriptor Descriptor { get { return descriptor; } } @@ -21,116 +23,116 @@ namespace Conformance { static Conformance() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "ChFjb25mb3JtYW5jZS5wcm90bxILY29uZm9ybWFuY2UijQEKEkNvbmZvcm1h", - "bmNlUmVxdWVzdBIaChBwcm90b2J1Zl9wYXlsb2FkGAEgASgMSAASFgoManNv", - "bl9wYXlsb2FkGAIgASgJSAASOAoXcmVxdWVzdGVkX291dHB1dF9mb3JtYXQY", - "AyABKA4yFy5jb25mb3JtYW5jZS5XaXJlRm9ybWF0QgkKB3BheWxvYWQilgEK", - "E0NvbmZvcm1hbmNlUmVzcG9uc2USFQoLcGFyc2VfZXJyb3IYASABKAlIABIX", - "Cg1ydW50aW1lX2Vycm9yGAIgASgJSAASGgoQcHJvdG9idWZfcGF5bG9hZBgD", - "IAEoDEgAEhYKDGpzb25fcGF5bG9hZBgEIAEoCUgAEhEKB3NraXBwZWQYBSAB", - "KAlIAEIICgZyZXN1bHQi6yIKDFRlc3RBbGxUeXBlcxIWCg5vcHRpb25hbF9p", - "bnQzMhgBIAEoBRIWCg5vcHRpb25hbF9pbnQ2NBgCIAEoAxIXCg9vcHRpb25h", - "bF91aW50MzIYAyABKA0SFwoPb3B0aW9uYWxfdWludDY0GAQgASgEEhcKD29w", - "dGlvbmFsX3NpbnQzMhgFIAEoERIXCg9vcHRpb25hbF9zaW50NjQYBiABKBIS", - "GAoQb3B0aW9uYWxfZml4ZWQzMhgHIAEoBxIYChBvcHRpb25hbF9maXhlZDY0", - "GAggASgGEhkKEW9wdGlvbmFsX3NmaXhlZDMyGAkgASgPEhkKEW9wdGlvbmFs", - "X3NmaXhlZDY0GAogASgQEhYKDm9wdGlvbmFsX2Zsb2F0GAsgASgCEhcKD29w", - "dGlvbmFsX2RvdWJsZRgMIAEoARIVCg1vcHRpb25hbF9ib29sGA0gASgIEhcK", - "D29wdGlvbmFsX3N0cmluZxgOIAEoCRIWCg5vcHRpb25hbF9ieXRlcxgPIAEo", - "DBJIChdvcHRpb25hbF9uZXN0ZWRfbWVzc2FnZRgSIAEoCzInLmNvbmZvcm1h", - "bmNlLlRlc3RBbGxUeXBlcy5OZXN0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DwoLRk9SRUlHTl9CQVIQARIPCgtGT1JFSUdOX0JBWhACQiEKH2NvbS5n", "b29nbGUucHJvdG9idWYuY29uZm9ybWFuY2ViBnByb3RvMw==")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbr::FileDescriptor[] { }, @@ -161,6 +163,12 @@ namespace Conformance { #endregion #region Messages + /// <summary> + /// Represents a single test case's input. The testee should: + /// 1. parse this proto (which should always succeed) + /// 2. parse the protobuf or JSON payload in "payload" (which may fail) + /// 3. if the parse succeeded, serialize the message in the requested format. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class ConformanceRequest : pb::IMessage<ConformanceRequest> { private static readonly pb::MessageParser<ConformanceRequest> _parser = new pb::MessageParser<ConformanceRequest>(() => new ConformanceRequest()); @@ -197,6 +205,7 @@ namespace Conformance { return new ConformanceRequest(this); } + /// <summary>Field number for the "protobuf_payload" field.</summary> public const int ProtobufPayloadFieldNumber = 1; public pb::ByteString ProtobufPayload { get { return payloadCase_ == PayloadOneofCase.ProtobufPayload ? (pb::ByteString) payload_ : pb::ByteString.Empty; } @@ -206,6 +215,7 @@ namespace Conformance { } } + /// <summary>Field number for the "json_payload" field.</summary> public const int JsonPayloadFieldNumber = 2; public string JsonPayload { get { return payloadCase_ == PayloadOneofCase.JsonPayload ? (string) payload_ : ""; } @@ -215,8 +225,12 @@ namespace Conformance { } } + /// <summary>Field number for the "requested_output_format" field.</summary> public const int RequestedOutputFormatFieldNumber = 3; private global::Conformance.WireFormat requestedOutputFormat_ = global::Conformance.WireFormat.UNSPECIFIED; + /// <summary> + /// Which format should the testee serialize its message to? + /// </summary> public global::Conformance.WireFormat RequestedOutputFormat { get { return requestedOutputFormat_; } set { @@ -225,6 +239,7 @@ namespace Conformance { } private object payload_; + /// <summary>Enum of possible cases for the "payload" oneof.</summary> public enum PayloadOneofCase { None = 0, ProtobufPayload = 1, @@ -341,6 +356,9 @@ namespace Conformance { } + /// <summary> + /// Represents a single test case's output. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class ConformanceResponse : pb::IMessage<ConformanceResponse> { private static readonly pb::MessageParser<ConformanceResponse> _parser = new pb::MessageParser<ConformanceResponse>(() => new ConformanceResponse()); @@ -385,7 +403,14 @@ namespace Conformance { return new ConformanceResponse(this); } + /// <summary>Field number for the "parse_error" field.</summary> public const int ParseErrorFieldNumber = 1; + /// <summary> + /// This string should be set to indicate parsing failed. The string can + /// provide more information about the parse error if it is available. + /// Setting this string does not necessarily mean the testee failed the + /// test. Some of the test cases are intentionally invalid input. + /// </summary> public string ParseError { get { return resultCase_ == ResultOneofCase.ParseError ? (string) result_ : ""; } set { @@ -394,7 +419,13 @@ namespace Conformance { } } + /// <summary>Field number for the "runtime_error" field.</summary> public const int RuntimeErrorFieldNumber = 2; + /// <summary> + /// This should be set if some other error occurred. This will always + /// indicate that the test failed. The string can provide more information + /// about the failure. + /// </summary> public string RuntimeError { get { return resultCase_ == ResultOneofCase.RuntimeError ? (string) result_ : ""; } set { @@ -403,7 +434,12 @@ namespace Conformance { } } + /// <summary>Field number for the "protobuf_payload" field.</summary> public const int ProtobufPayloadFieldNumber = 3; + /// <summary> + /// If the input was successfully parsed and the requested output was + /// protobuf, serialize it to protobuf and set it in this field. + /// </summary> public pb::ByteString ProtobufPayload { get { return resultCase_ == ResultOneofCase.ProtobufPayload ? (pb::ByteString) result_ : pb::ByteString.Empty; } set { @@ -412,7 +448,12 @@ namespace Conformance { } } + /// <summary>Field number for the "json_payload" field.</summary> public const int JsonPayloadFieldNumber = 4; + /// <summary> + /// If the input was successfully parsed and the requested output was JSON, + /// serialize to JSON and set it in this field. + /// </summary> public string JsonPayload { get { return resultCase_ == ResultOneofCase.JsonPayload ? (string) result_ : ""; } set { @@ -421,7 +462,12 @@ namespace Conformance { } } + /// <summary>Field number for the "skipped" field.</summary> public const int SkippedFieldNumber = 5; + /// <summary> + /// For when the testee skipped the test, likely because a certain feature + /// wasn't supported, like JSON input/output. + /// </summary> public string Skipped { get { return resultCase_ == ResultOneofCase.Skipped ? (string) result_ : ""; } set { @@ -431,6 +477,7 @@ namespace Conformance { } private object result_; + /// <summary>Enum of possible cases for the "result" oneof.</summary> public enum ResultOneofCase { None = 0, ParseError = 1, @@ -582,6 +629,10 @@ namespace Conformance { } + /// <summary> + /// This proto includes every type of field in both singular and repeated + /// forms. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class TestAllTypes : pb::IMessage<TestAllTypes> { private static readonly pb::MessageParser<TestAllTypes> _parser = new pb::MessageParser<TestAllTypes>(() => new TestAllTypes()); @@ -685,8 +736,12 @@ namespace Conformance { return new TestAllTypes(this); } + /// <summary>Field number for the "optional_int32" field.</summary> public const int OptionalInt32FieldNumber = 1; private int optionalInt32_; + /// <summary> + /// Singular + /// </summary> public int OptionalInt32 { get { return optionalInt32_; } set { @@ -694,6 +749,7 @@ namespace Conformance { } } + /// <summary>Field number for the "optional_int64" field.</summary> public const int OptionalInt64FieldNumber = 2; private long optionalInt64_; public long OptionalInt64 { @@ -703,6 +759,7 @@ namespace Conformance { } } + /// <summary>Field number for the "optional_uint32" field.</summary> public const int OptionalUint32FieldNumber = 3; private uint optionalUint32_; public uint OptionalUint32 { @@ -712,6 +769,7 @@ namespace Conformance { } } + /// <summary>Field number for the "optional_uint64" field.</summary> public const int OptionalUint64FieldNumber = 4; private ulong optionalUint64_; public ulong OptionalUint64 { @@ -721,6 +779,7 @@ namespace Conformance { } } + /// <summary>Field number for the "optional_sint32" field.</summary> public const int OptionalSint32FieldNumber = 5; private int optionalSint32_; public int OptionalSint32 { @@ -730,6 +789,7 @@ namespace Conformance { } } + /// <summary>Field number for the "optional_sint64" field.</summary> public const int OptionalSint64FieldNumber = 6; private long optionalSint64_; public long OptionalSint64 { @@ -739,6 +799,7 @@ namespace Conformance { } } + /// <summary>Field number for the "optional_fixed32" field.</summary> public const int OptionalFixed32FieldNumber = 7; private uint optionalFixed32_; public uint OptionalFixed32 { @@ -748,6 +809,7 @@ namespace Conformance { } } + /// <summary>Field number for the "optional_fixed64" field.</summary> public const int OptionalFixed64FieldNumber = 8; private ulong optionalFixed64_; public ulong OptionalFixed64 { @@ -757,6 +819,7 @@ namespace Conformance { } } + /// <summary>Field number for the "optional_sfixed32" field.</summary> public const int OptionalSfixed32FieldNumber = 9; private int optionalSfixed32_; public int OptionalSfixed32 { @@ -766,6 +829,7 @@ namespace Conformance { } } + /// <summary>Field number for the "optional_sfixed64" field.</summary> public const int OptionalSfixed64FieldNumber = 10; private long optionalSfixed64_; public long OptionalSfixed64 { @@ -775,6 +839,7 @@ namespace Conformance { } } + /// <summary>Field number for the "optional_float" field.</summary> public const int OptionalFloatFieldNumber = 11; private float optionalFloat_; public float OptionalFloat { @@ -784,6 +849,7 @@ namespace Conformance { } } + /// <summary>Field number for the "optional_double" field.</summary> public const int OptionalDoubleFieldNumber = 12; private double optionalDouble_; public double OptionalDouble { @@ -793,6 +859,7 @@ namespace Conformance { } } + /// <summary>Field number for the "optional_bool" field.</summary> public const int OptionalBoolFieldNumber = 13; private bool optionalBool_; public bool OptionalBool { @@ -802,6 +869,7 @@ namespace Conformance { } } + /// <summary>Field number for the "optional_string" field.</summary> public const int OptionalStringFieldNumber = 14; private string optionalString_ = ""; public string OptionalString { @@ -811,6 +879,7 @@ namespace Conformance { } } + /// <summary>Field number for the "optional_bytes" field.</summary> public const int OptionalBytesFieldNumber = 15; private pb::ByteString optionalBytes_ = pb::ByteString.Empty; public pb::ByteString OptionalBytes { @@ -820,6 +889,7 @@ namespace Conformance { } } + /// <summary>Field number for the "optional_nested_message" field.</summary> public const int OptionalNestedMessageFieldNumber = 18; private global::Conformance.TestAllTypes.Types.NestedMessage optionalNestedMessage_; public global::Conformance.TestAllTypes.Types.NestedMessage OptionalNestedMessage { @@ -829,6 +899,7 @@ namespace Conformance { } } + /// <summary>Field number for the "optional_foreign_message" field.</summary> public const int OptionalForeignMessageFieldNumber = 19; private global::Conformance.ForeignMessage optionalForeignMessage_; public global::Conformance.ForeignMessage OptionalForeignMessage { @@ -838,6 +909,7 @@ namespace Conformance { } } + /// <summary>Field number for the "optional_nested_enum" field.</summary> public const int OptionalNestedEnumFieldNumber = 21; private global::Conformance.TestAllTypes.Types.NestedEnum optionalNestedEnum_ = global::Conformance.TestAllTypes.Types.NestedEnum.FOO; public global::Conformance.TestAllTypes.Types.NestedEnum OptionalNestedEnum { @@ -847,6 +919,7 @@ namespace Conformance { } } + /// <summary>Field number for the "optional_foreign_enum" field.</summary> public const int OptionalForeignEnumFieldNumber = 22; private global::Conformance.ForeignEnum optionalForeignEnum_ = global::Conformance.ForeignEnum.FOREIGN_FOO; public global::Conformance.ForeignEnum OptionalForeignEnum { @@ -856,6 +929,7 @@ namespace Conformance { } } + /// <summary>Field number for the "optional_string_piece" field.</summary> public const int OptionalStringPieceFieldNumber = 24; private string optionalStringPiece_ = ""; public string OptionalStringPiece { @@ -865,6 +939,7 @@ namespace Conformance { } } + /// <summary>Field number for the "optional_cord" field.</summary> public const int OptionalCordFieldNumber = 25; private string optionalCord_ = ""; public string OptionalCord { @@ -874,6 +949,7 @@ namespace Conformance { } } + /// <summary>Field number for the "recursive_message" field.</summary> public const int RecursiveMessageFieldNumber = 27; private global::Conformance.TestAllTypes recursiveMessage_; public global::Conformance.TestAllTypes RecursiveMessage { @@ -883,14 +959,19 @@ namespace Conformance { } } + /// <summary>Field number for the "repeated_int32" field.</summary> public const int RepeatedInt32FieldNumber = 31; private static readonly pb::FieldCodec<int> _repeated_repeatedInt32_codec = pb::FieldCodec.ForInt32(250); private readonly pbc::RepeatedField<int> repeatedInt32_ = new pbc::RepeatedField<int>(); + /// <summary> + /// Repeated + /// </summary> public pbc::RepeatedField<int> RepeatedInt32 { get { return repeatedInt32_; } } + /// <summary>Field number for the "repeated_int64" field.</summary> public const int RepeatedInt64FieldNumber = 32; private static readonly pb::FieldCodec<long> _repeated_repeatedInt64_codec = pb::FieldCodec.ForInt64(258); @@ -899,6 +980,7 @@ namespace Conformance { get { return repeatedInt64_; } } + /// <summary>Field number for the "repeated_uint32" field.</summary> public const int RepeatedUint32FieldNumber = 33; private static readonly pb::FieldCodec<uint> _repeated_repeatedUint32_codec = pb::FieldCodec.ForUInt32(266); @@ -907,6 +989,7 @@ namespace Conformance { get { return repeatedUint32_; } } + /// <summary>Field number for the "repeated_uint64" field.</summary> public const int RepeatedUint64FieldNumber = 34; private static readonly pb::FieldCodec<ulong> _repeated_repeatedUint64_codec = pb::FieldCodec.ForUInt64(274); @@ -915,6 +998,7 @@ namespace Conformance { get { return repeatedUint64_; } } + /// <summary>Field number for the "repeated_sint32" field.</summary> public const int RepeatedSint32FieldNumber = 35; private static readonly pb::FieldCodec<int> _repeated_repeatedSint32_codec = pb::FieldCodec.ForSInt32(282); @@ -923,6 +1007,7 @@ namespace Conformance { get { return repeatedSint32_; } } + /// <summary>Field number for the "repeated_sint64" field.</summary> public const int RepeatedSint64FieldNumber = 36; private static readonly pb::FieldCodec<long> _repeated_repeatedSint64_codec = pb::FieldCodec.ForSInt64(290); @@ -931,6 +1016,7 @@ namespace Conformance { get { return repeatedSint64_; } } + /// <summary>Field number for the "repeated_fixed32" field.</summary> public const int RepeatedFixed32FieldNumber = 37; private static readonly pb::FieldCodec<uint> _repeated_repeatedFixed32_codec = pb::FieldCodec.ForFixed32(298); @@ -939,6 +1025,7 @@ namespace Conformance { get { return repeatedFixed32_; } } + /// <summary>Field number for the "repeated_fixed64" field.</summary> public const int RepeatedFixed64FieldNumber = 38; private static readonly pb::FieldCodec<ulong> _repeated_repeatedFixed64_codec = pb::FieldCodec.ForFixed64(306); @@ -947,6 +1034,7 @@ namespace Conformance { get { return repeatedFixed64_; } } + /// <summary>Field number for the "repeated_sfixed32" field.</summary> public const int RepeatedSfixed32FieldNumber = 39; private static readonly pb::FieldCodec<int> _repeated_repeatedSfixed32_codec = pb::FieldCodec.ForSFixed32(314); @@ -955,6 +1043,7 @@ namespace Conformance { get { return repeatedSfixed32_; } } + /// <summary>Field number for the "repeated_sfixed64" field.</summary> public const int RepeatedSfixed64FieldNumber = 40; private static readonly pb::FieldCodec<long> _repeated_repeatedSfixed64_codec = pb::FieldCodec.ForSFixed64(322); @@ -963,6 +1052,7 @@ namespace Conformance { get { return repeatedSfixed64_; } } + /// <summary>Field number for the "repeated_float" field.</summary> public const int RepeatedFloatFieldNumber = 41; private static readonly pb::FieldCodec<float> _repeated_repeatedFloat_codec = pb::FieldCodec.ForFloat(330); @@ -971,6 +1061,7 @@ namespace Conformance { get { return repeatedFloat_; } } + /// <summary>Field number for the "repeated_double" field.</summary> public const int RepeatedDoubleFieldNumber = 42; private static readonly pb::FieldCodec<double> _repeated_repeatedDouble_codec = pb::FieldCodec.ForDouble(338); @@ -979,6 +1070,7 @@ namespace Conformance { get { return repeatedDouble_; } } + /// <summary>Field number for the "repeated_bool" field.</summary> public const int RepeatedBoolFieldNumber = 43; private static readonly pb::FieldCodec<bool> _repeated_repeatedBool_codec = pb::FieldCodec.ForBool(346); @@ -987,6 +1079,7 @@ namespace Conformance { get { return repeatedBool_; } } + /// <summary>Field number for the "repeated_string" field.</summary> public const int RepeatedStringFieldNumber = 44; private static readonly pb::FieldCodec<string> _repeated_repeatedString_codec = pb::FieldCodec.ForString(354); @@ -995,6 +1088,7 @@ namespace Conformance { get { return repeatedString_; } } + /// <summary>Field number for the "repeated_bytes" field.</summary> public const int RepeatedBytesFieldNumber = 45; private static readonly pb::FieldCodec<pb::ByteString> _repeated_repeatedBytes_codec = pb::FieldCodec.ForBytes(362); @@ -1003,6 +1097,7 @@ namespace Conformance { get { return repeatedBytes_; } } + /// <summary>Field number for the "repeated_nested_message" field.</summary> public const int RepeatedNestedMessageFieldNumber = 48; private static readonly pb::FieldCodec<global::Conformance.TestAllTypes.Types.NestedMessage> _repeated_repeatedNestedMessage_codec = pb::FieldCodec.ForMessage(386, global::Conformance.TestAllTypes.Types.NestedMessage.Parser); @@ -1011,6 +1106,7 @@ namespace Conformance { get { return repeatedNestedMessage_; } } + /// <summary>Field number for the "repeated_foreign_message" field.</summary> public const int RepeatedForeignMessageFieldNumber = 49; private static readonly pb::FieldCodec<global::Conformance.ForeignMessage> _repeated_repeatedForeignMessage_codec = pb::FieldCodec.ForMessage(394, global::Conformance.ForeignMessage.Parser); @@ -1019,6 +1115,7 @@ namespace Conformance { get { return repeatedForeignMessage_; } } + /// <summary>Field number for the "repeated_nested_enum" field.</summary> public const int RepeatedNestedEnumFieldNumber = 51; private static readonly pb::FieldCodec<global::Conformance.TestAllTypes.Types.NestedEnum> _repeated_repeatedNestedEnum_codec = pb::FieldCodec.ForEnum(410, x => (int) x, x => (global::Conformance.TestAllTypes.Types.NestedEnum) x); @@ -1027,6 +1124,7 @@ namespace Conformance { get { return repeatedNestedEnum_; } } + /// <summary>Field number for the "repeated_foreign_enum" field.</summary> public const int RepeatedForeignEnumFieldNumber = 52; private static readonly pb::FieldCodec<global::Conformance.ForeignEnum> _repeated_repeatedForeignEnum_codec = pb::FieldCodec.ForEnum(418, x => (int) x, x => (global::Conformance.ForeignEnum) x); @@ -1035,6 +1133,7 @@ namespace Conformance { get { return repeatedForeignEnum_; } } + /// <summary>Field number for the "repeated_string_piece" field.</summary> public const int RepeatedStringPieceFieldNumber = 54; private static readonly pb::FieldCodec<string> _repeated_repeatedStringPiece_codec = pb::FieldCodec.ForString(434); @@ -1043,6 +1142,7 @@ namespace Conformance { get { return repeatedStringPiece_; } } + /// <summary>Field number for the "repeated_cord" field.</summary> public const int RepeatedCordFieldNumber = 55; private static readonly pb::FieldCodec<string> _repeated_repeatedCord_codec = pb::FieldCodec.ForString(442); @@ -1051,14 +1151,19 @@ namespace Conformance { get { return repeatedCord_; } } + /// <summary>Field number for the "map_int32_int32" field.</summary> public const int MapInt32Int32FieldNumber = 56; private static readonly pbc::MapField<int, int>.Codec _map_mapInt32Int32_codec = new pbc::MapField<int, int>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForInt32(16), 450); private readonly pbc::MapField<int, int> mapInt32Int32_ = new pbc::MapField<int, int>(); + /// <summary> + /// Map + /// </summary> public pbc::MapField<int, int> MapInt32Int32 { get { return mapInt32Int32_; } } + /// <summary>Field number for the "map_int64_int64" field.</summary> public const int MapInt64Int64FieldNumber = 57; private static readonly pbc::MapField<long, long>.Codec _map_mapInt64Int64_codec = new pbc::MapField<long, long>.Codec(pb::FieldCodec.ForInt64(8), pb::FieldCodec.ForInt64(16), 458); @@ -1067,6 +1172,7 @@ namespace Conformance { get { return mapInt64Int64_; } } + /// <summary>Field number for the "map_uint32_uint32" field.</summary> public const int MapUint32Uint32FieldNumber = 58; private static readonly pbc::MapField<uint, uint>.Codec _map_mapUint32Uint32_codec = new pbc::MapField<uint, uint>.Codec(pb::FieldCodec.ForUInt32(8), pb::FieldCodec.ForUInt32(16), 466); @@ -1075,6 +1181,7 @@ namespace Conformance { get { return mapUint32Uint32_; } } + /// <summary>Field number for the "map_uint64_uint64" field.</summary> public const int MapUint64Uint64FieldNumber = 59; private static readonly pbc::MapField<ulong, ulong>.Codec _map_mapUint64Uint64_codec = new pbc::MapField<ulong, ulong>.Codec(pb::FieldCodec.ForUInt64(8), pb::FieldCodec.ForUInt64(16), 474); @@ -1083,6 +1190,7 @@ namespace Conformance { get { return mapUint64Uint64_; } } + /// <summary>Field number for the "map_sint32_sint32" field.</summary> public const int MapSint32Sint32FieldNumber = 60; private static readonly pbc::MapField<int, int>.Codec _map_mapSint32Sint32_codec = new pbc::MapField<int, int>.Codec(pb::FieldCodec.ForSInt32(8), pb::FieldCodec.ForSInt32(16), 482); @@ -1091,6 +1199,7 @@ namespace Conformance { get { return mapSint32Sint32_; } } + /// <summary>Field number for the "map_sint64_sint64" field.</summary> public const int MapSint64Sint64FieldNumber = 61; private static readonly pbc::MapField<long, long>.Codec _map_mapSint64Sint64_codec = new pbc::MapField<long, long>.Codec(pb::FieldCodec.ForSInt64(8), pb::FieldCodec.ForSInt64(16), 490); @@ -1099,6 +1208,7 @@ namespace Conformance { get { return mapSint64Sint64_; } } + /// <summary>Field number for the "map_fixed32_fixed32" field.</summary> public const int MapFixed32Fixed32FieldNumber = 62; private static readonly pbc::MapField<uint, uint>.Codec _map_mapFixed32Fixed32_codec = new pbc::MapField<uint, uint>.Codec(pb::FieldCodec.ForFixed32(13), pb::FieldCodec.ForFixed32(21), 498); @@ -1107,6 +1217,7 @@ namespace Conformance { get { return mapFixed32Fixed32_; } } + /// <summary>Field number for the "map_fixed64_fixed64" field.</summary> public const int MapFixed64Fixed64FieldNumber = 63; private static readonly pbc::MapField<ulong, ulong>.Codec _map_mapFixed64Fixed64_codec = new pbc::MapField<ulong, ulong>.Codec(pb::FieldCodec.ForFixed64(9), pb::FieldCodec.ForFixed64(17), 506); @@ -1115,6 +1226,7 @@ namespace Conformance { get { return mapFixed64Fixed64_; } } + /// <summary>Field number for the "map_sfixed32_sfixed32" field.</summary> public const int MapSfixed32Sfixed32FieldNumber = 64; private static readonly pbc::MapField<int, int>.Codec _map_mapSfixed32Sfixed32_codec = new pbc::MapField<int, int>.Codec(pb::FieldCodec.ForSFixed32(13), pb::FieldCodec.ForSFixed32(21), 514); @@ -1123,6 +1235,7 @@ namespace Conformance { get { return mapSfixed32Sfixed32_; } } + /// <summary>Field number for the "map_sfixed64_sfixed64" field.</summary> public const int MapSfixed64Sfixed64FieldNumber = 65; private static readonly pbc::MapField<long, long>.Codec _map_mapSfixed64Sfixed64_codec = new pbc::MapField<long, long>.Codec(pb::FieldCodec.ForSFixed64(9), pb::FieldCodec.ForSFixed64(17), 522); @@ -1131,6 +1244,7 @@ namespace Conformance { get { return mapSfixed64Sfixed64_; } } + /// <summary>Field number for the "map_int32_float" field.</summary> public const int MapInt32FloatFieldNumber = 66; private static readonly pbc::MapField<int, float>.Codec _map_mapInt32Float_codec = new pbc::MapField<int, float>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForFloat(21), 530); @@ -1139,6 +1253,7 @@ namespace Conformance { get { return mapInt32Float_; } } + /// <summary>Field number for the "map_int32_double" field.</summary> public const int MapInt32DoubleFieldNumber = 67; private static readonly pbc::MapField<int, double>.Codec _map_mapInt32Double_codec = new pbc::MapField<int, double>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForDouble(17), 538); @@ -1147,6 +1262,7 @@ namespace Conformance { get { return mapInt32Double_; } } + /// <summary>Field number for the "map_bool_bool" field.</summary> public const int MapBoolBoolFieldNumber = 68; private static readonly pbc::MapField<bool, bool>.Codec _map_mapBoolBool_codec = new pbc::MapField<bool, bool>.Codec(pb::FieldCodec.ForBool(8), pb::FieldCodec.ForBool(16), 546); @@ -1155,6 +1271,7 @@ namespace Conformance { get { return mapBoolBool_; } } + /// <summary>Field number for the "map_string_string" field.</summary> public const int MapStringStringFieldNumber = 69; private static readonly pbc::MapField<string, string>.Codec _map_mapStringString_codec = new pbc::MapField<string, string>.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForString(18), 554); @@ -1163,6 +1280,7 @@ namespace Conformance { get { return mapStringString_; } } + /// <summary>Field number for the "map_string_bytes" field.</summary> public const int MapStringBytesFieldNumber = 70; private static readonly pbc::MapField<string, pb::ByteString>.Codec _map_mapStringBytes_codec = new pbc::MapField<string, pb::ByteString>.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForBytes(18), 562); @@ -1171,6 +1289,7 @@ namespace Conformance { get { return mapStringBytes_; } } + /// <summary>Field number for the "map_string_nested_message" field.</summary> public const int MapStringNestedMessageFieldNumber = 71; private static readonly pbc::MapField<string, global::Conformance.TestAllTypes.Types.NestedMessage>.Codec _map_mapStringNestedMessage_codec = new pbc::MapField<string, global::Conformance.TestAllTypes.Types.NestedMessage>.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForMessage(18, global::Conformance.TestAllTypes.Types.NestedMessage.Parser), 570); @@ -1179,6 +1298,7 @@ namespace Conformance { get { return mapStringNestedMessage_; } } + /// <summary>Field number for the "map_string_foreign_message" field.</summary> public const int MapStringForeignMessageFieldNumber = 72; private static readonly pbc::MapField<string, global::Conformance.ForeignMessage>.Codec _map_mapStringForeignMessage_codec = new pbc::MapField<string, global::Conformance.ForeignMessage>.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForMessage(18, global::Conformance.ForeignMessage.Parser), 578); @@ -1187,6 +1307,7 @@ namespace Conformance { get { return mapStringForeignMessage_; } } + /// <summary>Field number for the "map_string_nested_enum" field.</summary> public const int MapStringNestedEnumFieldNumber = 73; private static readonly pbc::MapField<string, global::Conformance.TestAllTypes.Types.NestedEnum>.Codec _map_mapStringNestedEnum_codec = new pbc::MapField<string, global::Conformance.TestAllTypes.Types.NestedEnum>.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::Conformance.TestAllTypes.Types.NestedEnum) x), 586); @@ -1195,6 +1316,7 @@ namespace Conformance { get { return mapStringNestedEnum_; } } + /// <summary>Field number for the "map_string_foreign_enum" field.</summary> public const int MapStringForeignEnumFieldNumber = 74; private static readonly pbc::MapField<string, global::Conformance.ForeignEnum>.Codec _map_mapStringForeignEnum_codec = new pbc::MapField<string, global::Conformance.ForeignEnum>.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::Conformance.ForeignEnum) x), 594); @@ -1203,6 +1325,7 @@ namespace Conformance { get { return mapStringForeignEnum_; } } + /// <summary>Field number for the "oneof_uint32" field.</summary> public const int OneofUint32FieldNumber = 111; public uint OneofUint32 { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofUint32 ? (uint) oneofField_ : 0; } @@ -1212,6 +1335,7 @@ namespace Conformance { } } + /// <summary>Field number for the "oneof_nested_message" field.</summary> public const int OneofNestedMessageFieldNumber = 112; public global::Conformance.TestAllTypes.Types.NestedMessage OneofNestedMessage { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage ? (global::Conformance.TestAllTypes.Types.NestedMessage) oneofField_ : null; } @@ -1221,6 +1345,7 @@ namespace Conformance { } } + /// <summary>Field number for the "oneof_string" field.</summary> public const int OneofStringFieldNumber = 113; public string OneofString { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofString ? (string) oneofField_ : ""; } @@ -1230,6 +1355,7 @@ namespace Conformance { } } + /// <summary>Field number for the "oneof_bytes" field.</summary> public const int OneofBytesFieldNumber = 114; public pb::ByteString OneofBytes { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofBytes ? (pb::ByteString) oneofField_ : pb::ByteString.Empty; } @@ -1240,6 +1366,7 @@ namespace Conformance { } private object oneofField_; + /// <summary>Enum of possible cases for the "oneof_field" oneof.</summary> public enum OneofFieldOneofCase { None = 0, OneofUint32 = 111, @@ -2123,12 +2250,16 @@ namespace Conformance { } #region Nested types + /// <summary>Container for nested types declared in the TestAllTypes message type.</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Types { public enum NestedEnum { FOO = 0, BAR = 1, BAZ = 2, + /// <summary> + /// Intentionally negative. + /// </summary> NEG = -1, } @@ -2160,6 +2291,7 @@ namespace Conformance { return new NestedMessage(this); } + /// <summary>Field number for the "a" field.</summary> public const int AFieldNumber = 1; private int a_; public int A { @@ -2169,6 +2301,7 @@ namespace Conformance { } } + /// <summary>Field number for the "corecursive" field.</summary> public const int CorecursiveFieldNumber = 2; private global::Conformance.TestAllTypes corecursive_; public global::Conformance.TestAllTypes Corecursive { @@ -2298,6 +2431,7 @@ namespace Conformance { return new ForeignMessage(this); } + /// <summary>Field number for the "c" field.</summary> public const int CFieldNumber = 1; private int c_; public int C { diff --git a/csharp/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj b/csharp/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj index d9593828..33be5dae 100644 --- a/csharp/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj +++ b/csharp/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj @@ -109,6 +109,7 @@ <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TestCornerCases.cs" />
<Compile Include="TestProtos\UnittestWellKnownTypes.cs" />
+ <Compile Include="WellKnownTypes\AnyTest.cs" />
<Compile Include="WellKnownTypes\DurationTest.cs" />
<Compile Include="WellKnownTypes\TimestampTest.cs" />
<Compile Include="WellKnownTypes\WrappersTest.cs" />
diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/MapUnittestProto3.cs b/csharp/src/Google.Protobuf.Test/TestProtos/MapUnittestProto3.cs index e9e18193..e3991bc8 100644 --- a/csharp/src/Google.Protobuf.Test/TestProtos/MapUnittestProto3.cs +++ b/csharp/src/Google.Protobuf.Test/TestProtos/MapUnittestProto3.cs @@ -9,10 +9,12 @@ using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; namespace Google.Protobuf.TestProtos { + /// <summary>Holder for reflection information generated from google/protobuf/map_unittest_proto3.proto</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class MapUnittestProto3 { #region Descriptor + /// <summary>File descriptor for google/protobuf/map_unittest_proto3.proto</summary> public static pbr::FileDescriptor Descriptor { get { return descriptor; } } @@ -21,129 +23,129 @@ namespace Google.Protobuf.TestProtos { static MapUnittestProto3() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "Cilnb29nbGUvcHJvdG9idWYvbWFwX3VuaXR0ZXN0X3Byb3RvMy5wcm90bxIR", - "cHJvdG9idWZfdW5pdHRlc3QaJWdvb2dsZS9wcm90b2J1Zi91bml0dGVzdF9w", - "cm90bzMucHJvdG8ilhIKB1Rlc3RNYXASRgoPbWFwX2ludDMyX2ludDMyGAEg", - "AygLMi0ucHJvdG9idWZfdW5pdHRlc3QuVGVzdE1hcC5NYXBJbnQzMkludDMy", - "RW50cnkSRgoPbWFwX2ludDY0X2ludDY0GAIgAygLMi0ucHJvdG9idWZfdW5p", - "dHRlc3QuVGVzdE1hcC5NYXBJbnQ2NEludDY0RW50cnkSSgoRbWFwX3VpbnQz", - "Ml91aW50MzIYAyADKAsyLy5wcm90b2J1Zl91bml0dGVzdC5UZXN0TWFwLk1h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kYASABKAgSDQoFdmFsdWUYAiABKAg6AjgBGk8KEU1hcEludDMyRW51", - "bUVudHJ5EgsKA2tleRgBIAEoBRIpCgV2YWx1ZRgCIAEoDjIaLnByb3RvYnVm", - "X3VuaXR0ZXN0Lk1hcEVudW06AjgBGmAKG01hcEludDMyRm9yZWlnbk1lc3Nh", - "Z2VFbnRyeRILCgNrZXkYASABKAUSMAoFdmFsdWUYAiABKAsyIS5wcm90b2J1", - "Zl91bml0dGVzdC5Gb3JlaWduTWVzc2FnZToCOAEi5AEKH01lc3NhZ2VDb250", - "YWluaW5nRW51bUNhbGxlZFR5cGUSSgoEdHlwZRgBIAMoCzI8LnByb3RvYnVm", - "X3VuaXR0ZXN0Lk1lc3NhZ2VDb250YWluaW5nRW51bUNhbGxlZFR5cGUuVHlw", - "ZUVudHJ5Gl8KCVR5cGVFbnRyeRILCgNrZXkYASABKAUSQQoFdmFsdWUYAiAB", - "KAsyMi5wcm90b2J1Zl91bml0dGVzdC5NZXNzYWdlQ29udGFpbmluZ0VudW1D", - "YWxsZWRUeXBlOgI4ASIUCgRUeXBlEgwKCFRZUEVfRk9PEAAinQEKH01lc3Nh", - "Z2VDb250YWluaW5nTWFwQ2FsbGVkRW50cnkSTAoFZW50cnkYASADKAsyPS5w", - "cm90b2J1Zl91bml0dGVzdC5NZXNzYWdlQ29udGFpbmluZ01hcENhbGxlZEVu", - "dHJ5LkVudHJ5RW50cnkaLAoKRW50cnlFbnRyeRILCgNrZXkYASABKAUSDQoF", - "dmFsdWUYAiABKAU6AjgBKj8KB01hcEVudW0SEAoMTUFQX0VOVU1fRk9PEAAS", - "EAoMTUFQX0VOVU1fQkFSEAESEAoMTUFQX0VOVU1fQkFaEAJCIPgBAaoCGkdv", + "Cilnb29nbGUvcHJvdG9idWYvbWFwX3VuaXR0ZXN0X3Byb3RvMy5wcm90bxIR", + "cHJvdG9idWZfdW5pdHRlc3QaJWdvb2dsZS9wcm90b2J1Zi91bml0dGVzdF9w", + "cm90bzMucHJ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cnlFbnRyeRILCgNrZXkYASABKAUSDQoF", + "dmFsdWUYAiABKAU6AjgBKj8KB01hcEVudW0SEAoMTUFQX0VOVU1fRk9PEAAS", + "EAoMTUFQX0VOVU1fQkFSEAESEAoMTUFQX0VOVU1fQkFaEAJCIPgBAaoCGkdv", "b2dsZS5Qcm90b2J1Zi5UZXN0UHJvdG9zYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbr::FileDescriptor[] { global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor, }, @@ -170,6 +172,9 @@ namespace Google.Protobuf.TestProtos { #endregion #region Messages + /// <summary> + /// Tests maps. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class TestMap : pb::IMessage<TestMap> { private static readonly pb::MessageParser<TestMap> _parser = new pb::MessageParser<TestMap>(() => new TestMap()); @@ -213,6 +218,7 @@ namespace Google.Protobuf.TestProtos { return new TestMap(this); } + /// <summary>Field number for the "map_int32_int32" field.</summary> public const int MapInt32Int32FieldNumber = 1; private static readonly pbc::MapField<int, int>.Codec _map_mapInt32Int32_codec = new pbc::MapField<int, int>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForInt32(16), 10); @@ -221,6 +227,7 @@ namespace Google.Protobuf.TestProtos { get { return mapInt32Int32_; } } + /// <summary>Field number for the "map_int64_int64" field.</summary> public const int MapInt64Int64FieldNumber = 2; private static readonly pbc::MapField<long, long>.Codec _map_mapInt64Int64_codec = new pbc::MapField<long, long>.Codec(pb::FieldCodec.ForInt64(8), pb::FieldCodec.ForInt64(16), 18); @@ -229,6 +236,7 @@ namespace Google.Protobuf.TestProtos { get { return mapInt64Int64_; } } + /// <summary>Field number for the "map_uint32_uint32" field.</summary> public const int MapUint32Uint32FieldNumber = 3; private static readonly pbc::MapField<uint, uint>.Codec _map_mapUint32Uint32_codec = new pbc::MapField<uint, uint>.Codec(pb::FieldCodec.ForUInt32(8), pb::FieldCodec.ForUInt32(16), 26); @@ -237,6 +245,7 @@ namespace Google.Protobuf.TestProtos { get { return mapUint32Uint32_; } } + /// <summary>Field number for the "map_uint64_uint64" field.</summary> public const int MapUint64Uint64FieldNumber = 4; private static readonly pbc::MapField<ulong, ulong>.Codec _map_mapUint64Uint64_codec = new pbc::MapField<ulong, ulong>.Codec(pb::FieldCodec.ForUInt64(8), pb::FieldCodec.ForUInt64(16), 34); @@ -245,6 +254,7 @@ namespace Google.Protobuf.TestProtos { get { return mapUint64Uint64_; } } + /// <summary>Field number for the "map_sint32_sint32" field.</summary> public const int MapSint32Sint32FieldNumber = 5; private static readonly pbc::MapField<int, int>.Codec _map_mapSint32Sint32_codec = new pbc::MapField<int, int>.Codec(pb::FieldCodec.ForSInt32(8), pb::FieldCodec.ForSInt32(16), 42); @@ -253,6 +263,7 @@ namespace Google.Protobuf.TestProtos { get { return mapSint32Sint32_; } } + /// <summary>Field number for the "map_sint64_sint64" field.</summary> public const int MapSint64Sint64FieldNumber = 6; private static readonly pbc::MapField<long, long>.Codec _map_mapSint64Sint64_codec = new pbc::MapField<long, long>.Codec(pb::FieldCodec.ForSInt64(8), pb::FieldCodec.ForSInt64(16), 50); @@ -261,6 +272,7 @@ namespace Google.Protobuf.TestProtos { get { return mapSint64Sint64_; } } + /// <summary>Field number for the "map_fixed32_fixed32" field.</summary> public const int MapFixed32Fixed32FieldNumber = 7; private static readonly pbc::MapField<uint, uint>.Codec _map_mapFixed32Fixed32_codec = new pbc::MapField<uint, uint>.Codec(pb::FieldCodec.ForFixed32(13), pb::FieldCodec.ForFixed32(21), 58); @@ -269,6 +281,7 @@ namespace Google.Protobuf.TestProtos { get { return mapFixed32Fixed32_; } } + /// <summary>Field number for the "map_fixed64_fixed64" field.</summary> public const int MapFixed64Fixed64FieldNumber = 8; private static readonly pbc::MapField<ulong, ulong>.Codec _map_mapFixed64Fixed64_codec = new pbc::MapField<ulong, ulong>.Codec(pb::FieldCodec.ForFixed64(9), pb::FieldCodec.ForFixed64(17), 66); @@ -277,6 +290,7 @@ namespace Google.Protobuf.TestProtos { get { return mapFixed64Fixed64_; } } + /// <summary>Field number for the "map_sfixed32_sfixed32" field.</summary> public const int MapSfixed32Sfixed32FieldNumber = 9; private static readonly pbc::MapField<int, int>.Codec _map_mapSfixed32Sfixed32_codec = new pbc::MapField<int, int>.Codec(pb::FieldCodec.ForSFixed32(13), pb::FieldCodec.ForSFixed32(21), 74); @@ -285,6 +299,7 @@ namespace Google.Protobuf.TestProtos { get { return mapSfixed32Sfixed32_; } } + /// <summary>Field number for the "map_sfixed64_sfixed64" field.</summary> public const int MapSfixed64Sfixed64FieldNumber = 10; private static readonly pbc::MapField<long, long>.Codec _map_mapSfixed64Sfixed64_codec = new pbc::MapField<long, long>.Codec(pb::FieldCodec.ForSFixed64(9), pb::FieldCodec.ForSFixed64(17), 82); @@ -293,6 +308,7 @@ namespace Google.Protobuf.TestProtos { get { return mapSfixed64Sfixed64_; } } + /// <summary>Field number for the "map_int32_float" field.</summary> public const int MapInt32FloatFieldNumber = 11; private static readonly pbc::MapField<int, float>.Codec _map_mapInt32Float_codec = new pbc::MapField<int, float>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForFloat(21), 90); @@ -301,6 +317,7 @@ namespace Google.Protobuf.TestProtos { get { return mapInt32Float_; } } + /// <summary>Field number for the "map_int32_double" field.</summary> public const int MapInt32DoubleFieldNumber = 12; private static readonly pbc::MapField<int, double>.Codec _map_mapInt32Double_codec = new pbc::MapField<int, double>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForDouble(17), 98); @@ -309,6 +326,7 @@ namespace Google.Protobuf.TestProtos { get { return mapInt32Double_; } } + /// <summary>Field number for the "map_bool_bool" field.</summary> public const int MapBoolBoolFieldNumber = 13; private static readonly pbc::MapField<bool, bool>.Codec _map_mapBoolBool_codec = new pbc::MapField<bool, bool>.Codec(pb::FieldCodec.ForBool(8), pb::FieldCodec.ForBool(16), 106); @@ -317,6 +335,7 @@ namespace Google.Protobuf.TestProtos { get { return mapBoolBool_; } } + /// <summary>Field number for the "map_string_string" field.</summary> public const int MapStringStringFieldNumber = 14; private static readonly pbc::MapField<string, string>.Codec _map_mapStringString_codec = new pbc::MapField<string, string>.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForString(18), 114); @@ -325,6 +344,7 @@ namespace Google.Protobuf.TestProtos { get { return mapStringString_; } } + /// <summary>Field number for the "map_int32_bytes" field.</summary> public const int MapInt32BytesFieldNumber = 15; private static readonly pbc::MapField<int, pb::ByteString>.Codec _map_mapInt32Bytes_codec = new pbc::MapField<int, pb::ByteString>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForBytes(18), 122); @@ -333,6 +353,7 @@ namespace Google.Protobuf.TestProtos { get { return mapInt32Bytes_; } } + /// <summary>Field number for the "map_int32_enum" field.</summary> public const int MapInt32EnumFieldNumber = 16; private static readonly pbc::MapField<int, global::Google.Protobuf.TestProtos.MapEnum>.Codec _map_mapInt32Enum_codec = new pbc::MapField<int, global::Google.Protobuf.TestProtos.MapEnum>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::Google.Protobuf.TestProtos.MapEnum) x), 130); @@ -341,6 +362,7 @@ namespace Google.Protobuf.TestProtos { get { return mapInt32Enum_; } } + /// <summary>Field number for the "map_int32_foreign_message" field.</summary> public const int MapInt32ForeignMessageFieldNumber = 17; private static readonly pbc::MapField<int, global::Google.Protobuf.TestProtos.ForeignMessage>.Codec _map_mapInt32ForeignMessage_codec = new pbc::MapField<int, global::Google.Protobuf.TestProtos.ForeignMessage>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.TestProtos.ForeignMessage.Parser), 138); @@ -579,6 +601,7 @@ namespace Google.Protobuf.TestProtos { return new TestMapSubmessage(this); } + /// <summary>Field number for the "test_map" field.</summary> public const int TestMapFieldNumber = 1; private global::Google.Protobuf.TestProtos.TestMap testMap_; public global::Google.Protobuf.TestProtos.TestMap TestMap { @@ -687,6 +710,7 @@ namespace Google.Protobuf.TestProtos { return new TestMessageMap(this); } + /// <summary>Field number for the "map_int32_message" field.</summary> public const int MapInt32MessageFieldNumber = 1; private static readonly pbc::MapField<int, global::Google.Protobuf.TestProtos.TestAllTypes>.Codec _map_mapInt32Message_codec = new pbc::MapField<int, global::Google.Protobuf.TestProtos.TestAllTypes>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.TestProtos.TestAllTypes.Parser), 10); @@ -754,6 +778,9 @@ namespace Google.Protobuf.TestProtos { } + /// <summary> + /// Two map fields share the same entry default instance. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class TestSameTypeMap : pb::IMessage<TestSameTypeMap> { private static readonly pb::MessageParser<TestSameTypeMap> _parser = new pb::MessageParser<TestSameTypeMap>(() => new TestSameTypeMap()); @@ -782,6 +809,7 @@ namespace Google.Protobuf.TestProtos { return new TestSameTypeMap(this); } + /// <summary>Field number for the "map1" field.</summary> public const int Map1FieldNumber = 1; private static readonly pbc::MapField<int, int>.Codec _map_map1_codec = new pbc::MapField<int, int>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForInt32(16), 10); @@ -790,6 +818,7 @@ namespace Google.Protobuf.TestProtos { get { return map1_; } } + /// <summary>Field number for the "map2" field.</summary> public const int Map2FieldNumber = 2; private static readonly pbc::MapField<int, int>.Codec _map_map2_codec = new pbc::MapField<int, int>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForInt32(16), 18); @@ -907,6 +936,7 @@ namespace Google.Protobuf.TestProtos { return new TestArenaMap(this); } + /// <summary>Field number for the "map_int32_int32" field.</summary> public const int MapInt32Int32FieldNumber = 1; private static readonly pbc::MapField<int, int>.Codec _map_mapInt32Int32_codec = new pbc::MapField<int, int>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForInt32(16), 10); @@ -915,6 +945,7 @@ namespace Google.Protobuf.TestProtos { get { return mapInt32Int32_; } } + /// <summary>Field number for the "map_int64_int64" field.</summary> public const int MapInt64Int64FieldNumber = 2; private static readonly pbc::MapField<long, long>.Codec _map_mapInt64Int64_codec = new pbc::MapField<long, long>.Codec(pb::FieldCodec.ForInt64(8), pb::FieldCodec.ForInt64(16), 18); @@ -923,6 +954,7 @@ namespace Google.Protobuf.TestProtos { get { return mapInt64Int64_; } } + /// <summary>Field number for the "map_uint32_uint32" field.</summary> public const int MapUint32Uint32FieldNumber = 3; private static readonly pbc::MapField<uint, uint>.Codec _map_mapUint32Uint32_codec = new pbc::MapField<uint, uint>.Codec(pb::FieldCodec.ForUInt32(8), pb::FieldCodec.ForUInt32(16), 26); @@ -931,6 +963,7 @@ namespace Google.Protobuf.TestProtos { get { return mapUint32Uint32_; } } + /// <summary>Field number for the "map_uint64_uint64" field.</summary> public const int MapUint64Uint64FieldNumber = 4; private static readonly pbc::MapField<ulong, ulong>.Codec _map_mapUint64Uint64_codec = new pbc::MapField<ulong, ulong>.Codec(pb::FieldCodec.ForUInt64(8), pb::FieldCodec.ForUInt64(16), 34); @@ -939,6 +972,7 @@ namespace Google.Protobuf.TestProtos { get { return mapUint64Uint64_; } } + /// <summary>Field number for the "map_sint32_sint32" field.</summary> public const int MapSint32Sint32FieldNumber = 5; private static readonly pbc::MapField<int, int>.Codec _map_mapSint32Sint32_codec = new pbc::MapField<int, int>.Codec(pb::FieldCodec.ForSInt32(8), pb::FieldCodec.ForSInt32(16), 42); @@ -947,6 +981,7 @@ namespace Google.Protobuf.TestProtos { get { return mapSint32Sint32_; } } + /// <summary>Field number for the "map_sint64_sint64" field.</summary> public const int MapSint64Sint64FieldNumber = 6; private static readonly pbc::MapField<long, long>.Codec _map_mapSint64Sint64_codec = new pbc::MapField<long, long>.Codec(pb::FieldCodec.ForSInt64(8), pb::FieldCodec.ForSInt64(16), 50); @@ -955,6 +990,7 @@ namespace Google.Protobuf.TestProtos { get { return mapSint64Sint64_; } } + /// <summary>Field number for the "map_fixed32_fixed32" field.</summary> public const int MapFixed32Fixed32FieldNumber = 7; private static readonly pbc::MapField<uint, uint>.Codec _map_mapFixed32Fixed32_codec = new pbc::MapField<uint, uint>.Codec(pb::FieldCodec.ForFixed32(13), pb::FieldCodec.ForFixed32(21), 58); @@ -963,6 +999,7 @@ namespace Google.Protobuf.TestProtos { get { return mapFixed32Fixed32_; } } + /// <summary>Field number for the "map_fixed64_fixed64" field.</summary> public const int MapFixed64Fixed64FieldNumber = 8; private static readonly pbc::MapField<ulong, ulong>.Codec _map_mapFixed64Fixed64_codec = new pbc::MapField<ulong, ulong>.Codec(pb::FieldCodec.ForFixed64(9), pb::FieldCodec.ForFixed64(17), 66); @@ -971,6 +1008,7 @@ namespace Google.Protobuf.TestProtos { get { return mapFixed64Fixed64_; } } + /// <summary>Field number for the "map_sfixed32_sfixed32" field.</summary> public const int MapSfixed32Sfixed32FieldNumber = 9; private static readonly pbc::MapField<int, int>.Codec _map_mapSfixed32Sfixed32_codec = new pbc::MapField<int, int>.Codec(pb::FieldCodec.ForSFixed32(13), pb::FieldCodec.ForSFixed32(21), 74); @@ -979,6 +1017,7 @@ namespace Google.Protobuf.TestProtos { get { return mapSfixed32Sfixed32_; } } + /// <summary>Field number for the "map_sfixed64_sfixed64" field.</summary> public const int MapSfixed64Sfixed64FieldNumber = 10; private static readonly pbc::MapField<long, long>.Codec _map_mapSfixed64Sfixed64_codec = new pbc::MapField<long, long>.Codec(pb::FieldCodec.ForSFixed64(9), pb::FieldCodec.ForSFixed64(17), 82); @@ -987,6 +1026,7 @@ namespace Google.Protobuf.TestProtos { get { return mapSfixed64Sfixed64_; } } + /// <summary>Field number for the "map_int32_float" field.</summary> public const int MapInt32FloatFieldNumber = 11; private static readonly pbc::MapField<int, float>.Codec _map_mapInt32Float_codec = new pbc::MapField<int, float>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForFloat(21), 90); @@ -995,6 +1035,7 @@ namespace Google.Protobuf.TestProtos { get { return mapInt32Float_; } } + /// <summary>Field number for the "map_int32_double" field.</summary> public const int MapInt32DoubleFieldNumber = 12; private static readonly pbc::MapField<int, double>.Codec _map_mapInt32Double_codec = new pbc::MapField<int, double>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForDouble(17), 98); @@ -1003,6 +1044,7 @@ namespace Google.Protobuf.TestProtos { get { return mapInt32Double_; } } + /// <summary>Field number for the "map_bool_bool" field.</summary> public const int MapBoolBoolFieldNumber = 13; private static readonly pbc::MapField<bool, bool>.Codec _map_mapBoolBool_codec = new pbc::MapField<bool, bool>.Codec(pb::FieldCodec.ForBool(8), pb::FieldCodec.ForBool(16), 106); @@ -1011,6 +1053,7 @@ namespace Google.Protobuf.TestProtos { get { return mapBoolBool_; } } + /// <summary>Field number for the "map_int32_enum" field.</summary> public const int MapInt32EnumFieldNumber = 14; private static readonly pbc::MapField<int, global::Google.Protobuf.TestProtos.MapEnum>.Codec _map_mapInt32Enum_codec = new pbc::MapField<int, global::Google.Protobuf.TestProtos.MapEnum>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::Google.Protobuf.TestProtos.MapEnum) x), 114); @@ -1019,6 +1062,7 @@ namespace Google.Protobuf.TestProtos { get { return mapInt32Enum_; } } + /// <summary>Field number for the "map_int32_foreign_message" field.</summary> public const int MapInt32ForeignMessageFieldNumber = 15; private static readonly pbc::MapField<int, global::Google.Protobuf.TestProtos.ForeignMessage>.Codec _map_mapInt32ForeignMessage_codec = new pbc::MapField<int, global::Google.Protobuf.TestProtos.ForeignMessage>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.TestProtos.ForeignMessage.Parser), 122); @@ -1212,6 +1256,10 @@ namespace Google.Protobuf.TestProtos { } + /// <summary> + /// Previously, message containing enum called Type cannot be used as value of + /// map field. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class MessageContainingEnumCalledType : pb::IMessage<MessageContainingEnumCalledType> { private static readonly pb::MessageParser<MessageContainingEnumCalledType> _parser = new pb::MessageParser<MessageContainingEnumCalledType>(() => new MessageContainingEnumCalledType()); @@ -1239,6 +1287,7 @@ namespace Google.Protobuf.TestProtos { return new MessageContainingEnumCalledType(this); } + /// <summary>Field number for the "type" field.</summary> public const int TypeFieldNumber = 1; private static readonly pbc::MapField<int, global::Google.Protobuf.TestProtos.MessageContainingEnumCalledType>.Codec _map_type_codec = new pbc::MapField<int, global::Google.Protobuf.TestProtos.MessageContainingEnumCalledType>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.TestProtos.MessageContainingEnumCalledType.Parser), 10); @@ -1305,6 +1354,7 @@ namespace Google.Protobuf.TestProtos { } #region Nested types + /// <summary>Container for nested types declared in the MessageContainingEnumCalledType message type.</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Types { public enum Type { @@ -1316,6 +1366,9 @@ namespace Google.Protobuf.TestProtos { } + /// <summary> + /// Previously, message cannot contain map field called "entry". + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class MessageContainingMapCalledEntry : pb::IMessage<MessageContainingMapCalledEntry> { private static readonly pb::MessageParser<MessageContainingMapCalledEntry> _parser = new pb::MessageParser<MessageContainingMapCalledEntry>(() => new MessageContainingMapCalledEntry()); @@ -1343,6 +1396,7 @@ namespace Google.Protobuf.TestProtos { return new MessageContainingMapCalledEntry(this); } + /// <summary>Field number for the "entry" field.</summary> public const int EntryFieldNumber = 1; private static readonly pbc::MapField<int, int>.Codec _map_entry_codec = new pbc::MapField<int, int>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForInt32(16), 10); diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs index bf527ac5..a55c66e0 100644 --- a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs +++ b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs @@ -9,10 +9,12 @@ using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; namespace Google.Protobuf.TestProtos { + /// <summary>Holder for reflection information generated from google/protobuf/unittest_import_proto3.proto</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class UnittestImportProto3 { #region Descriptor + /// <summary>File descriptor for google/protobuf/unittest_import_proto3.proto</summary> public static pbr::FileDescriptor Descriptor { get { return descriptor; } } @@ -21,13 +23,13 @@ namespace Google.Protobuf.TestProtos { static UnittestImportProto3() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "Cixnb29nbGUvcHJvdG9idWYvdW5pdHRlc3RfaW1wb3J0X3Byb3RvMy5wcm90", - "bxIYcHJvdG9idWZfdW5pdHRlc3RfaW1wb3J0GjNnb29nbGUvcHJvdG9idWYv", - "dW5pdHRlc3RfaW1wb3J0X3B1YmxpY19wcm90bzMucHJvdG8iGgoNSW1wb3J0", - "TWVzc2FnZRIJCgFkGAEgASgFKlkKCkltcG9ydEVudW0SGwoXSU1QT1JUX0VO", - "VU1fVU5TUEVDSUZJRUQQABIOCgpJTVBPUlRfRk9PEAcSDgoKSU1QT1JUX0JB", - "UhAIEg4KCklNUE9SVF9CQVoQCUI8Chhjb20uZ29vZ2xlLnByb3RvYnVmLnRl", - "c3RIAfgBAaoCGkdvb2dsZS5Qcm90b2J1Zi5UZXN0UHJvdG9zUABiBnByb3Rv", + "Cixnb29nbGUvcHJvdG9idWYvdW5pdHRlc3RfaW1wb3J0X3Byb3RvMy5wcm90", + "bxIYcHJvdG9idWZfdW5pdHRlc3RfaW1wb3J0GjNnb29nbGUvcHJvdG9idWYv", + "dW5pdHRlc3RfaW1wb3J0X3B1YmxpY19wcm90bzMucHJvdG8iGgoNSW1wb3J0", + "TWVzc2FnZRIJCgFkGAEgASgFKlkKCkltcG9ydEVudW0SGwoXSU1QT1JUX0VO", + "VU1fVU5TUEVDSUZJRUQQABIOCgpJTVBPUlRfRk9PEAcSDgoKSU1QT1JUX0JB", + "UhAIEg4KCklNUE9SVF9CQVoQCUI8Chhjb20uZ29vZ2xlLnByb3RvYnVmLnRl", + "c3RIAfgBAaoCGkdvb2dsZS5Qcm90b2J1Zi5UZXN0UHJvdG9zUABiBnByb3Rv", "Mw==")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbr::FileDescriptor[] { global::Google.Protobuf.TestProtos.UnittestImportPublicProto3.Descriptor, }, @@ -76,6 +78,7 @@ namespace Google.Protobuf.TestProtos { return new ImportMessage(this); } + /// <summary>Field number for the "d" field.</summary> public const int DFieldNumber = 1; private int d_; public int D { diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportPublicProto3.cs b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportPublicProto3.cs index ec460906..81696d70 100644 --- a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportPublicProto3.cs +++ b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportPublicProto3.cs @@ -9,10 +9,12 @@ using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; namespace Google.Protobuf.TestProtos { + /// <summary>Holder for reflection information generated from google/protobuf/unittest_import_public_proto3.proto</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class UnittestImportPublicProto3 { #region Descriptor + /// <summary>File descriptor for google/protobuf/unittest_import_public_proto3.proto</summary> public static pbr::FileDescriptor Descriptor { get { return descriptor; } } @@ -21,9 +23,9 @@ namespace Google.Protobuf.TestProtos { static UnittestImportPublicProto3() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "CjNnb29nbGUvcHJvdG9idWYvdW5pdHRlc3RfaW1wb3J0X3B1YmxpY19wcm90", - "bzMucHJvdG8SGHByb3RvYnVmX3VuaXR0ZXN0X2ltcG9ydCIgChNQdWJsaWNJ", - "bXBvcnRNZXNzYWdlEgkKAWUYASABKAVCNwoYY29tLmdvb2dsZS5wcm90b2J1", + "CjNnb29nbGUvcHJvdG9idWYvdW5pdHRlc3RfaW1wb3J0X3B1YmxpY19wcm90", + "bzMucHJvdG8SGHByb3RvYnVmX3VuaXR0ZXN0X2ltcG9ydCIgChNQdWJsaWNJ", + "bXBvcnRNZXNzYWdlEgkKAWUYASABKAVCNwoYY29tLmdvb2dsZS5wcm90b2J1", "Zi50ZXN0qgIaR29vZ2xlLlByb3RvYnVmLlRlc3RQcm90b3NiBnByb3RvMw==")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbr::FileDescriptor[] { }, @@ -62,6 +64,7 @@ namespace Google.Protobuf.TestProtos { return new PublicImportMessage(this); } + /// <summary>Field number for the "e" field.</summary> public const int EFieldNumber = 1; private int e_; public int E { diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestIssues.cs b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestIssues.cs index 63119a34..addec057 100644 --- a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestIssues.cs +++ b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestIssues.cs @@ -9,10 +9,12 @@ using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; namespace UnitTest.Issues.TestProtos { + /// <summary>Holder for reflection information generated from unittest_issues.proto</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class UnittestIssues { #region Descriptor + /// <summary>File descriptor for unittest_issues.proto</summary> public static pbr::FileDescriptor Descriptor { get { return descriptor; } } @@ -21,28 +23,28 @@ namespace UnitTest.Issues.TestProtos { static UnittestIssues() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "ChV1bml0dGVzdF9pc3N1ZXMucHJvdG8SD3VuaXR0ZXN0X2lzc3VlcyInCghJ", - "c3N1ZTMwNxobCgpOZXN0ZWRPbmNlGg0KC05lc3RlZFR3aWNlIrABChNOZWdh", - "dGl2ZUVudW1NZXNzYWd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SZXNl", + "cnZlZE5hbWVzEg0KBXR5cGVzGAEgASgFEhIKCmRlc2NyaXB0b3IYAiABKAUa", + "EAoOU29tZU5lc3RlZFR5cGUioAEKFVRlc3RKc29uRmllbGRPcmRlcmluZxIT", + "CgtwbGFpbl9pbnQzMhgEIAEoBRITCglvMV9zdHJpbmcYAiABKAlIABISCghv", + "MV9pbnQzMhgFIAEoBUgAEhQKDHBsYWluX3N0cmluZxgBIAEoCRISCghvMl9p", + "bnQzMhgGIAEoBUgBEhMKCW8yX3N0cmluZxgDIAEoCUgBQgQKAm8xQgQKAm8y", + "KlUKDE5lZ2F0aXZlRW51bRIWChJORUdBVElWRV9FTlVNX1pFUk8QABIWCglG", + "aXZlQmVsb3cQ+///////////ARIVCghNaW51c09uZRD///////////8BKi4K", + "DkRlcHJlY2F0ZWRFbnVtEhMKD0RFUFJFQ0FURURfWkVSTxAAEgcKA29uZRAB", "Qh9IAaoCGlVuaXRUZXN0Lklzc3Vlcy5UZXN0UHJvdG9zYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbr::FileDescriptor[] { }, @@ -74,6 +76,10 @@ namespace UnitTest.Issues.TestProtos { #endregion #region Messages + /// <summary> + /// Issue 307: when generating doubly-nested types, any references + /// should be of the form A.Types.B.Types.C. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Issue307 : pb::IMessage<Issue307> { private static readonly pb::MessageParser<Issue307> _parser = new pb::MessageParser<Issue307>(() => new Issue307()); @@ -149,6 +155,7 @@ namespace UnitTest.Issues.TestProtos { } #region Nested types + /// <summary>Container for nested types declared in the Issue307 message type.</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Types { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -226,6 +233,7 @@ namespace UnitTest.Issues.TestProtos { } #region Nested types + /// <summary>Container for nested types declared in the NestedOnce message type.</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Types { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -343,6 +351,7 @@ namespace UnitTest.Issues.TestProtos { return new NegativeEnumMessage(this); } + /// <summary>Field number for the "value" field.</summary> public const int ValueFieldNumber = 1; private global::UnitTest.Issues.TestProtos.NegativeEnum value_ = global::UnitTest.Issues.TestProtos.NegativeEnum.NEGATIVE_ENUM_ZERO; public global::UnitTest.Issues.TestProtos.NegativeEnum Value { @@ -352,6 +361,7 @@ namespace UnitTest.Issues.TestProtos { } } + /// <summary>Field number for the "values" field.</summary> public const int ValuesFieldNumber = 2; private static readonly pb::FieldCodec<global::UnitTest.Issues.TestProtos.NegativeEnum> _repeated_values_codec = pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::UnitTest.Issues.TestProtos.NegativeEnum) x); @@ -360,6 +370,7 @@ namespace UnitTest.Issues.TestProtos { get { return values_; } } + /// <summary>Field number for the "packed_values" field.</summary> public const int PackedValuesFieldNumber = 3; private static readonly pb::FieldCodec<global::UnitTest.Issues.TestProtos.NegativeEnum> _repeated_packedValues_codec = pb::FieldCodec.ForEnum(26, x => (int) x, x => (global::UnitTest.Issues.TestProtos.NegativeEnum) x); @@ -562,6 +573,7 @@ namespace UnitTest.Issues.TestProtos { return new DeprecatedFieldsMessage(this); } + /// <summary>Field number for the "PrimitiveValue" field.</summary> public const int PrimitiveValueFieldNumber = 1; private int primitiveValue_; [global::System.ObsoleteAttribute()] @@ -572,6 +584,7 @@ namespace UnitTest.Issues.TestProtos { } } + /// <summary>Field number for the "PrimitiveArray" field.</summary> public const int PrimitiveArrayFieldNumber = 2; private static readonly pb::FieldCodec<int> _repeated_primitiveArray_codec = pb::FieldCodec.ForInt32(18); @@ -581,6 +594,7 @@ namespace UnitTest.Issues.TestProtos { get { return primitiveArray_; } } + /// <summary>Field number for the "MessageValue" field.</summary> public const int MessageValueFieldNumber = 3; private global::UnitTest.Issues.TestProtos.DeprecatedChild messageValue_; [global::System.ObsoleteAttribute()] @@ -591,6 +605,7 @@ namespace UnitTest.Issues.TestProtos { } } + /// <summary>Field number for the "MessageArray" field.</summary> public const int MessageArrayFieldNumber = 4; private static readonly pb::FieldCodec<global::UnitTest.Issues.TestProtos.DeprecatedChild> _repeated_messageArray_codec = pb::FieldCodec.ForMessage(34, global::UnitTest.Issues.TestProtos.DeprecatedChild.Parser); @@ -600,6 +615,7 @@ namespace UnitTest.Issues.TestProtos { get { return messageArray_; } } + /// <summary>Field number for the "EnumValue" field.</summary> public const int EnumValueFieldNumber = 5; private global::UnitTest.Issues.TestProtos.DeprecatedEnum enumValue_ = global::UnitTest.Issues.TestProtos.DeprecatedEnum.DEPRECATED_ZERO; [global::System.ObsoleteAttribute()] @@ -610,6 +626,7 @@ namespace UnitTest.Issues.TestProtos { } } + /// <summary>Field number for the "EnumArray" field.</summary> public const int EnumArrayFieldNumber = 6; private static readonly pb::FieldCodec<global::UnitTest.Issues.TestProtos.DeprecatedEnum> _repeated_enumArray_codec = pb::FieldCodec.ForEnum(50, x => (int) x, x => (global::UnitTest.Issues.TestProtos.DeprecatedEnum) x); @@ -752,6 +769,9 @@ namespace UnitTest.Issues.TestProtos { } + /// <summary> + /// Issue 45: http://code.google.com/p/protobuf-csharp-port/issues/detail?id=45 + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class ItemField : pb::IMessage<ItemField> { private static readonly pb::MessageParser<ItemField> _parser = new pb::MessageParser<ItemField>(() => new ItemField()); @@ -779,6 +799,7 @@ namespace UnitTest.Issues.TestProtos { return new ItemField(this); } + /// <summary>Field number for the "item" field.</summary> public const int ItemFieldNumber = 1; private int item_; public int Item { @@ -882,6 +903,7 @@ namespace UnitTest.Issues.TestProtos { return new ReservedNames(this); } + /// <summary>Field number for the "types" field.</summary> public const int Types_FieldNumber = 1; private int types_; public int Types_ { @@ -891,6 +913,7 @@ namespace UnitTest.Issues.TestProtos { } } + /// <summary>Field number for the "descriptor" field.</summary> public const int Descriptor_FieldNumber = 2; private int descriptor_; public int Descriptor_ { @@ -981,8 +1004,12 @@ namespace UnitTest.Issues.TestProtos { } #region Nested types + /// <summary>Container for nested types declared in the ReservedNames message type.</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Types { + /// <summary> + /// Force a nested type called Types + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class SomeNestedType : pb::IMessage<SomeNestedType> { private static readonly pb::MessageParser<SomeNestedType> _parser = new pb::MessageParser<SomeNestedType>(() => new SomeNestedType()); @@ -1064,6 +1091,18 @@ namespace UnitTest.Issues.TestProtos { } + /// <summary> + /// These fields are deliberately not declared in numeric + /// order, and the oneof fields aren't contiguous either. + /// This allows for reasonably robust tests of JSON output + /// ordering. + /// TestFieldOrderings in unittest_proto3.proto is similar, + /// but doesn't include oneofs. + /// TODO: Consider adding oneofs to TestFieldOrderings, although + /// that will require fixing other tests in multiple platforms. + /// Alternatively, consider just adding this to + /// unittest_proto3.proto if multiple platforms want it. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class TestJsonFieldOrdering : pb::IMessage<TestJsonFieldOrdering> { private static readonly pb::MessageParser<TestJsonFieldOrdering> _parser = new pb::MessageParser<TestJsonFieldOrdering>(() => new TestJsonFieldOrdering()); @@ -1110,6 +1149,7 @@ namespace UnitTest.Issues.TestProtos { return new TestJsonFieldOrdering(this); } + /// <summary>Field number for the "plain_int32" field.</summary> public const int PlainInt32FieldNumber = 4; private int plainInt32_; public int PlainInt32 { @@ -1119,6 +1159,7 @@ namespace UnitTest.Issues.TestProtos { } } + /// <summary>Field number for the "o1_string" field.</summary> public const int O1StringFieldNumber = 2; public string O1String { get { return o1Case_ == O1OneofCase.O1String ? (string) o1_ : ""; } @@ -1128,6 +1169,7 @@ namespace UnitTest.Issues.TestProtos { } } + /// <summary>Field number for the "o1_int32" field.</summary> public const int O1Int32FieldNumber = 5; public int O1Int32 { get { return o1Case_ == O1OneofCase.O1Int32 ? (int) o1_ : 0; } @@ -1137,6 +1179,7 @@ namespace UnitTest.Issues.TestProtos { } } + /// <summary>Field number for the "plain_string" field.</summary> public const int PlainStringFieldNumber = 1; private string plainString_ = ""; public string PlainString { @@ -1146,6 +1189,7 @@ namespace UnitTest.Issues.TestProtos { } } + /// <summary>Field number for the "o2_int32" field.</summary> public const int O2Int32FieldNumber = 6; public int O2Int32 { get { return o2Case_ == O2OneofCase.O2Int32 ? (int) o2_ : 0; } @@ -1155,6 +1199,7 @@ namespace UnitTest.Issues.TestProtos { } } + /// <summary>Field number for the "o2_string" field.</summary> public const int O2StringFieldNumber = 3; public string O2String { get { return o2Case_ == O2OneofCase.O2String ? (string) o2_ : ""; } @@ -1165,6 +1210,7 @@ namespace UnitTest.Issues.TestProtos { } private object o1_; + /// <summary>Enum of possible cases for the "o1" oneof.</summary> public enum O1OneofCase { None = 0, O1String = 2, @@ -1181,6 +1227,7 @@ namespace UnitTest.Issues.TestProtos { } private object o2_; + /// <summary>Enum of possible cases for the "o2" oneof.</summary> public enum O2OneofCase { None = 0, O2Int32 = 6, diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestProto3.cs b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestProto3.cs index bf4590ad..0c7b5279 100644 --- a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestProto3.cs +++ b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestProto3.cs @@ -9,10 +9,12 @@ using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; namespace Google.Protobuf.TestProtos { + /// <summary>Holder for reflection information generated from google/protobuf/unittest_proto3.proto</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class UnittestProto3 { #region Descriptor + /// <summary>File descriptor for google/protobuf/unittest_proto3.proto</summary> public static pbr::FileDescriptor Descriptor { get { return descriptor; } } @@ -21,132 +23,132 @@ namespace Google.Protobuf.TestProtos { static UnittestProto3() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "Ci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oJ", - "VGVzdE9uZW9mEhEKB2Zvb19pbnQYASABKAVIABIUCgpmb29fc3RyaW5nGAIg", - "ASgJSAASNgoLZm9vX21lc3NhZ2UYAyABKAsyHy5wcm90b2J1Zl91bml0dGVz", - "dC5UZXN0QWxsVHlwZXNIAEIFCgNmb28iqgMKD1Rlc3RQYWNrZWRUeXBlcxIY", - "CgxwYWNrZWRfaW50MzIYWiADKAVCAhABEhgKDHBhY2tlZF9pbnQ2NBhbIAMo", - "A0ICEAESGQoNcGFja2VkX3VpbnQzMhhcIAMoDUICEAESGQoNcGFja2VkX3Vp", - "bnQ2NBhdIAMoBEICEAESGQoNcGFja2VkX3NpbnQzMhheIAMoEUICEAESGQoN", - "cGFja2VkX3NpbnQ2NBhfIAMoEkICEAESGgoOcGFja2VkX2ZpeGVkMzIYYCAD", - "KAdCAhABEhoKDnBhY2tlZF9maXhlZDY0GGEgAygGQgIQARIbCg9wYWNrZWRf", - "c2ZpeGVkMzIYYiADKA9CAhABEhsKD3BhY2tlZF9zZml4ZWQ2NBhjIAMoEEIC", - "EAESGAoMcGFja2VkX2Zsb2F0GGQgAygCQgIQARIZCg1wYWNrZWRfZG91Ymxl", - "GGUgAygBQgIQARIXCgtwYWNrZWRfYm9vbBhmIAMoCEICEAESNwoLcGFja2Vk", - "X2VudW0YZyADKA4yHi5wcm90b2J1Zl91bml0dGVzdC5Gb3JlaWduRW51bUIC", - "EAEiyAMKEVRlc3RVbnBhY2tlZFR5cGVzEhoKDnVucGFja2VkX2ludDMyGFog", - "AygFQgIQABIaCg51bnBhY2tlZF9pbnQ2NBhbIAMoA0ICEAASGwoPdW5wYWNr", - "ZWRfdWludDMyGFwgAygNQgIQABIbCg91bnBhY2tlZF91aW50NjQYXSADKARC", - "AhAAEhsKD3VucGFja2VkX3NpbnQzMhheIAMoEUICEAASGwoPdW5wYWNrZWRf", - "c2ludDY0GF8gAygSQgIQABIcChB1bnBhY2tlZF9maXhlZDMyGGAgAygHQgIQ", - "ABIcChB1bn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AESGAoMcGFja2VkX2Zsb2F0GGQgAygCQgIQARIZCg1wYWNrZWRfZG91Ymxl", + "GGUgAygBQgIQARIXCgtwYWNrZWRfYm9vbBhmIAMoCEICEAESNwoLcGFja2Vk", + "X2VudW0YZyADKA4yHi5wcm90b2J1Zl91bml0dGVzdC5Gb3JlaWduRW51bUIC", + "EAEiyAMKEVRlc3RVbnBhY2tlZFR5cGVzEhoKDnVucGFja2VkX2ludDMyGFog", + "AygFQgIQABIaCg51bnBhY2tlZF9pbnQ2NBhbIAMoA0ICEAASGwoPdW5wYWNr", + "ZWRfdWludDMyGFwgAygNQgIQABIbCg91bnBhY2tlZF91aW50NjQYXSADKARC", + "AhAAEhsKD3VucGFja2VkX3NpbnQzMhheIAMoEUICEAASGwoPdW5wYWNrZWRf", + "c2ludDY0GF8gAygSQgIQABIcChB1bnBhY2tlZF9maXhlZDMyGGAgAygHQgIQ", + "ABIcChB1bnBhY2tlZF9maXhlZDY0GGEgAygGQgIQABIdChF1bnBhY2tlZF9z", + "Zml4ZWQzMhhiIAMoD0ICEAASHQoRdW5wYWNrZWRfc2ZpeGVkNjQYYyADKBBC", + "AhAAEhoKDnVucGFja2VkX2Zsb2F0GGQgAygCQgIQABIbCg91bnBhY2tlZF9k", + "b3VibGUYZSADKAFCAhAAEhkKDXVucGFja2VkX2Jvb2wYZiADKAhCAhAAEjkK", + "DXVucGFja2VkX2VudW0YZyADKA4yHi5wcm90b2J1Zl91bml0dGVzdC5Gb3Jl", + "aWduRW51bUICEAAiwAEKI1Rlc3RSZXBlYXRlZFNjYWxhckRpZmZlcmVudFRh", + "Z1NpemVzEhgKEHJlcGVhdGVkX2ZpeGVkMzIYDCADKAcSFgoOcmVwZWF0ZWRf", + "aW50MzIYDSADKAUSGQoQcmVwZWF0ZWRfZml4ZWQ2NBj+DyADKAYSFwoOcmVw", + "ZWF0ZWRfaW50NjQY/w8gAygDEhgKDnJlcGVhdGVkX2Zsb2F0GP7/DyADKAIS", + "GQoPcmVwZWF0ZWRfdWludDY0GP//DyADKAQiKAobVGVzdENvbW1lbnRJbmpl", + "Y3Rpb25NZXNzYWdlEgkKAWEYASABKAkiDAoKRm9vUmVxdWVzdCINCgtGb29S", + "ZXNwb25zZSISChBGb29DbGllbnRNZXNzYWdlIhIKEEZvb1NlcnZlck1lc3Nh", + "Z2UiDAoKQmFyUmVxdWVzdCINCgtCYXJSZXNwb25zZSpZCgtGb3JlaWduRW51", + "bRIXChNGT1JFSUdOX1VOU1BFQ0lGSUVEEAASDwoLRk9SRUlHTl9GT08QBBIP", + "CgtGT1JFSUdOX0JBUhAFEg8KC0ZPUkVJR05fQkFaEAYqdQoUVGVzdEVudW1X", + "aXRoRHVwVmFsdWUSKAokVEVTVF9FTlVNX1dJVEhfRFVQX1ZBTFVFX1VOU1BF", + "Q0lGSUVEEAASCAoERk9PMRABEggKBEJBUjEQAhIHCgNCQVoQAxIICgRGT08y", + "EAESCAoEQkFSMhACGgIQASqdAQoOVGVzdFNwYXJzZUVudW0SIAocVEVTVF9T", + "UEFSU0VfRU5VTV9VTlNQRUNJRklFRBAAEgwKCFNQQVJTRV9BEHsSDgoIU1BB", + "UlNFX0IQpucDEg8KCFNQQVJTRV9DELKxgAYSFQoIU1BBUlNFX0QQ8f//////", + "////ARIVCghTUEFSU0VfRRC03vz///////8BEgwKCFNQQVJTRV9HEAIymQEK", + "C1Rlc3RTZXJ2aWNlEkQKA0ZvbxIdLnByb3RvYnVmX3VuaXR0ZXN0LkZvb1Jl", + "cXVlc3QaHi5wcm90b2J1Zl91bml0dGVzdC5Gb29SZXNwb25zZRJECgNCYXIS", + "HS5wcm90b2J1Zl91bml0dGVzdC5CYXJSZXF1ZXN0Gh4ucHJvdG9idWZfdW5p", + "dHRlc3QuQmFyUmVzcG9uc2VCOkINVW5pdHRlc3RQcm90b0gBgAEBiAEBkAEB", "+AEBqgIaR29vZ2xlLlByb3RvYnVmLlRlc3RQcm90b3NiBnByb3RvMw==")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbr::FileDescriptor[] { global::Google.Protobuf.TestProtos.UnittestImportProto3.Descriptor, }, @@ -197,6 +199,9 @@ namespace Google.Protobuf.TestProtos { FOREIGN_BAZ = 6, } + /// <summary> + /// Test an enum that has multiple values with the same number. + /// </summary> public enum TestEnumWithDupValue { TEST_ENUM_WITH_DUP_VALUE_UNSPECIFIED = 0, FOO1 = 1, @@ -206,6 +211,9 @@ namespace Google.Protobuf.TestProtos { BAR2 = 2, } + /// <summary> + /// Test an enum with large, unordered values. + /// </summary> public enum TestSparseEnum { TEST_SPARSE_ENUM_UNSPECIFIED = 0, SPARSE_A = 123, @@ -213,12 +221,20 @@ namespace Google.Protobuf.TestProtos { SPARSE_C = 12589234, SPARSE_D = -15, SPARSE_E = -53452, + /// <summary> + /// In proto3, value 0 must be the first one specified + /// SPARSE_F = 0; + /// </summary> SPARSE_G = 2, } #endregion #region Messages + /// <summary> + /// This proto includes every type of field in both singular and repeated + /// forms. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class TestAllTypes : pb::IMessage<TestAllTypes> { private static readonly pb::MessageParser<TestAllTypes> _parser = new pb::MessageParser<TestAllTypes>(() => new TestAllTypes()); @@ -304,8 +320,12 @@ namespace Google.Protobuf.TestProtos { return new TestAllTypes(this); } + /// <summary>Field number for the "single_int32" field.</summary> public const int SingleInt32FieldNumber = 1; private int singleInt32_; + /// <summary> + /// Singular + /// </summary> public int SingleInt32 { get { return singleInt32_; } set { @@ -313,6 +333,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "single_int64" field.</summary> public const int SingleInt64FieldNumber = 2; private long singleInt64_; public long SingleInt64 { @@ -322,6 +343,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "single_uint32" field.</summary> public const int SingleUint32FieldNumber = 3; private uint singleUint32_; public uint SingleUint32 { @@ -331,6 +353,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "single_uint64" field.</summary> public const int SingleUint64FieldNumber = 4; private ulong singleUint64_; public ulong SingleUint64 { @@ -340,6 +363,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "single_sint32" field.</summary> public const int SingleSint32FieldNumber = 5; private int singleSint32_; public int SingleSint32 { @@ -349,6 +373,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "single_sint64" field.</summary> public const int SingleSint64FieldNumber = 6; private long singleSint64_; public long SingleSint64 { @@ -358,6 +383,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "single_fixed32" field.</summary> public const int SingleFixed32FieldNumber = 7; private uint singleFixed32_; public uint SingleFixed32 { @@ -367,6 +393,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "single_fixed64" field.</summary> public const int SingleFixed64FieldNumber = 8; private ulong singleFixed64_; public ulong SingleFixed64 { @@ -376,6 +403,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "single_sfixed32" field.</summary> public const int SingleSfixed32FieldNumber = 9; private int singleSfixed32_; public int SingleSfixed32 { @@ -385,6 +413,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "single_sfixed64" field.</summary> public const int SingleSfixed64FieldNumber = 10; private long singleSfixed64_; public long SingleSfixed64 { @@ -394,6 +423,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "single_float" field.</summary> public const int SingleFloatFieldNumber = 11; private float singleFloat_; public float SingleFloat { @@ -403,6 +433,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "single_double" field.</summary> public const int SingleDoubleFieldNumber = 12; private double singleDouble_; public double SingleDouble { @@ -412,6 +443,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "single_bool" field.</summary> public const int SingleBoolFieldNumber = 13; private bool singleBool_; public bool SingleBool { @@ -421,6 +453,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "single_string" field.</summary> public const int SingleStringFieldNumber = 14; private string singleString_ = ""; public string SingleString { @@ -430,6 +463,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "single_bytes" field.</summary> public const int SingleBytesFieldNumber = 15; private pb::ByteString singleBytes_ = pb::ByteString.Empty; public pb::ByteString SingleBytes { @@ -439,6 +473,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "single_nested_message" field.</summary> public const int SingleNestedMessageFieldNumber = 18; private global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage singleNestedMessage_; public global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage SingleNestedMessage { @@ -448,6 +483,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "single_foreign_message" field.</summary> public const int SingleForeignMessageFieldNumber = 19; private global::Google.Protobuf.TestProtos.ForeignMessage singleForeignMessage_; public global::Google.Protobuf.TestProtos.ForeignMessage SingleForeignMessage { @@ -457,6 +493,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "single_import_message" field.</summary> public const int SingleImportMessageFieldNumber = 20; private global::Google.Protobuf.TestProtos.ImportMessage singleImportMessage_; public global::Google.Protobuf.TestProtos.ImportMessage SingleImportMessage { @@ -466,6 +503,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "single_nested_enum" field.</summary> public const int SingleNestedEnumFieldNumber = 21; private global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedEnum singleNestedEnum_ = global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedEnum.NESTED_ENUM_UNSPECIFIED; public global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedEnum SingleNestedEnum { @@ -475,6 +513,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "single_foreign_enum" field.</summary> public const int SingleForeignEnumFieldNumber = 22; private global::Google.Protobuf.TestProtos.ForeignEnum singleForeignEnum_ = global::Google.Protobuf.TestProtos.ForeignEnum.FOREIGN_UNSPECIFIED; public global::Google.Protobuf.TestProtos.ForeignEnum SingleForeignEnum { @@ -484,6 +523,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "single_import_enum" field.</summary> public const int SingleImportEnumFieldNumber = 23; private global::Google.Protobuf.TestProtos.ImportEnum singleImportEnum_ = global::Google.Protobuf.TestProtos.ImportEnum.IMPORT_ENUM_UNSPECIFIED; public global::Google.Protobuf.TestProtos.ImportEnum SingleImportEnum { @@ -493,8 +533,12 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "single_public_import_message" field.</summary> public const int SinglePublicImportMessageFieldNumber = 26; private global::Google.Protobuf.TestProtos.PublicImportMessage singlePublicImportMessage_; + /// <summary> + /// Defined in unittest_import_public.proto + /// </summary> public global::Google.Protobuf.TestProtos.PublicImportMessage SinglePublicImportMessage { get { return singlePublicImportMessage_; } set { @@ -502,14 +546,19 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "repeated_int32" field.</summary> public const int RepeatedInt32FieldNumber = 31; private static readonly pb::FieldCodec<int> _repeated_repeatedInt32_codec = pb::FieldCodec.ForInt32(250); private readonly pbc::RepeatedField<int> repeatedInt32_ = new pbc::RepeatedField<int>(); + /// <summary> + /// Repeated + /// </summary> public pbc::RepeatedField<int> RepeatedInt32 { get { return repeatedInt32_; } } + /// <summary>Field number for the "repeated_int64" field.</summary> public const int RepeatedInt64FieldNumber = 32; private static readonly pb::FieldCodec<long> _repeated_repeatedInt64_codec = pb::FieldCodec.ForInt64(258); @@ -518,6 +567,7 @@ namespace Google.Protobuf.TestProtos { get { return repeatedInt64_; } } + /// <summary>Field number for the "repeated_uint32" field.</summary> public const int RepeatedUint32FieldNumber = 33; private static readonly pb::FieldCodec<uint> _repeated_repeatedUint32_codec = pb::FieldCodec.ForUInt32(266); @@ -526,6 +576,7 @@ namespace Google.Protobuf.TestProtos { get { return repeatedUint32_; } } + /// <summary>Field number for the "repeated_uint64" field.</summary> public const int RepeatedUint64FieldNumber = 34; private static readonly pb::FieldCodec<ulong> _repeated_repeatedUint64_codec = pb::FieldCodec.ForUInt64(274); @@ -534,6 +585,7 @@ namespace Google.Protobuf.TestProtos { get { return repeatedUint64_; } } + /// <summary>Field number for the "repeated_sint32" field.</summary> public const int RepeatedSint32FieldNumber = 35; private static readonly pb::FieldCodec<int> _repeated_repeatedSint32_codec = pb::FieldCodec.ForSInt32(282); @@ -542,6 +594,7 @@ namespace Google.Protobuf.TestProtos { get { return repeatedSint32_; } } + /// <summary>Field number for the "repeated_sint64" field.</summary> public const int RepeatedSint64FieldNumber = 36; private static readonly pb::FieldCodec<long> _repeated_repeatedSint64_codec = pb::FieldCodec.ForSInt64(290); @@ -550,6 +603,7 @@ namespace Google.Protobuf.TestProtos { get { return repeatedSint64_; } } + /// <summary>Field number for the "repeated_fixed32" field.</summary> public const int RepeatedFixed32FieldNumber = 37; private static readonly pb::FieldCodec<uint> _repeated_repeatedFixed32_codec = pb::FieldCodec.ForFixed32(298); @@ -558,6 +612,7 @@ namespace Google.Protobuf.TestProtos { get { return repeatedFixed32_; } } + /// <summary>Field number for the "repeated_fixed64" field.</summary> public const int RepeatedFixed64FieldNumber = 38; private static readonly pb::FieldCodec<ulong> _repeated_repeatedFixed64_codec = pb::FieldCodec.ForFixed64(306); @@ -566,6 +621,7 @@ namespace Google.Protobuf.TestProtos { get { return repeatedFixed64_; } } + /// <summary>Field number for the "repeated_sfixed32" field.</summary> public const int RepeatedSfixed32FieldNumber = 39; private static readonly pb::FieldCodec<int> _repeated_repeatedSfixed32_codec = pb::FieldCodec.ForSFixed32(314); @@ -574,6 +630,7 @@ namespace Google.Protobuf.TestProtos { get { return repeatedSfixed32_; } } + /// <summary>Field number for the "repeated_sfixed64" field.</summary> public const int RepeatedSfixed64FieldNumber = 40; private static readonly pb::FieldCodec<long> _repeated_repeatedSfixed64_codec = pb::FieldCodec.ForSFixed64(322); @@ -582,6 +639,7 @@ namespace Google.Protobuf.TestProtos { get { return repeatedSfixed64_; } } + /// <summary>Field number for the "repeated_float" field.</summary> public const int RepeatedFloatFieldNumber = 41; private static readonly pb::FieldCodec<float> _repeated_repeatedFloat_codec = pb::FieldCodec.ForFloat(330); @@ -590,6 +648,7 @@ namespace Google.Protobuf.TestProtos { get { return repeatedFloat_; } } + /// <summary>Field number for the "repeated_double" field.</summary> public const int RepeatedDoubleFieldNumber = 42; private static readonly pb::FieldCodec<double> _repeated_repeatedDouble_codec = pb::FieldCodec.ForDouble(338); @@ -598,6 +657,7 @@ namespace Google.Protobuf.TestProtos { get { return repeatedDouble_; } } + /// <summary>Field number for the "repeated_bool" field.</summary> public const int RepeatedBoolFieldNumber = 43; private static readonly pb::FieldCodec<bool> _repeated_repeatedBool_codec = pb::FieldCodec.ForBool(346); @@ -606,6 +666,7 @@ namespace Google.Protobuf.TestProtos { get { return repeatedBool_; } } + /// <summary>Field number for the "repeated_string" field.</summary> public const int RepeatedStringFieldNumber = 44; private static readonly pb::FieldCodec<string> _repeated_repeatedString_codec = pb::FieldCodec.ForString(354); @@ -614,6 +675,7 @@ namespace Google.Protobuf.TestProtos { get { return repeatedString_; } } + /// <summary>Field number for the "repeated_bytes" field.</summary> public const int RepeatedBytesFieldNumber = 45; private static readonly pb::FieldCodec<pb::ByteString> _repeated_repeatedBytes_codec = pb::FieldCodec.ForBytes(362); @@ -622,6 +684,7 @@ namespace Google.Protobuf.TestProtos { get { return repeatedBytes_; } } + /// <summary>Field number for the "repeated_nested_message" field.</summary> public const int RepeatedNestedMessageFieldNumber = 48; private static readonly pb::FieldCodec<global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage> _repeated_repeatedNestedMessage_codec = pb::FieldCodec.ForMessage(386, global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage.Parser); @@ -630,6 +693,7 @@ namespace Google.Protobuf.TestProtos { get { return repeatedNestedMessage_; } } + /// <summary>Field number for the "repeated_foreign_message" field.</summary> public const int RepeatedForeignMessageFieldNumber = 49; private static readonly pb::FieldCodec<global::Google.Protobuf.TestProtos.ForeignMessage> _repeated_repeatedForeignMessage_codec = pb::FieldCodec.ForMessage(394, global::Google.Protobuf.TestProtos.ForeignMessage.Parser); @@ -638,6 +702,7 @@ namespace Google.Protobuf.TestProtos { get { return repeatedForeignMessage_; } } + /// <summary>Field number for the "repeated_import_message" field.</summary> public const int RepeatedImportMessageFieldNumber = 50; private static readonly pb::FieldCodec<global::Google.Protobuf.TestProtos.ImportMessage> _repeated_repeatedImportMessage_codec = pb::FieldCodec.ForMessage(402, global::Google.Protobuf.TestProtos.ImportMessage.Parser); @@ -646,6 +711,7 @@ namespace Google.Protobuf.TestProtos { get { return repeatedImportMessage_; } } + /// <summary>Field number for the "repeated_nested_enum" field.</summary> public const int RepeatedNestedEnumFieldNumber = 51; private static readonly pb::FieldCodec<global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedEnum> _repeated_repeatedNestedEnum_codec = pb::FieldCodec.ForEnum(410, x => (int) x, x => (global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedEnum) x); @@ -654,6 +720,7 @@ namespace Google.Protobuf.TestProtos { get { return repeatedNestedEnum_; } } + /// <summary>Field number for the "repeated_foreign_enum" field.</summary> public const int RepeatedForeignEnumFieldNumber = 52; private static readonly pb::FieldCodec<global::Google.Protobuf.TestProtos.ForeignEnum> _repeated_repeatedForeignEnum_codec = pb::FieldCodec.ForEnum(418, x => (int) x, x => (global::Google.Protobuf.TestProtos.ForeignEnum) x); @@ -662,6 +729,7 @@ namespace Google.Protobuf.TestProtos { get { return repeatedForeignEnum_; } } + /// <summary>Field number for the "repeated_import_enum" field.</summary> public const int RepeatedImportEnumFieldNumber = 53; private static readonly pb::FieldCodec<global::Google.Protobuf.TestProtos.ImportEnum> _repeated_repeatedImportEnum_codec = pb::FieldCodec.ForEnum(426, x => (int) x, x => (global::Google.Protobuf.TestProtos.ImportEnum) x); @@ -670,14 +738,19 @@ namespace Google.Protobuf.TestProtos { get { return repeatedImportEnum_; } } + /// <summary>Field number for the "repeated_public_import_message" field.</summary> public const int RepeatedPublicImportMessageFieldNumber = 54; private static readonly pb::FieldCodec<global::Google.Protobuf.TestProtos.PublicImportMessage> _repeated_repeatedPublicImportMessage_codec = pb::FieldCodec.ForMessage(434, global::Google.Protobuf.TestProtos.PublicImportMessage.Parser); private readonly pbc::RepeatedField<global::Google.Protobuf.TestProtos.PublicImportMessage> repeatedPublicImportMessage_ = new pbc::RepeatedField<global::Google.Protobuf.TestProtos.PublicImportMessage>(); + /// <summary> + /// Defined in unittest_import_public.proto + /// </summary> public pbc::RepeatedField<global::Google.Protobuf.TestProtos.PublicImportMessage> RepeatedPublicImportMessage { get { return repeatedPublicImportMessage_; } } + /// <summary>Field number for the "oneof_uint32" field.</summary> public const int OneofUint32FieldNumber = 111; public uint OneofUint32 { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofUint32 ? (uint) oneofField_ : 0; } @@ -687,6 +760,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "oneof_nested_message" field.</summary> public const int OneofNestedMessageFieldNumber = 112; public global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage OneofNestedMessage { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage ? (global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage) oneofField_ : null; } @@ -696,6 +770,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "oneof_string" field.</summary> public const int OneofStringFieldNumber = 113; public string OneofString { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofString ? (string) oneofField_ : ""; } @@ -705,6 +780,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "oneof_bytes" field.</summary> public const int OneofBytesFieldNumber = 114; public pb::ByteString OneofBytes { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofBytes ? (pb::ByteString) oneofField_ : pb::ByteString.Empty; } @@ -715,6 +791,7 @@ namespace Google.Protobuf.TestProtos { } private object oneofField_; + /// <summary>Enum of possible cases for the "oneof_field" oneof.</summary> public enum OneofFieldOneofCase { None = 0, OneofUint32 = 111, @@ -1443,6 +1520,7 @@ namespace Google.Protobuf.TestProtos { } #region Nested types + /// <summary>Container for nested types declared in the TestAllTypes message type.</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Types { public enum NestedEnum { @@ -1450,6 +1528,9 @@ namespace Google.Protobuf.TestProtos { FOO = 1, BAR = 2, BAZ = 3, + /// <summary> + /// Intentionally negative. + /// </summary> NEG = -1, } @@ -1480,8 +1561,14 @@ namespace Google.Protobuf.TestProtos { return new NestedMessage(this); } + /// <summary>Field number for the "bb" field.</summary> public const int BbFieldNumber = 1; private int bb_; + /// <summary> + /// The field name "b" fails to compile in proto1 because it conflicts with + /// a local variable named "b" in one of the generated methods. Doh. + /// This file needs to compile in proto1 to test backwards-compatibility. + /// </summary> public int Bb { get { return bb_; } set { @@ -1560,6 +1647,9 @@ namespace Google.Protobuf.TestProtos { } + /// <summary> + /// This proto includes a recusively nested message. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class NestedTestAllTypes : pb::IMessage<NestedTestAllTypes> { private static readonly pb::MessageParser<NestedTestAllTypes> _parser = new pb::MessageParser<NestedTestAllTypes>(() => new NestedTestAllTypes()); @@ -1589,6 +1679,7 @@ namespace Google.Protobuf.TestProtos { return new NestedTestAllTypes(this); } + /// <summary>Field number for the "child" field.</summary> public const int ChildFieldNumber = 1; private global::Google.Protobuf.TestProtos.NestedTestAllTypes child_; public global::Google.Protobuf.TestProtos.NestedTestAllTypes Child { @@ -1598,6 +1689,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "payload" field.</summary> public const int PayloadFieldNumber = 2; private global::Google.Protobuf.TestProtos.TestAllTypes payload_; public global::Google.Protobuf.TestProtos.TestAllTypes Payload { @@ -1607,6 +1699,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "repeated_child" field.</summary> public const int RepeatedChildFieldNumber = 3; private static readonly pb::FieldCodec<global::Google.Protobuf.TestProtos.NestedTestAllTypes> _repeated_repeatedChild_codec = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.TestProtos.NestedTestAllTypes.Parser); @@ -1745,6 +1838,7 @@ namespace Google.Protobuf.TestProtos { return new TestDeprecatedFields(this); } + /// <summary>Field number for the "deprecated_int32" field.</summary> public const int DeprecatedInt32FieldNumber = 1; private int deprecatedInt32_; [global::System.ObsoleteAttribute()] @@ -1821,6 +1915,10 @@ namespace Google.Protobuf.TestProtos { } + /// <summary> + /// Define these after TestAllTypes to make sure the compiler can handle + /// that. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class ForeignMessage : pb::IMessage<ForeignMessage> { private static readonly pb::MessageParser<ForeignMessage> _parser = new pb::MessageParser<ForeignMessage>(() => new ForeignMessage()); @@ -1848,6 +1946,7 @@ namespace Google.Protobuf.TestProtos { return new ForeignMessage(this); } + /// <summary>Field number for the "c" field.</summary> public const int CFieldNumber = 1; private int c_; public int C { @@ -1999,6 +2098,9 @@ namespace Google.Protobuf.TestProtos { } + /// <summary> + /// Test that we can use NestedMessage from outside TestAllTypes. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class TestForeignNested : pb::IMessage<TestForeignNested> { private static readonly pb::MessageParser<TestForeignNested> _parser = new pb::MessageParser<TestForeignNested>(() => new TestForeignNested()); @@ -2026,6 +2128,7 @@ namespace Google.Protobuf.TestProtos { return new TestForeignNested(this); } + /// <summary>Field number for the "foreign_nested" field.</summary> public const int ForeignNestedFieldNumber = 1; private global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage foreignNested_; public global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage ForeignNested { @@ -2107,6 +2210,9 @@ namespace Google.Protobuf.TestProtos { } + /// <summary> + /// Test that really large tag numbers don't break anything. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class TestReallyLargeTagNumber : pb::IMessage<TestReallyLargeTagNumber> { private static readonly pb::MessageParser<TestReallyLargeTagNumber> _parser = new pb::MessageParser<TestReallyLargeTagNumber>(() => new TestReallyLargeTagNumber()); @@ -2135,8 +2241,13 @@ namespace Google.Protobuf.TestProtos { return new TestReallyLargeTagNumber(this); } + /// <summary>Field number for the "a" field.</summary> public const int AFieldNumber = 1; private int a_; + /// <summary> + /// The largest possible tag number is 2^28 - 1, since the wire format uses + /// three bits to communicate wire type. + /// </summary> public int A { get { return a_; } set { @@ -2144,6 +2255,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "bb" field.</summary> public const int BbFieldNumber = 268435455; private int bb_; public int Bb { @@ -2263,6 +2375,7 @@ namespace Google.Protobuf.TestProtos { return new TestRecursiveMessage(this); } + /// <summary>Field number for the "a" field.</summary> public const int AFieldNumber = 1; private global::Google.Protobuf.TestProtos.TestRecursiveMessage a_; public global::Google.Protobuf.TestProtos.TestRecursiveMessage A { @@ -2272,6 +2385,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "i" field.</summary> public const int IFieldNumber = 2; private int i_; public int I { @@ -2369,6 +2483,9 @@ namespace Google.Protobuf.TestProtos { } + /// <summary> + /// Test that mutual recursion works. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class TestMutualRecursionA : pb::IMessage<TestMutualRecursionA> { private static readonly pb::MessageParser<TestMutualRecursionA> _parser = new pb::MessageParser<TestMutualRecursionA>(() => new TestMutualRecursionA()); @@ -2396,6 +2513,7 @@ namespace Google.Protobuf.TestProtos { return new TestMutualRecursionA(this); } + /// <summary>Field number for the "bb" field.</summary> public const int BbFieldNumber = 1; private global::Google.Protobuf.TestProtos.TestMutualRecursionB bb_; public global::Google.Protobuf.TestProtos.TestMutualRecursionB Bb { @@ -2505,6 +2623,7 @@ namespace Google.Protobuf.TestProtos { return new TestMutualRecursionB(this); } + /// <summary>Field number for the "a" field.</summary> public const int AFieldNumber = 1; private global::Google.Protobuf.TestProtos.TestMutualRecursionA a_; public global::Google.Protobuf.TestProtos.TestMutualRecursionA A { @@ -2514,6 +2633,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "optional_int32" field.</summary> public const int OptionalInt32FieldNumber = 2; private int optionalInt32_; public int OptionalInt32 { @@ -2611,6 +2731,10 @@ namespace Google.Protobuf.TestProtos { } + /// <summary> + /// Test message with CamelCase field names. This violates Protocol Buffer + /// standard style. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class TestCamelCaseFieldNames : pb::IMessage<TestCamelCaseFieldNames> { private static readonly pb::MessageParser<TestCamelCaseFieldNames> _parser = new pb::MessageParser<TestCamelCaseFieldNames>(() => new TestCamelCaseFieldNames()); @@ -2645,6 +2769,7 @@ namespace Google.Protobuf.TestProtos { return new TestCamelCaseFieldNames(this); } + /// <summary>Field number for the "PrimitiveField" field.</summary> public const int PrimitiveFieldFieldNumber = 1; private int primitiveField_; public int PrimitiveField { @@ -2654,6 +2779,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "StringField" field.</summary> public const int StringFieldFieldNumber = 2; private string stringField_ = ""; public string StringField { @@ -2663,6 +2789,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "EnumField" field.</summary> public const int EnumFieldFieldNumber = 3; private global::Google.Protobuf.TestProtos.ForeignEnum enumField_ = global::Google.Protobuf.TestProtos.ForeignEnum.FOREIGN_UNSPECIFIED; public global::Google.Protobuf.TestProtos.ForeignEnum EnumField { @@ -2672,6 +2799,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "MessageField" field.</summary> public const int MessageFieldFieldNumber = 4; private global::Google.Protobuf.TestProtos.ForeignMessage messageField_; public global::Google.Protobuf.TestProtos.ForeignMessage MessageField { @@ -2681,6 +2809,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "RepeatedPrimitiveField" field.</summary> public const int RepeatedPrimitiveFieldFieldNumber = 7; private static readonly pb::FieldCodec<int> _repeated_repeatedPrimitiveField_codec = pb::FieldCodec.ForInt32(58); @@ -2689,6 +2818,7 @@ namespace Google.Protobuf.TestProtos { get { return repeatedPrimitiveField_; } } + /// <summary>Field number for the "RepeatedStringField" field.</summary> public const int RepeatedStringFieldFieldNumber = 8; private static readonly pb::FieldCodec<string> _repeated_repeatedStringField_codec = pb::FieldCodec.ForString(66); @@ -2697,6 +2827,7 @@ namespace Google.Protobuf.TestProtos { get { return repeatedStringField_; } } + /// <summary>Field number for the "RepeatedEnumField" field.</summary> public const int RepeatedEnumFieldFieldNumber = 9; private static readonly pb::FieldCodec<global::Google.Protobuf.TestProtos.ForeignEnum> _repeated_repeatedEnumField_codec = pb::FieldCodec.ForEnum(74, x => (int) x, x => (global::Google.Protobuf.TestProtos.ForeignEnum) x); @@ -2705,6 +2836,7 @@ namespace Google.Protobuf.TestProtos { get { return repeatedEnumField_; } } + /// <summary>Field number for the "RepeatedMessageField" field.</summary> public const int RepeatedMessageFieldFieldNumber = 10; private static readonly pb::FieldCodec<global::Google.Protobuf.TestProtos.ForeignMessage> _repeated_repeatedMessageField_codec = pb::FieldCodec.ForMessage(82, global::Google.Protobuf.TestProtos.ForeignMessage.Parser); @@ -2871,6 +3003,10 @@ namespace Google.Protobuf.TestProtos { } + /// <summary> + /// We list fields out of order, to ensure that we're using field number and not + /// field index to determine serialization order. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class TestFieldOrderings : pb::IMessage<TestFieldOrderings> { private static readonly pb::MessageParser<TestFieldOrderings> _parser = new pb::MessageParser<TestFieldOrderings>(() => new TestFieldOrderings()); @@ -2901,6 +3037,7 @@ namespace Google.Protobuf.TestProtos { return new TestFieldOrderings(this); } + /// <summary>Field number for the "my_string" field.</summary> public const int MyStringFieldNumber = 11; private string myString_ = ""; public string MyString { @@ -2910,6 +3047,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "my_int" field.</summary> public const int MyIntFieldNumber = 1; private long myInt_; public long MyInt { @@ -2919,6 +3057,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "my_float" field.</summary> public const int MyFloatFieldNumber = 101; private float myFloat_; public float MyFloat { @@ -2928,6 +3067,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "single_nested_message" field.</summary> public const int SingleNestedMessageFieldNumber = 200; private global::Google.Protobuf.TestProtos.TestFieldOrderings.Types.NestedMessage singleNestedMessage_; public global::Google.Protobuf.TestProtos.TestFieldOrderings.Types.NestedMessage SingleNestedMessage { @@ -3056,6 +3196,7 @@ namespace Google.Protobuf.TestProtos { } #region Nested types + /// <summary>Container for nested types declared in the TestFieldOrderings message type.</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Types { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -3086,6 +3227,7 @@ namespace Google.Protobuf.TestProtos { return new NestedMessage(this); } + /// <summary>Field number for the "oo" field.</summary> public const int OoFieldNumber = 2; private long oo_; public long Oo { @@ -3095,8 +3237,14 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "bb" field.</summary> public const int BbFieldNumber = 1; private int bb_; + /// <summary> + /// The field name "b" fails to compile in proto1 because it conflicts with + /// a local variable named "b" in one of the generated methods. Doh. + /// This file needs to compile in proto1 to test backwards-compatibility. + /// </summary> public int Bb { get { return bb_; } set { @@ -3218,6 +3366,7 @@ namespace Google.Protobuf.TestProtos { return new SparseEnumMessage(this); } + /// <summary>Field number for the "sparse_enum" field.</summary> public const int SparseEnumFieldNumber = 1; private global::Google.Protobuf.TestProtos.TestSparseEnum sparseEnum_ = global::Google.Protobuf.TestProtos.TestSparseEnum.TEST_SPARSE_ENUM_UNSPECIFIED; public global::Google.Protobuf.TestProtos.TestSparseEnum SparseEnum { @@ -3293,6 +3442,9 @@ namespace Google.Protobuf.TestProtos { } + /// <summary> + /// Test String and Bytes: string is for valid UTF-8 strings + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class OneString : pb::IMessage<OneString> { private static readonly pb::MessageParser<OneString> _parser = new pb::MessageParser<OneString>(() => new OneString()); @@ -3320,6 +3472,7 @@ namespace Google.Protobuf.TestProtos { return new OneString(this); } + /// <summary>Field number for the "data" field.</summary> public const int DataFieldNumber = 1; private string data_ = ""; public string Data { @@ -3422,6 +3575,7 @@ namespace Google.Protobuf.TestProtos { return new MoreString(this); } + /// <summary>Field number for the "data" field.</summary> public const int DataFieldNumber = 1; private static readonly pb::FieldCodec<string> _repeated_data_codec = pb::FieldCodec.ForString(10); @@ -3516,6 +3670,7 @@ namespace Google.Protobuf.TestProtos { return new OneBytes(this); } + /// <summary>Field number for the "data" field.</summary> public const int DataFieldNumber = 1; private pb::ByteString data_ = pb::ByteString.Empty; public pb::ByteString Data { @@ -3618,6 +3773,7 @@ namespace Google.Protobuf.TestProtos { return new MoreBytes(this); } + /// <summary>Field number for the "data" field.</summary> public const int DataFieldNumber = 1; private pb::ByteString data_ = pb::ByteString.Empty; public pb::ByteString Data { @@ -3693,6 +3849,9 @@ namespace Google.Protobuf.TestProtos { } + /// <summary> + /// Test int32, uint32, int64, uint64, and bool are all compatible + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Int32Message : pb::IMessage<Int32Message> { private static readonly pb::MessageParser<Int32Message> _parser = new pb::MessageParser<Int32Message>(() => new Int32Message()); @@ -3720,6 +3879,7 @@ namespace Google.Protobuf.TestProtos { return new Int32Message(this); } + /// <summary>Field number for the "data" field.</summary> public const int DataFieldNumber = 1; private int data_; public int Data { @@ -3822,6 +3982,7 @@ namespace Google.Protobuf.TestProtos { return new Uint32Message(this); } + /// <summary>Field number for the "data" field.</summary> public const int DataFieldNumber = 1; private uint data_; public uint Data { @@ -3924,6 +4085,7 @@ namespace Google.Protobuf.TestProtos { return new Int64Message(this); } + /// <summary>Field number for the "data" field.</summary> public const int DataFieldNumber = 1; private long data_; public long Data { @@ -4026,6 +4188,7 @@ namespace Google.Protobuf.TestProtos { return new Uint64Message(this); } + /// <summary>Field number for the "data" field.</summary> public const int DataFieldNumber = 1; private ulong data_; public ulong Data { @@ -4128,6 +4291,7 @@ namespace Google.Protobuf.TestProtos { return new BoolMessage(this); } + /// <summary>Field number for the "data" field.</summary> public const int DataFieldNumber = 1; private bool data_; public bool Data { @@ -4203,6 +4367,9 @@ namespace Google.Protobuf.TestProtos { } + /// <summary> + /// Test oneofs. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class TestOneof : pb::IMessage<TestOneof> { private static readonly pb::MessageParser<TestOneof> _parser = new pb::MessageParser<TestOneof>(() => new TestOneof()); @@ -4241,6 +4408,7 @@ namespace Google.Protobuf.TestProtos { return new TestOneof(this); } + /// <summary>Field number for the "foo_int" field.</summary> public const int FooIntFieldNumber = 1; public int FooInt { get { return fooCase_ == FooOneofCase.FooInt ? (int) foo_ : 0; } @@ -4250,6 +4418,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "foo_string" field.</summary> public const int FooStringFieldNumber = 2; public string FooString { get { return fooCase_ == FooOneofCase.FooString ? (string) foo_ : ""; } @@ -4259,6 +4428,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "foo_message" field.</summary> public const int FooMessageFieldNumber = 3; public global::Google.Protobuf.TestProtos.TestAllTypes FooMessage { get { return fooCase_ == FooOneofCase.FooMessage ? (global::Google.Protobuf.TestProtos.TestAllTypes) foo_ : null; } @@ -4269,6 +4439,7 @@ namespace Google.Protobuf.TestProtos { } private object foo_; + /// <summary>Enum of possible cases for the "foo" oneof.</summary> public enum FooOneofCase { None = 0, FooInt = 1, @@ -4431,6 +4602,7 @@ namespace Google.Protobuf.TestProtos { return new TestPackedTypes(this); } + /// <summary>Field number for the "packed_int32" field.</summary> public const int PackedInt32FieldNumber = 90; private static readonly pb::FieldCodec<int> _repeated_packedInt32_codec = pb::FieldCodec.ForInt32(722); @@ -4439,6 +4611,7 @@ namespace Google.Protobuf.TestProtos { get { return packedInt32_; } } + /// <summary>Field number for the "packed_int64" field.</summary> public const int PackedInt64FieldNumber = 91; private static readonly pb::FieldCodec<long> _repeated_packedInt64_codec = pb::FieldCodec.ForInt64(730); @@ -4447,6 +4620,7 @@ namespace Google.Protobuf.TestProtos { get { return packedInt64_; } } + /// <summary>Field number for the "packed_uint32" field.</summary> public const int PackedUint32FieldNumber = 92; private static readonly pb::FieldCodec<uint> _repeated_packedUint32_codec = pb::FieldCodec.ForUInt32(738); @@ -4455,6 +4629,7 @@ namespace Google.Protobuf.TestProtos { get { return packedUint32_; } } + /// <summary>Field number for the "packed_uint64" field.</summary> public const int PackedUint64FieldNumber = 93; private static readonly pb::FieldCodec<ulong> _repeated_packedUint64_codec = pb::FieldCodec.ForUInt64(746); @@ -4463,6 +4638,7 @@ namespace Google.Protobuf.TestProtos { get { return packedUint64_; } } + /// <summary>Field number for the "packed_sint32" field.</summary> public const int PackedSint32FieldNumber = 94; private static readonly pb::FieldCodec<int> _repeated_packedSint32_codec = pb::FieldCodec.ForSInt32(754); @@ -4471,6 +4647,7 @@ namespace Google.Protobuf.TestProtos { get { return packedSint32_; } } + /// <summary>Field number for the "packed_sint64" field.</summary> public const int PackedSint64FieldNumber = 95; private static readonly pb::FieldCodec<long> _repeated_packedSint64_codec = pb::FieldCodec.ForSInt64(762); @@ -4479,6 +4656,7 @@ namespace Google.Protobuf.TestProtos { get { return packedSint64_; } } + /// <summary>Field number for the "packed_fixed32" field.</summary> public const int PackedFixed32FieldNumber = 96; private static readonly pb::FieldCodec<uint> _repeated_packedFixed32_codec = pb::FieldCodec.ForFixed32(770); @@ -4487,6 +4665,7 @@ namespace Google.Protobuf.TestProtos { get { return packedFixed32_; } } + /// <summary>Field number for the "packed_fixed64" field.</summary> public const int PackedFixed64FieldNumber = 97; private static readonly pb::FieldCodec<ulong> _repeated_packedFixed64_codec = pb::FieldCodec.ForFixed64(778); @@ -4495,6 +4674,7 @@ namespace Google.Protobuf.TestProtos { get { return packedFixed64_; } } + /// <summary>Field number for the "packed_sfixed32" field.</summary> public const int PackedSfixed32FieldNumber = 98; private static readonly pb::FieldCodec<int> _repeated_packedSfixed32_codec = pb::FieldCodec.ForSFixed32(786); @@ -4503,6 +4683,7 @@ namespace Google.Protobuf.TestProtos { get { return packedSfixed32_; } } + /// <summary>Field number for the "packed_sfixed64" field.</summary> public const int PackedSfixed64FieldNumber = 99; private static readonly pb::FieldCodec<long> _repeated_packedSfixed64_codec = pb::FieldCodec.ForSFixed64(794); @@ -4511,6 +4692,7 @@ namespace Google.Protobuf.TestProtos { get { return packedSfixed64_; } } + /// <summary>Field number for the "packed_float" field.</summary> public const int PackedFloatFieldNumber = 100; private static readonly pb::FieldCodec<float> _repeated_packedFloat_codec = pb::FieldCodec.ForFloat(802); @@ -4519,6 +4701,7 @@ namespace Google.Protobuf.TestProtos { get { return packedFloat_; } } + /// <summary>Field number for the "packed_double" field.</summary> public const int PackedDoubleFieldNumber = 101; private static readonly pb::FieldCodec<double> _repeated_packedDouble_codec = pb::FieldCodec.ForDouble(810); @@ -4527,6 +4710,7 @@ namespace Google.Protobuf.TestProtos { get { return packedDouble_; } } + /// <summary>Field number for the "packed_bool" field.</summary> public const int PackedBoolFieldNumber = 102; private static readonly pb::FieldCodec<bool> _repeated_packedBool_codec = pb::FieldCodec.ForBool(818); @@ -4535,6 +4719,7 @@ namespace Google.Protobuf.TestProtos { get { return packedBool_; } } + /// <summary>Field number for the "packed_enum" field.</summary> public const int PackedEnumFieldNumber = 103; private static readonly pb::FieldCodec<global::Google.Protobuf.TestProtos.ForeignEnum> _repeated_packedEnum_codec = pb::FieldCodec.ForEnum(826, x => (int) x, x => (global::Google.Protobuf.TestProtos.ForeignEnum) x); @@ -4733,6 +4918,10 @@ namespace Google.Protobuf.TestProtos { } + /// <summary> + /// A message with the same fields as TestPackedTypes, but without packing. Used + /// to test packed <-> unpacked wire compatibility. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class TestUnpackedTypes : pb::IMessage<TestUnpackedTypes> { private static readonly pb::MessageParser<TestUnpackedTypes> _parser = new pb::MessageParser<TestUnpackedTypes>(() => new TestUnpackedTypes()); @@ -4773,6 +4962,7 @@ namespace Google.Protobuf.TestProtos { return new TestUnpackedTypes(this); } + /// <summary>Field number for the "unpacked_int32" field.</summary> public const int UnpackedInt32FieldNumber = 90; private static readonly pb::FieldCodec<int> _repeated_unpackedInt32_codec = pb::FieldCodec.ForInt32(720); @@ -4781,6 +4971,7 @@ namespace Google.Protobuf.TestProtos { get { return unpackedInt32_; } } + /// <summary>Field number for the "unpacked_int64" field.</summary> public const int UnpackedInt64FieldNumber = 91; private static readonly pb::FieldCodec<long> _repeated_unpackedInt64_codec = pb::FieldCodec.ForInt64(728); @@ -4789,6 +4980,7 @@ namespace Google.Protobuf.TestProtos { get { return unpackedInt64_; } } + /// <summary>Field number for the "unpacked_uint32" field.</summary> public const int UnpackedUint32FieldNumber = 92; private static readonly pb::FieldCodec<uint> _repeated_unpackedUint32_codec = pb::FieldCodec.ForUInt32(736); @@ -4797,6 +4989,7 @@ namespace Google.Protobuf.TestProtos { get { return unpackedUint32_; } } + /// <summary>Field number for the "unpacked_uint64" field.</summary> public const int UnpackedUint64FieldNumber = 93; private static readonly pb::FieldCodec<ulong> _repeated_unpackedUint64_codec = pb::FieldCodec.ForUInt64(744); @@ -4805,6 +4998,7 @@ namespace Google.Protobuf.TestProtos { get { return unpackedUint64_; } } + /// <summary>Field number for the "unpacked_sint32" field.</summary> public const int UnpackedSint32FieldNumber = 94; private static readonly pb::FieldCodec<int> _repeated_unpackedSint32_codec = pb::FieldCodec.ForSInt32(752); @@ -4813,6 +5007,7 @@ namespace Google.Protobuf.TestProtos { get { return unpackedSint32_; } } + /// <summary>Field number for the "unpacked_sint64" field.</summary> public const int UnpackedSint64FieldNumber = 95; private static readonly pb::FieldCodec<long> _repeated_unpackedSint64_codec = pb::FieldCodec.ForSInt64(760); @@ -4821,6 +5016,7 @@ namespace Google.Protobuf.TestProtos { get { return unpackedSint64_; } } + /// <summary>Field number for the "unpacked_fixed32" field.</summary> public const int UnpackedFixed32FieldNumber = 96; private static readonly pb::FieldCodec<uint> _repeated_unpackedFixed32_codec = pb::FieldCodec.ForFixed32(773); @@ -4829,6 +5025,7 @@ namespace Google.Protobuf.TestProtos { get { return unpackedFixed32_; } } + /// <summary>Field number for the "unpacked_fixed64" field.</summary> public const int UnpackedFixed64FieldNumber = 97; private static readonly pb::FieldCodec<ulong> _repeated_unpackedFixed64_codec = pb::FieldCodec.ForFixed64(777); @@ -4837,6 +5034,7 @@ namespace Google.Protobuf.TestProtos { get { return unpackedFixed64_; } } + /// <summary>Field number for the "unpacked_sfixed32" field.</summary> public const int UnpackedSfixed32FieldNumber = 98; private static readonly pb::FieldCodec<int> _repeated_unpackedSfixed32_codec = pb::FieldCodec.ForSFixed32(789); @@ -4845,6 +5043,7 @@ namespace Google.Protobuf.TestProtos { get { return unpackedSfixed32_; } } + /// <summary>Field number for the "unpacked_sfixed64" field.</summary> public const int UnpackedSfixed64FieldNumber = 99; private static readonly pb::FieldCodec<long> _repeated_unpackedSfixed64_codec = pb::FieldCodec.ForSFixed64(793); @@ -4853,6 +5052,7 @@ namespace Google.Protobuf.TestProtos { get { return unpackedSfixed64_; } } + /// <summary>Field number for the "unpacked_float" field.</summary> public const int UnpackedFloatFieldNumber = 100; private static readonly pb::FieldCodec<float> _repeated_unpackedFloat_codec = pb::FieldCodec.ForFloat(805); @@ -4861,6 +5061,7 @@ namespace Google.Protobuf.TestProtos { get { return unpackedFloat_; } } + /// <summary>Field number for the "unpacked_double" field.</summary> public const int UnpackedDoubleFieldNumber = 101; private static readonly pb::FieldCodec<double> _repeated_unpackedDouble_codec = pb::FieldCodec.ForDouble(809); @@ -4869,6 +5070,7 @@ namespace Google.Protobuf.TestProtos { get { return unpackedDouble_; } } + /// <summary>Field number for the "unpacked_bool" field.</summary> public const int UnpackedBoolFieldNumber = 102; private static readonly pb::FieldCodec<bool> _repeated_unpackedBool_codec = pb::FieldCodec.ForBool(816); @@ -4877,6 +5079,7 @@ namespace Google.Protobuf.TestProtos { get { return unpackedBool_; } } + /// <summary>Field number for the "unpacked_enum" field.</summary> public const int UnpackedEnumFieldNumber = 103; private static readonly pb::FieldCodec<global::Google.Protobuf.TestProtos.ForeignEnum> _repeated_unpackedEnum_codec = pb::FieldCodec.ForEnum(824, x => (int) x, x => (global::Google.Protobuf.TestProtos.ForeignEnum) x); @@ -5107,30 +5310,45 @@ namespace Google.Protobuf.TestProtos { return new TestRepeatedScalarDifferentTagSizes(this); } + /// <summary>Field number for the "repeated_fixed32" field.</summary> public const int RepeatedFixed32FieldNumber = 12; private static readonly pb::FieldCodec<uint> _repeated_repeatedFixed32_codec = pb::FieldCodec.ForFixed32(98); private readonly pbc::RepeatedField<uint> repeatedFixed32_ = new pbc::RepeatedField<uint>(); + /// <summary> + /// Parsing repeated fixed size values used to fail. This message needs to be + /// used in order to get a tag of the right size; all of the repeated fields + /// in TestAllTypes didn't trigger the check. + /// </summary> public pbc::RepeatedField<uint> RepeatedFixed32 { get { return repeatedFixed32_; } } + /// <summary>Field number for the "repeated_int32" field.</summary> public const int RepeatedInt32FieldNumber = 13; private static readonly pb::FieldCodec<int> _repeated_repeatedInt32_codec = pb::FieldCodec.ForInt32(106); private readonly pbc::RepeatedField<int> repeatedInt32_ = new pbc::RepeatedField<int>(); + /// <summary> + /// Check for a varint type, just for good measure. + /// </summary> public pbc::RepeatedField<int> RepeatedInt32 { get { return repeatedInt32_; } } + /// <summary>Field number for the "repeated_fixed64" field.</summary> public const int RepeatedFixed64FieldNumber = 2046; private static readonly pb::FieldCodec<ulong> _repeated_repeatedFixed64_codec = pb::FieldCodec.ForFixed64(16370); private readonly pbc::RepeatedField<ulong> repeatedFixed64_ = new pbc::RepeatedField<ulong>(); + /// <summary> + /// These have two-byte tags. + /// </summary> public pbc::RepeatedField<ulong> RepeatedFixed64 { get { return repeatedFixed64_; } } + /// <summary>Field number for the "repeated_int64" field.</summary> public const int RepeatedInt64FieldNumber = 2047; private static readonly pb::FieldCodec<long> _repeated_repeatedInt64_codec = pb::FieldCodec.ForInt64(16378); @@ -5139,14 +5357,19 @@ namespace Google.Protobuf.TestProtos { get { return repeatedInt64_; } } + /// <summary>Field number for the "repeated_float" field.</summary> public const int RepeatedFloatFieldNumber = 262142; private static readonly pb::FieldCodec<float> _repeated_repeatedFloat_codec = pb::FieldCodec.ForFloat(2097138); private readonly pbc::RepeatedField<float> repeatedFloat_ = new pbc::RepeatedField<float>(); + /// <summary> + /// Three byte tags. + /// </summary> public pbc::RepeatedField<float> RepeatedFloat { get { return repeatedFloat_; } } + /// <summary>Field number for the "repeated_uint64" field.</summary> public const int RepeatedUint64FieldNumber = 262143; private static readonly pb::FieldCodec<ulong> _repeated_repeatedUint64_codec = pb::FieldCodec.ForUInt64(2097146); @@ -5292,8 +5515,12 @@ namespace Google.Protobuf.TestProtos { return new TestCommentInjectionMessage(this); } + /// <summary>Field number for the "a" field.</summary> public const int AFieldNumber = 1; private string a_ = ""; + /// <summary> + /// */ <- This should not close the generated doc comment + /// </summary> public string A { get { return a_; } set { @@ -5367,6 +5594,9 @@ namespace Google.Protobuf.TestProtos { } + /// <summary> + /// Test that RPC services work. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class FooRequest : pb::IMessage<FooRequest> { private static readonly pb::MessageParser<FooRequest> _parser = new pb::MessageParser<FooRequest>(() => new FooRequest()); diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestWellKnownTypes.cs b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestWellKnownTypes.cs index 16634e03..bd90ddd8 100644 --- a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestWellKnownTypes.cs +++ b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestWellKnownTypes.cs @@ -9,10 +9,12 @@ using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; namespace Google.Protobuf.TestProtos { + /// <summary>Holder for reflection information generated from google/protobuf/unittest_well_known_types.proto</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class UnittestWellKnownTypes { #region Descriptor + /// <summary>File descriptor for google/protobuf/unittest_well_known_types.proto</summary> public static pbr::FileDescriptor Descriptor { get { return descriptor; } } @@ -21,141 +23,141 @@ namespace Google.Protobuf.TestProtos { static UnittestWellKnownTypes() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "Ci9nb29nbGUvcHJvdG9idWYvdW5pdHRlc3Rfd2VsbF9rbm93bl90eXBlcy5w", - "cm90bxIRcHJvdG9idWZfdW5pdHRlc3QaGWdvb2dsZS9wcm90b2J1Zi9hbnku", - "cHJvdG8aGWdvb2dsZS9wcm90b2J1Zi9hcGkucHJvdG8aHmdvb2dsZS9wcm90", - "b2J1Zi9kdXJhdGlvbi5wcm90bxobZ29vZ2xlL3Byb3RvYnVmL2VtcHR5LnBy", - "b3RvGiBnb29nbGUvcHJvdG9idWYvZmllbGRfbWFzay5wcm90bxokZ29vZ2xl", - "L3Byb3RvYnVmL3NvdXJjZV9jb250ZXh0LnByb3RvGhxnb29nbGUvcHJvdG9i", - "dWYvc3RydWN0LnByb3RvGh9nb29nbGUvcHJvdG9idWYvdGltZXN0YW1wLnBy", - "b3RvGhpnb29nbGUvcHJvdG9idWYvdHlwZS5wcm90bxoeZ29vZ2xlL3Byb3Rv", - "YnVmL3dyYXBwZXJzLnByb3RvIpEHChJUZXN0V2VsbEtub3duVHlwZXMSJwoJ", - "YW55X2ZpZWxkGAEgASgLMhQuZ29vZ2xlLnByb3RvYnVmLkFueRInCglhcGlf", - "ZmllbGQYAiABKAsyFC5nb29nbGUucHJvdG9idWYuQXBpEjEKDmR1cmF0aW9u", - "X2ZpZWxkGAMgASgLMhkuZ29vZ2xlLnByb3RvYnVmLkR1cmF0aW9uEisKC2Vt", - "cHR5X2ZpZWxkGAQgASgLMh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XBlcxInCglhbnlfZmllbGQYASADKAsyFC5nb29nbGUu", - "cHJvdG9idWYuQW55EicKCWFwaV9maWVsZBgCIAMoCzIULmdvb2dsZS5wcm90", - "b2J1Zi5BcGkSMQoOZHVyYXRpb25fZmllbGQYAyADKAsyGS5nb29nbGUucHJv", - "dG9idWYuRHVyYXRpb24SKwoLZW1wdHlfZmllbGQYBCADKAsyFi5nb29nbGUu", - "cHJvdG9idWYuRW1wdHkSNAoQZmllbGRfbWFza19maWVsZBgFIAMoCzIaLmdv", - "b2dsZS5wcm90b2J1Zi5GaWVsZE1hc2sSPAoUc291cmNlX2NvbnRleHRfZmll", - "bGQYBiADKAsyHi5nb29nbGUucHJvdG9idWYuU291cmNlQ29udGV4dBItCgxz", - "dHJ1Y3RfZmllbGQYByADKAsyFy5nb29nbGUucHJvdG9idWYuU3RydWN0EjMK", - "D3RpbWVzdGFtcF9maWVsZBgIIAMoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1l", - "c3RhbXASKQoKdHlwZV9maWVsZBgJIAMoCzIVLmdvb2dsZS5wcm90b2J1Zi5U", - "eXBlEjIKDGRvdWJsZV9maWVsZBgKIAMoCzIcLmdvb2dsZS5wcm90b2J1Zi5E", - "b3VibGVWYWx1ZRIwCgtmbG9hdF9maWVsZBgLIAMoCzIbLmdvb2dsZS5wcm90", - "b2J1Zi5GbG9hdFZhbHVlEjAKC2ludDY0X2ZpZWxkGAwgAygLMhsuZ29vZ2xl", - "LnByb3RvYnVmLkludDY0VmFsdWUSMgoMdWludDY0X2ZpZWxkGA0gAygLMhwu", - "Z29vZ2xlLnByb3RvYnVmLlVJbnQ2NFZhbHVlEjAKC2ludDMyX2ZpZWxkGA4g", - "AygLMhsuZ29vZ2xlLnByb3RvYnVmLkludDMyVmFsdWUSMgoMdWludDMyX2Zp", - "ZWxkGA8gAygLMhwuZ29vZ2xlLnByb3RvYnVmLlVJbnQzMlZhbHVlEi4KCmJv", - "b2xfZmllbGQYECADKAsyGi5nb29nbGUucHJvdG9idWYuQm9vbFZhbHVlEjIK", - "DHN0cmluZ19maWVsZBgRIAMoCzIcLmdvb2dsZS5wcm90b2J1Zi5TdHJpbmdW", - "YWx1ZRIwCgtieXRlc19maWVsZBgSIAMoCzIbLmdvb2dsZS5wcm90b2J1Zi5C", - "eXRlc1ZhbHVlIsUHChNPbmVvZldlbGxLbm93blR5cGVzEikKCWFueV9maWVs", - "ZBgBIAEoCzIULmdvb2dsZS5wcm90b2J1Zi5BbnlIABIpCglhcGlfZmllbGQY", - "AiABKAsyFC5nb29nbGUucHJvdG9idWYuQXBpSAASMwoOZHVyYXRpb25fZmll", - "bGQYAyABKAsyGS5nb29nbGUucHJvdG9idWYuRHVyYXRpb25IABItCgtlbXB0", - "eV9maWVsZBgEIAEoCzIWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eUgAEjYKEGZp", - "ZWxkX21hc2tfZmllbGQYBSABKAsyGi5nb29nbGUucHJvdG9idWYuRmllbGRN", - "YXNrSAASPgoUc291cmNlX2NvbnRleHRfZmllbGQYBiABKAsyHi5nb29nbGUu", - "cHJvdG9idWYuU291cmNlQ29udGV4dEgAEi8KDHN0cnVjdF9maWVsZBgHIAEo", - "CzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3RIABI1Cg90aW1lc3RhbXBfZmll", - "bGQYCCABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wSAASKwoKdHlw", - "ZV9maWVsZBgJIAEoCzIVLmdvb2dsZS5wcm90b2J1Zi5UeXBlSAASNAoMZG91", - "YmxlX2ZpZWxkGAogASgLMhwuZ29vZ2xlLnByb3RvYnVmLkRvdWJsZVZhbHVl", - "SAASMgoLZmxvYXRfZmllbGQYCyABKAsyGy5nb29nbGUucHJvdG9idWYuRmxv", - "YXRWYWx1ZUgAEjIKC2ludDY0X2ZpZWxkGAwgASgLMhsuZ29vZ2xlLnByb3Rv", - "YnVmLkludDY0VmFsdWVIABI0Cgx1aW50NjRfZmllbGQYDSABKA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S5wcm90", + "b2J1Zi5BcGkSMQoOZHVyYXRpb25fZmllbGQYAyADKAsyGS5nb29nbGUucHJv", + "dG9idWYuRHVyYXRpb24SKwoLZW1wdHlfZmllbGQYBCADKAsyFi5nb29nbGUu", + "cHJvdG9idWYuRW1wdHkSNAoQZmllbGRfbWFza19maWVsZBgFIAMoCzIaLmdv", + "b2dsZS5wcm90b2J1Zi5GaWVsZE1hc2sSPAoUc291cmNlX2NvbnRleHRfZmll", + "bGQYBiADKAsyHi5nb29nbGUucHJvdG9idWYuU291cmNlQ29udGV4dBItCgxz", + "dHJ1Y3RfZmllbGQYByADKAsyFy5nb29nbGUucHJvdG9idWYuU3RydWN0EjMK", + "D3RpbWVzdGFtcF9maWVsZBgIIAMoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1l", + "c3RhbXASKQoKdHlwZV9maWVsZBgJIAMoCzIVLmdvb2dsZS5wcm90b2J1Zi5U", + "eXBlEjIKDGRvdWJsZV9maWVsZBgKIAMoCzIcLmdvb2dsZS5wcm90b2J1Zi5E", + "b3VibGVWYWx1ZRIwCgtmbG9hdF9maWVsZBgLIAMoCzIbLmdvb2dsZS5wcm90", + "b2J1Zi5GbG9hdFZhbHVlEjAKC2ludDY0X2ZpZWxkGAwgAygLMhsuZ29vZ2xl", + "LnByb3RvYnVmLkludDY0VmFsdWUSMgoMdWludDY0X2ZpZWxkGA0gAygLMhwu", + "Z29vZ2xlLnByb3RvYnVmLlVJbnQ2NFZhbHVlEjAKC2ludDMyX2ZpZWxkGA4g", + "AygLMhsuZ29vZ2xlLnByb3RvYnVmLkludDMyVmFsdWUSMgoMdWludDMyX2Zp", + "ZWxkGA8gAygLMhwuZ29vZ2xlLnByb3RvYnVmLlVJbnQzMlZhbHVlEi4KCmJv", + "b2xfZmllbGQYECADKAsyGi5nb29nbGUucHJvdG9idWYuQm9vbFZhbHVlEjIK", + "DHN0cmluZ19maWVsZBgRIAMoCzIcLmdvb2dsZS5wcm90b2J1Zi5TdHJpbmdW", + "YWx1ZRIwCgtieXRlc19maWVsZBgSIAMoCzIbLmdvb2dsZS5wcm90b2J1Zi5C", + "eXRlc1ZhbHVlIsUHChNPbmVvZldlbGxLbm93blR5cGVzEikKCWFueV9maWVs", + "ZBgBIAEoCzIULmdvb2dsZS5wcm90b2J1Zi5BbnlIABIpCglhcGlfZmllbGQY", + "AiABKAsyFC5nb29nbGUucHJvdG9idWYuQXBpSAASMwoOZHVyYXRpb25fZmll", + "bGQYAyABKAsyGS5nb29nbGUucHJvdG9idWYuRHVyYXRpb25IABItCgtlbXB0", + "eV9maWVsZBgEIAEoCzIWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eUgAEjYKEGZp", + "ZWxkX21hc2tfZmllbGQYBSABKAsyGi5nb29nbGUucHJvdG9idWYuRmllbGRN", + "YXNrSAASPgoUc291cmNlX2NvbnRleHRfZmllbGQYBiABKAsyHi5nb29nbGUu", + "cHJvdG9idWYuU291cmNlQ29udGV4dEgAEi8KDHN0cnVjdF9maWVsZBgHIAEo", + "CzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3RIABI1Cg90aW1lc3RhbXBfZmll", + "bGQYCCABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wSAASKwoKdHlw", + "ZV9maWVsZBgJIAEoCzIVLmdvb2dsZS5wcm90b2J1Zi5UeXBlSAASNAoMZG91", + "YmxlX2ZpZWxkGAogASgLMhwuZ29vZ2xlLnByb3RvYnVmLkRvdWJsZVZhbHVl", + "SAASMgoLZmxvYXRfZmllbGQYCyABKAsyGy5nb29nbGUucHJvdG9idWYuRmxv", + "YXRWYWx1ZUgAEjIKC2ludDY0X2ZpZWxkGAwgASgLMhsuZ29vZ2xlLnByb3Rv", + "YnVmLkludDY0VmFsdWVIABI0Cgx1aW50NjRfZmllbGQYDSABKAsyHC5nb29n", + "bGUucHJvdG9idWYuVUludDY0VmFsdWVIABIyCgtpbnQzMl9maWVsZBgOIAEo", + "CzIbLmdvb2dsZS5wcm90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LnByb3RvYnVmX3VuaXR0ZXN0Lk1hcFdlbGxLbm93blR5cGVz", + "LlN0cmluZ0ZpZWxkRW50cnkSSQoLYnl0ZXNfZmllbGQYEiADKAsyNC5wcm90", + "b2J1Zl91bml0dGVzdC5NYXBXZWxsS25vd25UeXBlcy5CeXRlc0ZpZWxkRW50", + "cnkaRQoNQW55RmllbGRFbnRyeRILCgNrZXkYASABKAUSIwoFdmFsdWUYAiAB", + "KAsyFC5nb29nbGUucHJvdG9idWYuQW55OgI4ARpFCg1BcGlGaWVsZEVudHJ5", + "EgsKA2tleRgBIAEoBRIjCgV2YWx1ZRgCIAEoCzIULmdvb2dsZS5wcm90b2J1", + "Zi5BcGk6AjgBGk8KEkR1cmF0aW9uRmllbGRFbnRyeRILCgNrZXkYASABKAUS", + "KAoFdmFsdWUYAiABKAsyGS5nb29nbGUucHJvdG9idWYuRHVyYXRpb246AjgB", + "GkkKD0VtcHR5RmllbGRFbnRyeRILCgNrZXkYASABKAUSJQoFdmFsdWUYAiAB", + "KAsyFi5nb29nbGUucHJvdG9idWYuRW1wdHk6AjgBGlEKE0ZpZWxkTWFza0Zp", + "ZWxkRW50cnkSCwoDa2V5GAEgASgFEikKBXZhbHVlGAIgASgLMhouZ29vZ2xl", + "LnByb3RvYnVmLkZpZWxkTWFzazoCOAEaWQoXU291cmNlQ29udGV4dEZpZWxk", + "RW50cnkSCwoDa2V5GAEgASgFEi0KBXZhbHVlGAIgASgLMh4uZ29vZ2xlLnBy", + "b3RvYnVmLlNvdXJjZUNvbnRleHQ6AjgBGksKEFN0cnVjdEZpZWxkRW50cnkS", + "CwoDa2V5GAEgASgFEiYKBXZhbHVlGAIgASgLMhcuZ29vZ2xlLnByb3RvYnVm", + "LlN0cnVjdDoCOAEaUQoTVGltZXN0YW1wRmllbGRFbnRyeRILCgNrZXkYASAB", + "KAUSKQoFdmFsdWUYAiABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1w", + "OgI4ARpHCg5UeXBlRmllb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JvdG9idWYuQnl0ZXNWYWx1ZToCOAFCOQoYY29t", + "Lmdvb2dsZS5wcm90b2J1Zi50ZXN0UAGqAhpHb29nbGUuUHJvdG9idWYuVGVz", "dFByb3Rvc2IGcHJvdG8z")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.Proto.Any.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.Api.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.Duration.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.Empty.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.FieldMask.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.SourceContext.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.Struct.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.Timestamp.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.Type.Descriptor, global::Google.Protobuf.WellKnownTypes.Wrappers.Descriptor, }, @@ -170,6 +172,11 @@ namespace Google.Protobuf.TestProtos { } #region Messages + /// <summary> + /// Test that we can include all well-known types. + /// Each wrapper type is included separately, as languages + /// map handle different wrappers in different ways. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class TestWellKnownTypes : pb::IMessage<TestWellKnownTypes> { private static readonly pb::MessageParser<TestWellKnownTypes> _parser = new pb::MessageParser<TestWellKnownTypes>(() => new TestWellKnownTypes()); @@ -214,6 +221,7 @@ namespace Google.Protobuf.TestProtos { return new TestWellKnownTypes(this); } + /// <summary>Field number for the "any_field" field.</summary> public const int AnyFieldFieldNumber = 1; private global::Google.Protobuf.WellKnownTypes.Any anyField_; public global::Google.Protobuf.WellKnownTypes.Any AnyField { @@ -223,6 +231,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "api_field" field.</summary> public const int ApiFieldFieldNumber = 2; private global::Google.Protobuf.WellKnownTypes.Api apiField_; public global::Google.Protobuf.WellKnownTypes.Api ApiField { @@ -232,6 +241,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "duration_field" field.</summary> public const int DurationFieldFieldNumber = 3; private global::Google.Protobuf.WellKnownTypes.Duration durationField_; public global::Google.Protobuf.WellKnownTypes.Duration DurationField { @@ -241,6 +251,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "empty_field" field.</summary> public const int EmptyFieldFieldNumber = 4; private global::Google.Protobuf.WellKnownTypes.Empty emptyField_; public global::Google.Protobuf.WellKnownTypes.Empty EmptyField { @@ -250,6 +261,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "field_mask_field" field.</summary> public const int FieldMaskFieldFieldNumber = 5; private global::Google.Protobuf.WellKnownTypes.FieldMask fieldMaskField_; public global::Google.Protobuf.WellKnownTypes.FieldMask FieldMaskField { @@ -259,6 +271,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "source_context_field" field.</summary> public const int SourceContextFieldFieldNumber = 6; private global::Google.Protobuf.WellKnownTypes.SourceContext sourceContextField_; public global::Google.Protobuf.WellKnownTypes.SourceContext SourceContextField { @@ -268,6 +281,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "struct_field" field.</summary> public const int StructFieldFieldNumber = 7; private global::Google.Protobuf.WellKnownTypes.Struct structField_; public global::Google.Protobuf.WellKnownTypes.Struct StructField { @@ -277,6 +291,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "timestamp_field" field.</summary> public const int TimestampFieldFieldNumber = 8; private global::Google.Protobuf.WellKnownTypes.Timestamp timestampField_; public global::Google.Protobuf.WellKnownTypes.Timestamp TimestampField { @@ -286,6 +301,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "type_field" field.</summary> public const int TypeFieldFieldNumber = 9; private global::Google.Protobuf.WellKnownTypes.Type typeField_; public global::Google.Protobuf.WellKnownTypes.Type TypeField { @@ -295,6 +311,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "double_field" field.</summary> public const int DoubleFieldFieldNumber = 10; private static readonly pb::FieldCodec<double?> _single_doubleField_codec = pb::FieldCodec.ForStructWrapper<double>(82); private double? doubleField_; @@ -305,6 +322,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "float_field" field.</summary> public const int FloatFieldFieldNumber = 11; private static readonly pb::FieldCodec<float?> _single_floatField_codec = pb::FieldCodec.ForStructWrapper<float>(90); private float? floatField_; @@ -315,6 +333,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "int64_field" field.</summary> public const int Int64FieldFieldNumber = 12; private static readonly pb::FieldCodec<long?> _single_int64Field_codec = pb::FieldCodec.ForStructWrapper<long>(98); private long? int64Field_; @@ -325,6 +344,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "uint64_field" field.</summary> public const int Uint64FieldFieldNumber = 13; private static readonly pb::FieldCodec<ulong?> _single_uint64Field_codec = pb::FieldCodec.ForStructWrapper<ulong>(106); private ulong? uint64Field_; @@ -335,6 +355,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "int32_field" field.</summary> public const int Int32FieldFieldNumber = 14; private static readonly pb::FieldCodec<int?> _single_int32Field_codec = pb::FieldCodec.ForStructWrapper<int>(114); private int? int32Field_; @@ -345,6 +366,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "uint32_field" field.</summary> public const int Uint32FieldFieldNumber = 15; private static readonly pb::FieldCodec<uint?> _single_uint32Field_codec = pb::FieldCodec.ForStructWrapper<uint>(122); private uint? uint32Field_; @@ -355,6 +377,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "bool_field" field.</summary> public const int BoolFieldFieldNumber = 16; private static readonly pb::FieldCodec<bool?> _single_boolField_codec = pb::FieldCodec.ForStructWrapper<bool>(130); private bool? boolField_; @@ -365,6 +388,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "string_field" field.</summary> public const int StringFieldFieldNumber = 17; private static readonly pb::FieldCodec<string> _single_stringField_codec = pb::FieldCodec.ForClassWrapper<string>(138); private string stringField_; @@ -375,6 +399,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "bytes_field" field.</summary> public const int BytesFieldFieldNumber = 18; private static readonly pb::FieldCodec<pb::ByteString> _single_bytesField_codec = pb::FieldCodec.ForClassWrapper<pb::ByteString>(146); private pb::ByteString bytesField_; @@ -813,6 +838,9 @@ namespace Google.Protobuf.TestProtos { } + /// <summary> + /// A repeated field for each well-known type. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class RepeatedWellKnownTypes : pb::IMessage<RepeatedWellKnownTypes> { private static readonly pb::MessageParser<RepeatedWellKnownTypes> _parser = new pb::MessageParser<RepeatedWellKnownTypes>(() => new RepeatedWellKnownTypes()); @@ -857,6 +885,7 @@ namespace Google.Protobuf.TestProtos { return new RepeatedWellKnownTypes(this); } + /// <summary>Field number for the "any_field" field.</summary> public const int AnyFieldFieldNumber = 1; private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Any> _repeated_anyField_codec = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.WellKnownTypes.Any.Parser); @@ -865,6 +894,7 @@ namespace Google.Protobuf.TestProtos { get { return anyField_; } } + /// <summary>Field number for the "api_field" field.</summary> public const int ApiFieldFieldNumber = 2; private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Api> _repeated_apiField_codec = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Api.Parser); @@ -873,6 +903,7 @@ namespace Google.Protobuf.TestProtos { get { return apiField_; } } + /// <summary>Field number for the "duration_field" field.</summary> public const int DurationFieldFieldNumber = 3; private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Duration> _repeated_durationField_codec = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.WellKnownTypes.Duration.Parser); @@ -881,6 +912,7 @@ namespace Google.Protobuf.TestProtos { get { return durationField_; } } + /// <summary>Field number for the "empty_field" field.</summary> public const int EmptyFieldFieldNumber = 4; private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Empty> _repeated_emptyField_codec = pb::FieldCodec.ForMessage(34, global::Google.Protobuf.WellKnownTypes.Empty.Parser); @@ -889,6 +921,7 @@ namespace Google.Protobuf.TestProtos { get { return emptyField_; } } + /// <summary>Field number for the "field_mask_field" field.</summary> public const int FieldMaskFieldFieldNumber = 5; private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.FieldMask> _repeated_fieldMaskField_codec = pb::FieldCodec.ForMessage(42, global::Google.Protobuf.WellKnownTypes.FieldMask.Parser); @@ -897,6 +930,7 @@ namespace Google.Protobuf.TestProtos { get { return fieldMaskField_; } } + /// <summary>Field number for the "source_context_field" field.</summary> public const int SourceContextFieldFieldNumber = 6; private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.SourceContext> _repeated_sourceContextField_codec = pb::FieldCodec.ForMessage(50, global::Google.Protobuf.WellKnownTypes.SourceContext.Parser); @@ -905,6 +939,7 @@ namespace Google.Protobuf.TestProtos { get { return sourceContextField_; } } + /// <summary>Field number for the "struct_field" field.</summary> public const int StructFieldFieldNumber = 7; private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Struct> _repeated_structField_codec = pb::FieldCodec.ForMessage(58, global::Google.Protobuf.WellKnownTypes.Struct.Parser); @@ -913,6 +948,7 @@ namespace Google.Protobuf.TestProtos { get { return structField_; } } + /// <summary>Field number for the "timestamp_field" field.</summary> public const int TimestampFieldFieldNumber = 8; private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Timestamp> _repeated_timestampField_codec = pb::FieldCodec.ForMessage(66, global::Google.Protobuf.WellKnownTypes.Timestamp.Parser); @@ -921,6 +957,7 @@ namespace Google.Protobuf.TestProtos { get { return timestampField_; } } + /// <summary>Field number for the "type_field" field.</summary> public const int TypeFieldFieldNumber = 9; private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Type> _repeated_typeField_codec = pb::FieldCodec.ForMessage(74, global::Google.Protobuf.WellKnownTypes.Type.Parser); @@ -929,14 +966,19 @@ namespace Google.Protobuf.TestProtos { get { return typeField_; } } + /// <summary>Field number for the "double_field" field.</summary> public const int DoubleFieldFieldNumber = 10; private static readonly pb::FieldCodec<double?> _repeated_doubleField_codec = pb::FieldCodec.ForStructWrapper<double>(82); private readonly pbc::RepeatedField<double?> doubleField_ = new pbc::RepeatedField<double?>(); + /// <summary> + /// These don't actually make a lot of sense, but they're not prohibited... + /// </summary> public pbc::RepeatedField<double?> DoubleField { get { return doubleField_; } } + /// <summary>Field number for the "float_field" field.</summary> public const int FloatFieldFieldNumber = 11; private static readonly pb::FieldCodec<float?> _repeated_floatField_codec = pb::FieldCodec.ForStructWrapper<float>(90); @@ -945,6 +987,7 @@ namespace Google.Protobuf.TestProtos { get { return floatField_; } } + /// <summary>Field number for the "int64_field" field.</summary> public const int Int64FieldFieldNumber = 12; private static readonly pb::FieldCodec<long?> _repeated_int64Field_codec = pb::FieldCodec.ForStructWrapper<long>(98); @@ -953,6 +996,7 @@ namespace Google.Protobuf.TestProtos { get { return int64Field_; } } + /// <summary>Field number for the "uint64_field" field.</summary> public const int Uint64FieldFieldNumber = 13; private static readonly pb::FieldCodec<ulong?> _repeated_uint64Field_codec = pb::FieldCodec.ForStructWrapper<ulong>(106); @@ -961,6 +1005,7 @@ namespace Google.Protobuf.TestProtos { get { return uint64Field_; } } + /// <summary>Field number for the "int32_field" field.</summary> public const int Int32FieldFieldNumber = 14; private static readonly pb::FieldCodec<int?> _repeated_int32Field_codec = pb::FieldCodec.ForStructWrapper<int>(114); @@ -969,6 +1014,7 @@ namespace Google.Protobuf.TestProtos { get { return int32Field_; } } + /// <summary>Field number for the "uint32_field" field.</summary> public const int Uint32FieldFieldNumber = 15; private static readonly pb::FieldCodec<uint?> _repeated_uint32Field_codec = pb::FieldCodec.ForStructWrapper<uint>(122); @@ -977,6 +1023,7 @@ namespace Google.Protobuf.TestProtos { get { return uint32Field_; } } + /// <summary>Field number for the "bool_field" field.</summary> public const int BoolFieldFieldNumber = 16; private static readonly pb::FieldCodec<bool?> _repeated_boolField_codec = pb::FieldCodec.ForStructWrapper<bool>(130); @@ -985,6 +1032,7 @@ namespace Google.Protobuf.TestProtos { get { return boolField_; } } + /// <summary>Field number for the "string_field" field.</summary> public const int StringFieldFieldNumber = 17; private static readonly pb::FieldCodec<string> _repeated_stringField_codec = pb::FieldCodec.ForClassWrapper<string>(138); @@ -993,6 +1041,7 @@ namespace Google.Protobuf.TestProtos { get { return stringField_; } } + /// <summary>Field number for the "bytes_field" field.</summary> public const int BytesFieldFieldNumber = 18; private static readonly pb::FieldCodec<pb::ByteString> _repeated_bytesField_codec = pb::FieldCodec.ForClassWrapper<pb::ByteString>(146); @@ -1296,6 +1345,7 @@ namespace Google.Protobuf.TestProtos { return new OneofWellKnownTypes(this); } + /// <summary>Field number for the "any_field" field.</summary> public const int AnyFieldFieldNumber = 1; public global::Google.Protobuf.WellKnownTypes.Any AnyField { get { return oneofFieldCase_ == OneofFieldOneofCase.AnyField ? (global::Google.Protobuf.WellKnownTypes.Any) oneofField_ : null; } @@ -1305,6 +1355,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "api_field" field.</summary> public const int ApiFieldFieldNumber = 2; public global::Google.Protobuf.WellKnownTypes.Api ApiField { get { return oneofFieldCase_ == OneofFieldOneofCase.ApiField ? (global::Google.Protobuf.WellKnownTypes.Api) oneofField_ : null; } @@ -1314,6 +1365,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "duration_field" field.</summary> public const int DurationFieldFieldNumber = 3; public global::Google.Protobuf.WellKnownTypes.Duration DurationField { get { return oneofFieldCase_ == OneofFieldOneofCase.DurationField ? (global::Google.Protobuf.WellKnownTypes.Duration) oneofField_ : null; } @@ -1323,6 +1375,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "empty_field" field.</summary> public const int EmptyFieldFieldNumber = 4; public global::Google.Protobuf.WellKnownTypes.Empty EmptyField { get { return oneofFieldCase_ == OneofFieldOneofCase.EmptyField ? (global::Google.Protobuf.WellKnownTypes.Empty) oneofField_ : null; } @@ -1332,6 +1385,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "field_mask_field" field.</summary> public const int FieldMaskFieldFieldNumber = 5; public global::Google.Protobuf.WellKnownTypes.FieldMask FieldMaskField { get { return oneofFieldCase_ == OneofFieldOneofCase.FieldMaskField ? (global::Google.Protobuf.WellKnownTypes.FieldMask) oneofField_ : null; } @@ -1341,6 +1395,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "source_context_field" field.</summary> public const int SourceContextFieldFieldNumber = 6; public global::Google.Protobuf.WellKnownTypes.SourceContext SourceContextField { get { return oneofFieldCase_ == OneofFieldOneofCase.SourceContextField ? (global::Google.Protobuf.WellKnownTypes.SourceContext) oneofField_ : null; } @@ -1350,6 +1405,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "struct_field" field.</summary> public const int StructFieldFieldNumber = 7; public global::Google.Protobuf.WellKnownTypes.Struct StructField { get { return oneofFieldCase_ == OneofFieldOneofCase.StructField ? (global::Google.Protobuf.WellKnownTypes.Struct) oneofField_ : null; } @@ -1359,6 +1415,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "timestamp_field" field.</summary> public const int TimestampFieldFieldNumber = 8; public global::Google.Protobuf.WellKnownTypes.Timestamp TimestampField { get { return oneofFieldCase_ == OneofFieldOneofCase.TimestampField ? (global::Google.Protobuf.WellKnownTypes.Timestamp) oneofField_ : null; } @@ -1368,6 +1425,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "type_field" field.</summary> public const int TypeFieldFieldNumber = 9; public global::Google.Protobuf.WellKnownTypes.Type TypeField { get { return oneofFieldCase_ == OneofFieldOneofCase.TypeField ? (global::Google.Protobuf.WellKnownTypes.Type) oneofField_ : null; } @@ -1377,6 +1435,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "double_field" field.</summary> public const int DoubleFieldFieldNumber = 10; private static readonly pb::FieldCodec<double?> _oneof_doubleField_codec = pb::FieldCodec.ForStructWrapper<double>(82); public double? DoubleField { @@ -1387,6 +1446,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "float_field" field.</summary> public const int FloatFieldFieldNumber = 11; private static readonly pb::FieldCodec<float?> _oneof_floatField_codec = pb::FieldCodec.ForStructWrapper<float>(90); public float? FloatField { @@ -1397,6 +1457,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "int64_field" field.</summary> public const int Int64FieldFieldNumber = 12; private static readonly pb::FieldCodec<long?> _oneof_int64Field_codec = pb::FieldCodec.ForStructWrapper<long>(98); public long? Int64Field { @@ -1407,6 +1468,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "uint64_field" field.</summary> public const int Uint64FieldFieldNumber = 13; private static readonly pb::FieldCodec<ulong?> _oneof_uint64Field_codec = pb::FieldCodec.ForStructWrapper<ulong>(106); public ulong? Uint64Field { @@ -1417,6 +1479,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "int32_field" field.</summary> public const int Int32FieldFieldNumber = 14; private static readonly pb::FieldCodec<int?> _oneof_int32Field_codec = pb::FieldCodec.ForStructWrapper<int>(114); public int? Int32Field { @@ -1427,6 +1490,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "uint32_field" field.</summary> public const int Uint32FieldFieldNumber = 15; private static readonly pb::FieldCodec<uint?> _oneof_uint32Field_codec = pb::FieldCodec.ForStructWrapper<uint>(122); public uint? Uint32Field { @@ -1437,6 +1501,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "bool_field" field.</summary> public const int BoolFieldFieldNumber = 16; private static readonly pb::FieldCodec<bool?> _oneof_boolField_codec = pb::FieldCodec.ForStructWrapper<bool>(130); public bool? BoolField { @@ -1447,6 +1512,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "string_field" field.</summary> public const int StringFieldFieldNumber = 17; private static readonly pb::FieldCodec<string> _oneof_stringField_codec = pb::FieldCodec.ForClassWrapper<string>(138); public string StringField { @@ -1457,6 +1523,7 @@ namespace Google.Protobuf.TestProtos { } } + /// <summary>Field number for the "bytes_field" field.</summary> public const int BytesFieldFieldNumber = 18; private static readonly pb::FieldCodec<pb::ByteString> _oneof_bytesField_codec = pb::FieldCodec.ForClassWrapper<pb::ByteString>(146); public pb::ByteString BytesField { @@ -1468,6 +1535,7 @@ namespace Google.Protobuf.TestProtos { } private object oneofField_; + /// <summary>Enum of possible cases for the "oneof_field" oneof.</summary> public enum OneofFieldOneofCase { None = 0, AnyField = 1, @@ -1876,6 +1944,11 @@ namespace Google.Protobuf.TestProtos { } + /// <summary> + /// A map field for each well-known type. We only + /// need to worry about the value part of the map being the + /// well-known types, as messages can't be map keys. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class MapWellKnownTypes : pb::IMessage<MapWellKnownTypes> { private static readonly pb::MessageParser<MapWellKnownTypes> _parser = new pb::MessageParser<MapWellKnownTypes>(() => new MapWellKnownTypes()); @@ -1920,6 +1993,7 @@ namespace Google.Protobuf.TestProtos { return new MapWellKnownTypes(this); } + /// <summary>Field number for the "any_field" field.</summary> public const int AnyFieldFieldNumber = 1; private static readonly pbc::MapField<int, global::Google.Protobuf.WellKnownTypes.Any>.Codec _map_anyField_codec = new pbc::MapField<int, global::Google.Protobuf.WellKnownTypes.Any>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Any.Parser), 10); @@ -1928,6 +2002,7 @@ namespace Google.Protobuf.TestProtos { get { return anyField_; } } + /// <summary>Field number for the "api_field" field.</summary> public const int ApiFieldFieldNumber = 2; private static readonly pbc::MapField<int, global::Google.Protobuf.WellKnownTypes.Api>.Codec _map_apiField_codec = new pbc::MapField<int, global::Google.Protobuf.WellKnownTypes.Api>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Api.Parser), 18); @@ -1936,6 +2011,7 @@ namespace Google.Protobuf.TestProtos { get { return apiField_; } } + /// <summary>Field number for the "duration_field" field.</summary> public const int DurationFieldFieldNumber = 3; private static readonly pbc::MapField<int, global::Google.Protobuf.WellKnownTypes.Duration>.Codec _map_durationField_codec = new pbc::MapField<int, global::Google.Protobuf.WellKnownTypes.Duration>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Duration.Parser), 26); @@ -1944,6 +2020,7 @@ namespace Google.Protobuf.TestProtos { get { return durationField_; } } + /// <summary>Field number for the "empty_field" field.</summary> public const int EmptyFieldFieldNumber = 4; private static readonly pbc::MapField<int, global::Google.Protobuf.WellKnownTypes.Empty>.Codec _map_emptyField_codec = new pbc::MapField<int, global::Google.Protobuf.WellKnownTypes.Empty>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Empty.Parser), 34); @@ -1952,6 +2029,7 @@ namespace Google.Protobuf.TestProtos { get { return emptyField_; } } + /// <summary>Field number for the "field_mask_field" field.</summary> public const int FieldMaskFieldFieldNumber = 5; private static readonly pbc::MapField<int, global::Google.Protobuf.WellKnownTypes.FieldMask>.Codec _map_fieldMaskField_codec = new pbc::MapField<int, global::Google.Protobuf.WellKnownTypes.FieldMask>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.FieldMask.Parser), 42); @@ -1960,6 +2038,7 @@ namespace Google.Protobuf.TestProtos { get { return fieldMaskField_; } } + /// <summary>Field number for the "source_context_field" field.</summary> public const int SourceContextFieldFieldNumber = 6; private static readonly pbc::MapField<int, global::Google.Protobuf.WellKnownTypes.SourceContext>.Codec _map_sourceContextField_codec = new pbc::MapField<int, global::Google.Protobuf.WellKnownTypes.SourceContext>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.SourceContext.Parser), 50); @@ -1968,6 +2047,7 @@ namespace Google.Protobuf.TestProtos { get { return sourceContextField_; } } + /// <summary>Field number for the "struct_field" field.</summary> public const int StructFieldFieldNumber = 7; private static readonly pbc::MapField<int, global::Google.Protobuf.WellKnownTypes.Struct>.Codec _map_structField_codec = new pbc::MapField<int, global::Google.Protobuf.WellKnownTypes.Struct>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Struct.Parser), 58); @@ -1976,6 +2056,7 @@ namespace Google.Protobuf.TestProtos { get { return structField_; } } + /// <summary>Field number for the "timestamp_field" field.</summary> public const int TimestampFieldFieldNumber = 8; private static readonly pbc::MapField<int, global::Google.Protobuf.WellKnownTypes.Timestamp>.Codec _map_timestampField_codec = new pbc::MapField<int, global::Google.Protobuf.WellKnownTypes.Timestamp>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Timestamp.Parser), 66); @@ -1984,6 +2065,7 @@ namespace Google.Protobuf.TestProtos { get { return timestampField_; } } + /// <summary>Field number for the "type_field" field.</summary> public const int TypeFieldFieldNumber = 9; private static readonly pbc::MapField<int, global::Google.Protobuf.WellKnownTypes.Type>.Codec _map_typeField_codec = new pbc::MapField<int, global::Google.Protobuf.WellKnownTypes.Type>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Type.Parser), 74); @@ -1992,6 +2074,7 @@ namespace Google.Protobuf.TestProtos { get { return typeField_; } } + /// <summary>Field number for the "double_field" field.</summary> public const int DoubleFieldFieldNumber = 10; private static readonly pbc::MapField<int, double?>.Codec _map_doubleField_codec = new pbc::MapField<int, double?>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForStructWrapper<double>(18), 82); @@ -2000,6 +2083,7 @@ namespace Google.Protobuf.TestProtos { get { return doubleField_; } } + /// <summary>Field number for the "float_field" field.</summary> public const int FloatFieldFieldNumber = 11; private static readonly pbc::MapField<int, float?>.Codec _map_floatField_codec = new pbc::MapField<int, float?>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForStructWrapper<float>(18), 90); @@ -2008,6 +2092,7 @@ namespace Google.Protobuf.TestProtos { get { return floatField_; } } + /// <summary>Field number for the "int64_field" field.</summary> public const int Int64FieldFieldNumber = 12; private static readonly pbc::MapField<int, long?>.Codec _map_int64Field_codec = new pbc::MapField<int, long?>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForStructWrapper<long>(18), 98); @@ -2016,6 +2101,7 @@ namespace Google.Protobuf.TestProtos { get { return int64Field_; } } + /// <summary>Field number for the "uint64_field" field.</summary> public const int Uint64FieldFieldNumber = 13; private static readonly pbc::MapField<int, ulong?>.Codec _map_uint64Field_codec = new pbc::MapField<int, ulong?>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForStructWrapper<ulong>(18), 106); @@ -2024,6 +2110,7 @@ namespace Google.Protobuf.TestProtos { get { return uint64Field_; } } + /// <summary>Field number for the "int32_field" field.</summary> public const int Int32FieldFieldNumber = 14; private static readonly pbc::MapField<int, int?>.Codec _map_int32Field_codec = new pbc::MapField<int, int?>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForStructWrapper<int>(18), 114); @@ -2032,6 +2119,7 @@ namespace Google.Protobuf.TestProtos { get { return int32Field_; } } + /// <summary>Field number for the "uint32_field" field.</summary> public const int Uint32FieldFieldNumber = 15; private static readonly pbc::MapField<int, uint?>.Codec _map_uint32Field_codec = new pbc::MapField<int, uint?>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForStructWrapper<uint>(18), 122); @@ -2040,6 +2128,7 @@ namespace Google.Protobuf.TestProtos { get { return uint32Field_; } } + /// <summary>Field number for the "bool_field" field.</summary> public const int BoolFieldFieldNumber = 16; private static readonly pbc::MapField<int, bool?>.Codec _map_boolField_codec = new pbc::MapField<int, bool?>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForStructWrapper<bool>(18), 130); @@ -2048,6 +2137,7 @@ namespace Google.Protobuf.TestProtos { get { return boolField_; } } + /// <summary>Field number for the "string_field" field.</summary> public const int StringFieldFieldNumber = 17; private static readonly pbc::MapField<int, string>.Codec _map_stringField_codec = new pbc::MapField<int, string>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForClassWrapper<string>(18), 138); @@ -2056,6 +2146,7 @@ namespace Google.Protobuf.TestProtos { get { return stringField_; } } + /// <summary>Field number for the "bytes_field" field.</summary> public const int BytesFieldFieldNumber = 18; private static readonly pbc::MapField<int, pb::ByteString>.Codec _map_bytesField_codec = new pbc::MapField<int, pb::ByteString>.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForClassWrapper<pb::ByteString>(18), 146); diff --git a/csharp/src/Google.Protobuf.Test/WellKnownTypes/AnyTest.cs b/csharp/src/Google.Protobuf.Test/WellKnownTypes/AnyTest.cs new file mode 100644 index 00000000..0a2b8b32 --- /dev/null +++ b/csharp/src/Google.Protobuf.Test/WellKnownTypes/AnyTest.cs @@ -0,0 +1,66 @@ +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using Google.Protobuf.TestProtos; +using NUnit.Framework; + +namespace Google.Protobuf.WellKnownTypes +{ + public class AnyTest + { + [Test] + public void Pack() + { + var message = SampleMessages.CreateFullTestAllTypes(); + var any = Any.Pack(message); + Assert.AreEqual("type.googleapis.com/protobuf_unittest.TestAllTypes", any.TypeUrl); + Assert.AreEqual(message.CalculateSize(), any.Value.Length); + } + + [Test] + public void Unpack_WrongType() + { + var message = SampleMessages.CreateFullTestAllTypes(); + var any = Any.Pack(message); + Assert.Throws<InvalidProtocolBufferException>(() => any.Unpack<TestOneof>()); + } + + [Test] + public void Unpack_Success() + { + var message = SampleMessages.CreateFullTestAllTypes(); + var any = Any.Pack(message); + var unpacked = any.Unpack<TestAllTypes>(); + Assert.AreEqual(message, unpacked); + } + } +} diff --git a/csharp/src/Google.Protobuf/CodedInputStream.cs b/csharp/src/Google.Protobuf/CodedInputStream.cs index 82c6ceab..65d0e710 100644 --- a/csharp/src/Google.Protobuf/CodedInputStream.cs +++ b/csharp/src/Google.Protobuf/CodedInputStream.cs @@ -38,7 +38,7 @@ using System.IO; namespace Google.Protobuf
{
/// <summary>
- /// Readings and decodes protocol message fields.
+ /// Reads and decodes protocol message fields.
/// </summary>
/// <remarks>
/// <para>
diff --git a/csharp/src/Google.Protobuf/Google.Protobuf.csproj b/csharp/src/Google.Protobuf/Google.Protobuf.csproj index a17bf81c..8c680d46 100644 --- a/csharp/src/Google.Protobuf/Google.Protobuf.csproj +++ b/csharp/src/Google.Protobuf/Google.Protobuf.csproj @@ -118,6 +118,7 @@ <Compile Include="Reflection\SingleFieldAccessor.cs" />
<Compile Include="Preconditions.cs" />
<Compile Include="WellKnownTypes\Any.cs" />
+ <Compile Include="WellKnownTypes\AnyPartial.cs" />
<Compile Include="WellKnownTypes\Api.cs" />
<Compile Include="WellKnownTypes\Duration.cs" />
<Compile Include="WellKnownTypes\DurationPartial.cs" />
diff --git a/csharp/src/Google.Protobuf/Reflection/DescriptorPool.cs b/csharp/src/Google.Protobuf/Reflection/DescriptorPool.cs index 759955e6..99ca4bf3 100644 --- a/csharp/src/Google.Protobuf/Reflection/DescriptorPool.cs +++ b/csharp/src/Google.Protobuf/Reflection/DescriptorPool.cs @@ -96,6 +96,8 @@ namespace Google.Protobuf.Reflection return descriptor; } + // dependencies contains direct dependencies and any *public* dependencies + // of those dependencies (transitively)... so we don't need to recurse here. foreach (FileDescriptor dependency in dependencies) { dependency.DescriptorPool.descriptorsByName.TryGetValue(fullName, out result); diff --git a/csharp/src/Google.Protobuf/Reflection/DescriptorProtoFile.cs b/csharp/src/Google.Protobuf/Reflection/DescriptorProtoFile.cs index f9158cab..1e6a77ab 100644 --- a/csharp/src/Google.Protobuf/Reflection/DescriptorProtoFile.cs +++ b/csharp/src/Google.Protobuf/Reflection/DescriptorProtoFile.cs @@ -9,10 +9,12 @@ using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; namespace Google.Protobuf.Reflection { + /// <summary>Holder for reflection information generated from google/protobuf/descriptor.proto</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] internal static partial class DescriptorProtoFile { #region Descriptor + /// <summary>File descriptor for google/protobuf/descriptor.proto</summary> public static pbr::FileDescriptor Descriptor { get { return descriptor; } } @@ -21,117 +23,117 @@ namespace Google.Protobuf.Reflection { static DescriptorProtoFile() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "CiBnb29nbGUvcHJvdG9idWYvZGVzY3JpcHRvci5wcm90bxIPZ29vZ2xlLnBy", - "b3RvYnVmIkcKEUZpbGVEZXNjcmlwdG9yU2V0EjIKBGZpbGUYASADKAsyJC5n", - "b29nbGUucHJvdG9idWYuRmlsZURlc2NyaXB0b3JQcm90byLbAwoTRmlsZURl", - "c2NyaXB0b3JQcm90bxIMCgRuYW1lGAEgASgJEg8KB3BhY2thZ2UYAiABKAkS", - "EgoKZGVwZW5kZW5jeRgDIAMoCRIZChFwdWJsaWNfZGVwZW5kZW5jeRgKIAMo", - "BRIXCg93ZWFrX2RlcGVuZGVuY3kYCyADKAUSNgoMbWVzc2FnZV90eXBlGAQg", - "AygLMiAuZ29vZ2xlLnByb3RvYnVmLkRlc2NyaXB0b3JQcm90bxI3CgllbnVt", - "X3R5cGUYBSADKAsyJC5nb29nbGUucHJvdG9idWYuRW51bURlc2NyaXB0b3JQ", - "cm90bxI4CgdzZXJ2aWNlGAYgAygLMicuZ29vZ2xlLnByb3RvYnVmLlNlcnZp", - "Y2VEZXNjcmlwdG9yUHJvdG8SOAoJZXh0ZW5zaW9uGAcgAygLMiUuZ29vZ2xl", - "LnByb3RvYnVmLkZpZWxkRGVzY3JpcHRvclByb3RvEi0KB29wdGlvbnMYCCAB", - "KAsyHC5nb29nbGUucHJvdG9idWYuRmlsZU9wdGlvbnMSOQoQc291cmNlX2Nv", - "ZGVfaW5mbxgJIAEoCzIfLmdvb2dsZS5wcm90b2J1Zi5Tb3VyY2VDb2RlSW5m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oEbGF6eRgFIAEoCDoFZmFsc2US", - "GQoKZGVwcmVjYXRlZBgDIAEoCDoFZmFsc2USEwoEd2VhaxgKIAEoCDoFZmFs", - "c2USQwoUdW5pbnRlcnByZXRlZF9vcHRpb24Y5wcgAygLMiQuZ29vZ2xlLnBy", - "b3RvYnVmLlVuaW50ZXJwcmV0ZWRPcHRpb24iLwoFQ1R5cGUSCgoGU1RSSU5H", - "EAASCAoEQ09SRBABEhAKDFNUUklOR19QSUVDRRACIjUKBkpTVHlwZRINCglK", - "U19OT1JNQUwQABINCglKU19TVFJJTkcQARINCglKU19OVU1CRVIQAioJCOgH", - "EICAgIACIo0BCgtFbnVtT3B0aW9ucxITCgthbGxvd19hbGlhcxgCIAEoCBIZ", - "CgpkZXByZWNhdGVkGAMgASgIOgVmYWxzZRJDChR1bmludGVycHJldGVkX29w", - "dGlvbhjnByADKAsyJC5nb29nbGUucHJvdG9idWYuVW5pbnRlcnByZXRlZE9w", - "dGlvbioJCOgHEICAgIACIn0KEEVudW1WYWx1ZU9wdGlvbnMSGQoKZGVwcmVj", - "YXRlZBgBIAEoCDoFZmFsc2USQwoUdW5pbnRlcnByZXRlZF9vcHRpb24Y5wcg", - "AygLMiQuZ29vZ2xlLnByb3RvYnVmLlVuaW50ZXJwcmV0ZWRPcHRpb24qCQjo", - "BxCAgICAAiJ7Cg5TZXJ2aWNlT3B0aW9ucxIZCgpkZXByZWNhdGVkGCEgASgI", - "OgVmYWxzZRJDChR1bmludGVycHJldGVkX29wdGlvbhjnByADKAsyJC5nb29n", - "bGUucHJvdG9idWYuVW5pbnRlcnByZXRlZE9wdGlvbioJCOgHEICAgIACInoK", - "DU1ldGhvZE9wdGlvbnMSGQoKZGVwcmVjYXRlZBghIAEoCDoFZmFsc2USQwoU", - "dW5pbnRlcnByZXRlZF9vcHRpb24Y5wcgAygLMiQuZ29vZ2xlLnByb3RvYnVm", - "LlVuaW50ZXJwcmV0ZWRPcHRpb24qCQjoBxCAgICAAiKeAgoTVW5p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VpFEAISEAoMTElURV9SVU5USU1FEAMqCQjoBxCAgICAAiLmAQoOTWVz", + "c2FnZU9wdGlvbnMSJgoXbWVzc2FnZV9zZXRfd2lyZV9mb3JtYXQYASABKAg6", + "BWZhbHNlEi4KH25vX3N0YW5kYXJkX2Rlc2NyaXB0b3JfYWNjZXNzb3IYAiAB", + "KAg6BWZhbHNlEhkKCmRlcHJlY2F0ZWQYAyABKAg6BWZhbHNlEhEKCW1hcF9l", + "bnRyeRgHIAEoCBJDChR1bmludGVycHJldGVkX29wdGlvbhjnByADKAsyJC5n", + "b29nbGUucHJvdG9idWYuVW5pbnRlcnByZXRlZE9wdGlvbioJCOgHEICAgIAC", + "IpgDCgxGaWVsZE9wdGlvbnMSOgoFY3R5cGUYASABKA4yIy5nb29nbGUucHJv", + "dG9idWYuRmllbGRPcHRpb25zLkNUeXBlOgZTVFJJTkcSDgoGcGFja2VkGAIg", + "ASgIEj8KBmpzdHlwZRgGIAEoDjIkLmdvb2dsZS5wcm90b2J1Zi5GaWVsZE9w", + "dGlvbnMuSlNUeXBlOglKU19OT1JNQUwSEwoEbGF6eRgFIAEoCDoFZmFsc2US", + "GQoKZGVwcmVjYXRlZBgDIAEoCDoFZmFsc2USEwoEd2VhaxgKIAEoCDoFZmFs", + "c2USQwoUdW5pbnRlcnByZXRlZF9vcHRpb24Y5wcgAygLMiQuZ29vZ2xlLnBy", + "b3RvYnVmLlVuaW50ZXJwcmV0ZWRPcHRpb24iLwoFQ1R5cGUSCgoGU1RSSU5H", + "EAASCAoEQ09SRBABEhAKDFNUUklOR19QSUVDRRACIjUKBkpTVHlwZRINCglK", + "U19OT1JNQUwQABINCglKU19TVFJJTkcQARINCglKU19OVU1CRVIQAioJCOgH", + "EICAgIACIo0BCgtFbnVtT3B0aW9ucxITCgthbGxvd19hbGlhcxgCIAEoCBIZ", + "CgpkZXByZWNhdGVkGAMgASgIOgVmYWxzZRJDChR1bmludGVycHJldGVkX29w", + "dGlvbhjnByADKAsyJC5nb29n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LlNvdXJjZUNvZGVJbmZvLkxvY2F0aW9uGoYBCghM", + "b2NhdGlvbhIQCgRwYXRoGAEgAygFQgIQARIQCgRzcGFuGAIgAygFQgIQARIY", + "ChBsZWFkaW5nX2NvbW1lbnRzGAMgASgJEhkKEXRyYWlsaW5nX2NvbW1lbnRz", + "GAQgASgJEiEKGWxlYWRpbmdfZGV0YWNoZWRfY29tbWVudHMYBiADKAlCWAoT", + "Y29tLmdvb2dsZS5wcm90b2J1ZkIQRGVzY3JpcHRvclByb3Rvc0gBWgpkZXNj", + "cmlwdG9yogIDR1BCqgIaR29vZ2xlLlByb3RvYnVmLlJlZmxlY3Rpb24=")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] { @@ -160,6 +162,10 @@ namespace Google.Protobuf.Reflection { } #region Messages + /// <summary> + /// The protocol compiler can output a FileDescriptorSet containing the .proto + /// files it parses. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] internal sealed partial class FileDescriptorSet : pb::IMessage<FileDescriptorSet> { private static readonly pb::MessageParser<FileDescriptorSet> _parser = new pb::MessageParser<FileDescriptorSet>(() => new FileDescriptorSet()); @@ -187,6 +193,7 @@ namespace Google.Protobuf.Reflection { return new FileDescriptorSet(this); } + /// <summary>Field number for the "file" field.</summary> public const int FileFieldNumber = 1; private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.FileDescriptorProto> _repeated_file_codec = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.Reflection.FileDescriptorProto.Parser); @@ -254,6 +261,9 @@ namespace Google.Protobuf.Reflection { } + /// <summary> + /// Describes a complete .proto file. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] internal sealed partial class FileDescriptorProto : pb::IMessage<FileDescriptorProto> { private static readonly pb::MessageParser<FileDescriptorProto> _parser = new pb::MessageParser<FileDescriptorProto>(() => new FileDescriptorProto()); @@ -292,8 +302,12 @@ namespace Google.Protobuf.Reflection { return new FileDescriptorProto(this); } + /// <summary>Field number for the "name" field.</summary> public const int NameFieldNumber = 1; private string name_ = ""; + /// <summary> + /// file name, relative to root of source tree + /// </summary> public string Name { get { return name_; } set { @@ -301,8 +315,12 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "package" field.</summary> public const int PackageFieldNumber = 2; private string package_ = ""; + /// <summary> + /// e.g. "foo", "foo.bar", etc. + /// </summary> public string Package { get { return package_; } set { @@ -310,38 +328,56 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "dependency" field.</summary> public const int DependencyFieldNumber = 3; private static readonly pb::FieldCodec<string> _repeated_dependency_codec = pb::FieldCodec.ForString(26); private readonly pbc::RepeatedField<string> dependency_ = new pbc::RepeatedField<string>(); + /// <summary> + /// Names of files imported by this file. + /// </summary> public pbc::RepeatedField<string> Dependency { get { return dependency_; } } + /// <summary>Field number for the "public_dependency" field.</summary> public const int PublicDependencyFieldNumber = 10; private static readonly pb::FieldCodec<int> _repeated_publicDependency_codec = pb::FieldCodec.ForInt32(80); private readonly pbc::RepeatedField<int> publicDependency_ = new pbc::RepeatedField<int>(); + /// <summary> + /// Indexes of the public imported files in the dependency list above. + /// </summary> public pbc::RepeatedField<int> PublicDependency { get { return publicDependency_; } } + /// <summary>Field number for the "weak_dependency" field.</summary> public const int WeakDependencyFieldNumber = 11; private static readonly pb::FieldCodec<int> _repeated_weakDependency_codec = pb::FieldCodec.ForInt32(88); private readonly pbc::RepeatedField<int> weakDependency_ = new pbc::RepeatedField<int>(); + /// <summary> + /// Indexes of the weak imported files in the dependency list. + /// For Google-internal migration only. Do not use. + /// </summary> public pbc::RepeatedField<int> WeakDependency { get { return weakDependency_; } } + /// <summary>Field number for the "message_type" field.</summary> public const int MessageTypeFieldNumber = 4; private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.DescriptorProto> _repeated_messageType_codec = pb::FieldCodec.ForMessage(34, global::Google.Protobuf.Reflection.DescriptorProto.Parser); private readonly pbc::RepeatedField<global::Google.Protobuf.Reflection.DescriptorProto> messageType_ = new pbc::RepeatedField<global::Google.Protobuf.Reflection.DescriptorProto>(); + /// <summary> + /// All top-level definitions in this file. + /// </summary> public pbc::RepeatedField<global::Google.Protobuf.Reflection.DescriptorProto> MessageType { get { return messageType_; } } + /// <summary>Field number for the "enum_type" field.</summary> public const int EnumTypeFieldNumber = 5; private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.EnumDescriptorProto> _repeated_enumType_codec = pb::FieldCodec.ForMessage(42, global::Google.Protobuf.Reflection.EnumDescriptorProto.Parser); @@ -350,6 +386,7 @@ namespace Google.Protobuf.Reflection { get { return enumType_; } } + /// <summary>Field number for the "service" field.</summary> public const int ServiceFieldNumber = 6; private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.ServiceDescriptorProto> _repeated_service_codec = pb::FieldCodec.ForMessage(50, global::Google.Protobuf.Reflection.ServiceDescriptorProto.Parser); @@ -358,6 +395,7 @@ namespace Google.Protobuf.Reflection { get { return service_; } } + /// <summary>Field number for the "extension" field.</summary> public const int ExtensionFieldNumber = 7; private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.FieldDescriptorProto> _repeated_extension_codec = pb::FieldCodec.ForMessage(58, global::Google.Protobuf.Reflection.FieldDescriptorProto.Parser); @@ -366,6 +404,7 @@ namespace Google.Protobuf.Reflection { get { return extension_; } } + /// <summary>Field number for the "options" field.</summary> public const int OptionsFieldNumber = 8; private global::Google.Protobuf.Reflection.FileOptions options_; public global::Google.Protobuf.Reflection.FileOptions Options { @@ -375,8 +414,15 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "source_code_info" field.</summary> public const int SourceCodeInfoFieldNumber = 9; private global::Google.Protobuf.Reflection.SourceCodeInfo sourceCodeInfo_; + /// <summary> + /// This field contains optional information about the original source code. + /// You may safely remove this entire field without harming runtime + /// functionality of the descriptors -- the information is needed only by + /// development tools. + /// </summary> public global::Google.Protobuf.Reflection.SourceCodeInfo SourceCodeInfo { get { return sourceCodeInfo_; } set { @@ -384,8 +430,13 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "syntax" field.</summary> public const int SyntaxFieldNumber = 12; private string syntax_ = ""; + /// <summary> + /// The syntax of the proto file. + /// The supported values are "proto2" and "proto3". + /// </summary> public string Syntax { get { return syntax_; } set { @@ -600,6 +651,9 @@ namespace Google.Protobuf.Reflection { } + /// <summary> + /// Describes a message type. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] internal sealed partial class DescriptorProto : pb::IMessage<DescriptorProto> { private static readonly pb::MessageParser<DescriptorProto> _parser = new pb::MessageParser<DescriptorProto>(() => new DescriptorProto()); @@ -636,6 +690,7 @@ namespace Google.Protobuf.Reflection { return new DescriptorProto(this); } + /// <summary>Field number for the "name" field.</summary> public const int NameFieldNumber = 1; private string name_ = ""; public string Name { @@ -645,6 +700,7 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "field" field.</summary> public const int FieldFieldNumber = 2; private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.FieldDescriptorProto> _repeated_field_codec = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.Reflection.FieldDescriptorProto.Parser); @@ -653,6 +709,7 @@ namespace Google.Protobuf.Reflection { get { return field_; } } + /// <summary>Field number for the "extension" field.</summary> public const int ExtensionFieldNumber = 6; private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.FieldDescriptorProto> _repeated_extension_codec = pb::FieldCodec.ForMessage(50, global::Google.Protobuf.Reflection.FieldDescriptorProto.Parser); @@ -661,6 +718,7 @@ namespace Google.Protobuf.Reflection { get { return extension_; } } + /// <summary>Field number for the "nested_type" field.</summary> public const int NestedTypeFieldNumber = 3; private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.DescriptorProto> _repeated_nestedType_codec = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.Reflection.DescriptorProto.Parser); @@ -669,6 +727,7 @@ namespace Google.Protobuf.Reflection { get { return nestedType_; } } + /// <summary>Field number for the "enum_type" field.</summary> public const int EnumTypeFieldNumber = 4; private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.EnumDescriptorProto> _repeated_enumType_codec = pb::FieldCodec.ForMessage(34, global::Google.Protobuf.Reflection.EnumDescriptorProto.Parser); @@ -677,6 +736,7 @@ namespace Google.Protobuf.Reflection { get { return enumType_; } } + /// <summary>Field number for the "extension_range" field.</summary> public const int ExtensionRangeFieldNumber = 5; private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.DescriptorProto.Types.ExtensionRange> _repeated_extensionRange_codec = pb::FieldCodec.ForMessage(42, global::Google.Protobuf.Reflection.DescriptorProto.Types.ExtensionRange.Parser); @@ -685,6 +745,7 @@ namespace Google.Protobuf.Reflection { get { return extensionRange_; } } + /// <summary>Field number for the "oneof_decl" field.</summary> public const int OneofDeclFieldNumber = 8; private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.OneofDescriptorProto> _repeated_oneofDecl_codec = pb::FieldCodec.ForMessage(66, global::Google.Protobuf.Reflection.OneofDescriptorProto.Parser); @@ -693,6 +754,7 @@ namespace Google.Protobuf.Reflection { get { return oneofDecl_; } } + /// <summary>Field number for the "options" field.</summary> public const int OptionsFieldNumber = 7; private global::Google.Protobuf.Reflection.MessageOptions options_; public global::Google.Protobuf.Reflection.MessageOptions Options { @@ -702,6 +764,7 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "reserved_range" field.</summary> public const int ReservedRangeFieldNumber = 9; private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.DescriptorProto.Types.ReservedRange> _repeated_reservedRange_codec = pb::FieldCodec.ForMessage(74, global::Google.Protobuf.Reflection.DescriptorProto.Types.ReservedRange.Parser); @@ -710,10 +773,15 @@ namespace Google.Protobuf.Reflection { get { return reservedRange_; } } + /// <summary>Field number for the "reserved_name" field.</summary> public const int ReservedNameFieldNumber = 10; private static readonly pb::FieldCodec<string> _repeated_reservedName_codec = pb::FieldCodec.ForString(82); private readonly pbc::RepeatedField<string> reservedName_ = new pbc::RepeatedField<string>(); + /// <summary> + /// Reserved field names, which may not be used by fields in the same message. + /// A given name may only be reserved once. + /// </summary> public pbc::RepeatedField<string> ReservedName { get { return reservedName_; } } @@ -877,6 +945,7 @@ namespace Google.Protobuf.Reflection { } #region Nested types + /// <summary>Container for nested types declared in the DescriptorProto message type.</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Types { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -907,6 +976,7 @@ namespace Google.Protobuf.Reflection { return new ExtensionRange(this); } + /// <summary>Field number for the "start" field.</summary> public const int StartFieldNumber = 1; private int start_; public int Start { @@ -916,6 +986,7 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "end" field.</summary> public const int EndFieldNumber = 2; private int end_; public int End { @@ -1007,6 +1078,11 @@ namespace Google.Protobuf.Reflection { } + /// <summary> + /// Range of reserved tag numbers. Reserved tag numbers may not be used by + /// fields or extension ranges in the same message. Reserved ranges may + /// not overlap. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] internal sealed partial class ReservedRange : pb::IMessage<ReservedRange> { private static readonly pb::MessageParser<ReservedRange> _parser = new pb::MessageParser<ReservedRange>(() => new ReservedRange()); @@ -1035,8 +1111,12 @@ namespace Google.Protobuf.Reflection { return new ReservedRange(this); } + /// <summary>Field number for the "start" field.</summary> public const int StartFieldNumber = 1; private int start_; + /// <summary> + /// Inclusive. + /// </summary> public int Start { get { return start_; } set { @@ -1044,8 +1124,12 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "end" field.</summary> public const int EndFieldNumber = 2; private int end_; + /// <summary> + /// Exclusive. + /// </summary> public int End { get { return end_; } set { @@ -1140,6 +1224,9 @@ namespace Google.Protobuf.Reflection { } + /// <summary> + /// Describes a field within a message. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] internal sealed partial class FieldDescriptorProto : pb::IMessage<FieldDescriptorProto> { private static readonly pb::MessageParser<FieldDescriptorProto> _parser = new pb::MessageParser<FieldDescriptorProto>(() => new FieldDescriptorProto()); @@ -1175,6 +1262,7 @@ namespace Google.Protobuf.Reflection { return new FieldDescriptorProto(this); } + /// <summary>Field number for the "name" field.</summary> public const int NameFieldNumber = 1; private string name_ = ""; public string Name { @@ -1184,6 +1272,7 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "number" field.</summary> public const int NumberFieldNumber = 3; private int number_; public int Number { @@ -1193,6 +1282,7 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "label" field.</summary> public const int LabelFieldNumber = 4; private global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Label label_ = global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Label.LABEL_OPTIONAL; public global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Label Label { @@ -1202,8 +1292,13 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "type" field.</summary> public const int TypeFieldNumber = 5; private global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Type type_ = global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Type.TYPE_DOUBLE; + /// <summary> + /// If type_name is set, this need not be set. If both this and type_name + /// are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + /// </summary> public global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Type Type { get { return type_; } set { @@ -1211,8 +1306,16 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "type_name" field.</summary> public const int TypeNameFieldNumber = 6; private string typeName_ = ""; + /// <summary> + /// For message and enum types, this is the name of the type. If the name + /// starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + /// rules are used to find the type (i.e. first the nested types within this + /// message are searched, then within the parent, on up to the root + /// namespace). + /// </summary> public string TypeName { get { return typeName_; } set { @@ -1220,8 +1323,13 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "extendee" field.</summary> public const int ExtendeeFieldNumber = 2; private string extendee_ = ""; + /// <summary> + /// For extensions, this is the name of the type being extended. It is + /// resolved in the same manner as type_name. + /// </summary> public string Extendee { get { return extendee_; } set { @@ -1229,8 +1337,16 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "default_value" field.</summary> public const int DefaultValueFieldNumber = 7; private string defaultValue_ = ""; + /// <summary> + /// For numeric types, contains the original text representation of the value. + /// For booleans, "true" or "false". + /// For strings, contains the default text contents (not escaped in any way). + /// For bytes, contains the C escaped value. All bytes >= 128 are escaped. + /// TODO(kenton): Base-64 encode? + /// </summary> public string DefaultValue { get { return defaultValue_; } set { @@ -1238,8 +1354,13 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "oneof_index" field.</summary> public const int OneofIndexFieldNumber = 9; private int oneofIndex_; + /// <summary> + /// If set, gives the index of a oneof in the containing type's oneof_decl + /// list. This field is a member of that oneof. + /// </summary> public int OneofIndex { get { return oneofIndex_; } set { @@ -1247,6 +1368,7 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "options" field.</summary> public const int OptionsFieldNumber = 8; private global::Google.Protobuf.Reflection.FieldOptions options_; public global::Google.Protobuf.Reflection.FieldOptions Options { @@ -1455,32 +1577,66 @@ namespace Google.Protobuf.Reflection { } #region Nested types + /// <summary>Container for nested types declared in the FieldDescriptorProto message type.</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Types { internal enum Type { + /// <summary> + /// 0 is reserved for errors. + /// Order is weird for historical reasons. + /// </summary> TYPE_DOUBLE = 1, TYPE_FLOAT = 2, + /// <summary> + /// Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + /// negative values are likely. + /// </summary> TYPE_INT64 = 3, TYPE_UINT64 = 4, + /// <summary> + /// Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + /// negative values are likely. + /// </summary> TYPE_INT32 = 5, TYPE_FIXED64 = 6, TYPE_FIXED32 = 7, TYPE_BOOL = 8, TYPE_STRING = 9, + /// <summary> + /// Tag-delimited aggregate. + /// </summary> TYPE_GROUP = 10, + /// <summary> + /// Length-delimited aggregate. + /// </summary> TYPE_MESSAGE = 11, + /// <summary> + /// New in version 2. + /// </summary> TYPE_BYTES = 12, TYPE_UINT32 = 13, TYPE_ENUM = 14, TYPE_SFIXED32 = 15, TYPE_SFIXED64 = 16, + /// <summary> + /// Uses ZigZag encoding. + /// </summary> TYPE_SINT32 = 17, + /// <summary> + /// Uses ZigZag encoding. + /// </summary> TYPE_SINT64 = 18, } internal enum Label { + /// <summary> + /// 0 is reserved for errors + /// </summary> LABEL_OPTIONAL = 1, LABEL_REQUIRED = 2, + /// <summary> + /// TODO(sanjay): Should we add LABEL_MAP? + /// </summary> LABEL_REPEATED = 3, } @@ -1489,6 +1645,9 @@ namespace Google.Protobuf.Reflection { } + /// <summary> + /// Describes a oneof. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] internal sealed partial class OneofDescriptorProto : pb::IMessage<OneofDescriptorProto> { private static readonly pb::MessageParser<OneofDescriptorProto> _parser = new pb::MessageParser<OneofDescriptorProto>(() => new OneofDescriptorProto()); @@ -1516,6 +1675,7 @@ namespace Google.Protobuf.Reflection { return new OneofDescriptorProto(this); } + /// <summary>Field number for the "name" field.</summary> public const int NameFieldNumber = 1; private string name_ = ""; public string Name { @@ -1591,6 +1751,9 @@ namespace Google.Protobuf.Reflection { } + /// <summary> + /// Describes an enum type. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] internal sealed partial class EnumDescriptorProto : pb::IMessage<EnumDescriptorProto> { private static readonly pb::MessageParser<EnumDescriptorProto> _parser = new pb::MessageParser<EnumDescriptorProto>(() => new EnumDescriptorProto()); @@ -1620,6 +1783,7 @@ namespace Google.Protobuf.Reflection { return new EnumDescriptorProto(this); } + /// <summary>Field number for the "name" field.</summary> public const int NameFieldNumber = 1; private string name_ = ""; public string Name { @@ -1629,6 +1793,7 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "value" field.</summary> public const int ValueFieldNumber = 2; private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.EnumValueDescriptorProto> _repeated_value_codec = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.Reflection.EnumValueDescriptorProto.Parser); @@ -1637,6 +1802,7 @@ namespace Google.Protobuf.Reflection { get { return value_; } } + /// <summary>Field number for the "options" field.</summary> public const int OptionsFieldNumber = 3; private global::Google.Protobuf.Reflection.EnumOptions options_; public global::Google.Protobuf.Reflection.EnumOptions Options { @@ -1743,6 +1909,9 @@ namespace Google.Protobuf.Reflection { } + /// <summary> + /// Describes a value within an enum. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] internal sealed partial class EnumValueDescriptorProto : pb::IMessage<EnumValueDescriptorProto> { private static readonly pb::MessageParser<EnumValueDescriptorProto> _parser = new pb::MessageParser<EnumValueDescriptorProto>(() => new EnumValueDescriptorProto()); @@ -1772,6 +1941,7 @@ namespace Google.Protobuf.Reflection { return new EnumValueDescriptorProto(this); } + /// <summary>Field number for the "name" field.</summary> public const int NameFieldNumber = 1; private string name_ = ""; public string Name { @@ -1781,6 +1951,7 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "number" field.</summary> public const int NumberFieldNumber = 2; private int number_; public int Number { @@ -1790,6 +1961,7 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "options" field.</summary> public const int OptionsFieldNumber = 3; private global::Google.Protobuf.Reflection.EnumValueOptions options_; public global::Google.Protobuf.Reflection.EnumValueOptions Options { @@ -1903,6 +2075,9 @@ namespace Google.Protobuf.Reflection { } + /// <summary> + /// Describes a service. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] internal sealed partial class ServiceDescriptorProto : pb::IMessage<ServiceDescriptorProto> { private static readonly pb::MessageParser<ServiceDescriptorProto> _parser = new pb::MessageParser<ServiceDescriptorProto>(() => new ServiceDescriptorProto()); @@ -1932,6 +2107,7 @@ namespace Google.Protobuf.Reflection { return new ServiceDescriptorProto(this); } + /// <summary>Field number for the "name" field.</summary> public const int NameFieldNumber = 1; private string name_ = ""; public string Name { @@ -1941,6 +2117,7 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "method" field.</summary> public const int MethodFieldNumber = 2; private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.MethodDescriptorProto> _repeated_method_codec = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.Reflection.MethodDescriptorProto.Parser); @@ -1949,6 +2126,7 @@ namespace Google.Protobuf.Reflection { get { return method_; } } + /// <summary>Field number for the "options" field.</summary> public const int OptionsFieldNumber = 3; private global::Google.Protobuf.Reflection.ServiceOptions options_; public global::Google.Protobuf.Reflection.ServiceOptions Options { @@ -2055,6 +2233,9 @@ namespace Google.Protobuf.Reflection { } + /// <summary> + /// Describes a method of a service. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] internal sealed partial class MethodDescriptorProto : pb::IMessage<MethodDescriptorProto> { private static readonly pb::MessageParser<MethodDescriptorProto> _parser = new pb::MessageParser<MethodDescriptorProto>(() => new MethodDescriptorProto()); @@ -2087,6 +2268,7 @@ namespace Google.Protobuf.Reflection { return new MethodDescriptorProto(this); } + /// <summary>Field number for the "name" field.</summary> public const int NameFieldNumber = 1; private string name_ = ""; public string Name { @@ -2096,8 +2278,13 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "input_type" field.</summary> public const int InputTypeFieldNumber = 2; private string inputType_ = ""; + /// <summary> + /// Input and output type names. These are resolved in the same way as + /// FieldDescriptorProto.type_name, but must refer to a message type. + /// </summary> public string InputType { get { return inputType_; } set { @@ -2105,6 +2292,7 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "output_type" field.</summary> public const int OutputTypeFieldNumber = 3; private string outputType_ = ""; public string OutputType { @@ -2114,6 +2302,7 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "options" field.</summary> public const int OptionsFieldNumber = 4; private global::Google.Protobuf.Reflection.MethodOptions options_; public global::Google.Protobuf.Reflection.MethodOptions Options { @@ -2123,8 +2312,12 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "client_streaming" field.</summary> public const int ClientStreamingFieldNumber = 5; private bool clientStreaming_; + /// <summary> + /// Identifies if client streams multiple client messages + /// </summary> public bool ClientStreaming { get { return clientStreaming_; } set { @@ -2132,8 +2325,12 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "server_streaming" field.</summary> public const int ServerStreamingFieldNumber = 6; private bool serverStreaming_; + /// <summary> + /// Identifies if server streams multiple server messages + /// </summary> public bool ServerStreaming { get { return serverStreaming_; } set { @@ -2335,8 +2532,15 @@ namespace Google.Protobuf.Reflection { return new FileOptions(this); } + /// <summary>Field number for the "java_package" field.</summary> public const int JavaPackageFieldNumber = 1; private string javaPackage_ = ""; + /// <summary> + /// Sets the Java package where classes generated from this .proto will be + /// placed. By default, the proto package is used, but this is often + /// inappropriate because proto packages do not normally start with backwards + /// domain names. + /// </summary> public string JavaPackage { get { return javaPackage_; } set { @@ -2344,8 +2548,16 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "java_outer_classname" field.</summary> public const int JavaOuterClassnameFieldNumber = 8; private string javaOuterClassname_ = ""; + /// <summary> + /// If set, all the classes from the .proto file are wrapped in a single + /// outer class with the given name. This applies to both Proto1 + /// (equivalent to the old "--one_java_file" option) and Proto2 (where + /// a .proto always translates to a single class, but you may want to + /// explicitly choose the class name). + /// </summary> public string JavaOuterClassname { get { return javaOuterClassname_; } set { @@ -2353,8 +2565,17 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "java_multiple_files" field.</summary> public const int JavaMultipleFilesFieldNumber = 10; private bool javaMultipleFiles_; + /// <summary> + /// If set true, then the Java code generator will generate a separate .java + /// file for each top-level message, enum, and service defined in the .proto + /// file. Thus, these types will *not* be nested inside the outer class + /// named by java_outer_classname. However, the outer class will still be + /// generated to contain the file's getDescriptor() method as well as any + /// top-level extensions defined in the file. + /// </summary> public bool JavaMultipleFiles { get { return javaMultipleFiles_; } set { @@ -2362,8 +2583,23 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "java_generate_equals_and_hash" field.</summary> public const int JavaGenerateEqualsAndHashFieldNumber = 20; private bool javaGenerateEqualsAndHash_; + /// <summary> + /// If set true, then the Java code generator will generate equals() and + /// hashCode() methods for all messages defined in the .proto file. + /// This increases generated code size, potentially substantially for large + /// protos, which may harm a memory-constrained application. + /// - In the full runtime this is a speed optimization, as the + /// AbstractMessage base class includes reflection-based implementations of + /// these methods. + /// - In the lite runtime, setting this option changes the semantics of + /// equals() and hashCode() to more closely match those of the full runtime; + /// the generated methods compute their results based on field values rather + /// than object identity. (Implementations should not assume that hashcodes + /// will be consistent across runtimes or versions of the protocol compiler.) + /// </summary> public bool JavaGenerateEqualsAndHash { get { return javaGenerateEqualsAndHash_; } set { @@ -2371,8 +2607,17 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "java_string_check_utf8" field.</summary> public const int JavaStringCheckUtf8FieldNumber = 27; private bool javaStringCheckUtf8_; + /// <summary> + /// If set true, then the Java2 code generator will generate code that + /// throws an exception whenever an attempt is made to assign a non-UTF-8 + /// byte sequence to a string field. + /// Message reflection will do the same. + /// However, an extension field still accepts non-UTF-8 byte sequences. + /// This option has no effect on when used with the lite runtime. + /// </summary> public bool JavaStringCheckUtf8 { get { return javaStringCheckUtf8_; } set { @@ -2380,6 +2625,7 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "optimize_for" field.</summary> public const int OptimizeForFieldNumber = 9; private global::Google.Protobuf.Reflection.FileOptions.Types.OptimizeMode optimizeFor_ = global::Google.Protobuf.Reflection.FileOptions.Types.OptimizeMode.SPEED; public global::Google.Protobuf.Reflection.FileOptions.Types.OptimizeMode OptimizeFor { @@ -2389,8 +2635,16 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "go_package" field.</summary> public const int GoPackageFieldNumber = 11; private string goPackage_ = ""; + /// <summary> + /// Sets the Go package where structs generated from this .proto will be + /// placed. If omitted, the Go package will be derived from the following: + /// - The basename of the package import path, if provided. + /// - Otherwise, the package statement in the .proto file, if present. + /// - Otherwise, the basename of the .proto file, without extension. + /// </summary> public string GoPackage { get { return goPackage_; } set { @@ -2398,8 +2652,20 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "cc_generic_services" field.</summary> public const int CcGenericServicesFieldNumber = 16; private bool ccGenericServices_; + /// <summary> + /// Should generic services be generated in each language? "Generic" services + /// are not specific to any particular RPC system. They are generated by the + /// main code generators in each language (without additional plugins). + /// Generic services were the only kind of service generation supported by + /// early versions of google.protobuf. + /// Generic services are now considered deprecated in favor of using plugins + /// that generate code specific to your particular RPC system. Therefore, + /// these default to false. Old code which depends on generic services should + /// explicitly set them to true. + /// </summary> public bool CcGenericServices { get { return ccGenericServices_; } set { @@ -2407,6 +2673,7 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "java_generic_services" field.</summary> public const int JavaGenericServicesFieldNumber = 17; private bool javaGenericServices_; public bool JavaGenericServices { @@ -2416,6 +2683,7 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "py_generic_services" field.</summary> public const int PyGenericServicesFieldNumber = 18; private bool pyGenericServices_; public bool PyGenericServices { @@ -2425,8 +2693,15 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "deprecated" field.</summary> public const int DeprecatedFieldNumber = 23; private bool deprecated_; + /// <summary> + /// Is this file deprecated? + /// Depending on the target platform, this can emit Deprecated annotations + /// for everything in the file, or it will be completely ignored; in the very + /// least, this is a formalization for deprecating files. + /// </summary> public bool Deprecated { get { return deprecated_; } set { @@ -2434,8 +2709,13 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "cc_enable_arenas" field.</summary> public const int CcEnableArenasFieldNumber = 31; private bool ccEnableArenas_; + /// <summary> + /// Enables the use of arenas for the proto messages in this file. This applies + /// only to generated classes for C++. + /// </summary> public bool CcEnableArenas { get { return ccEnableArenas_; } set { @@ -2443,8 +2723,13 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "objc_class_prefix" field.</summary> public const int ObjcClassPrefixFieldNumber = 36; private string objcClassPrefix_ = ""; + /// <summary> + /// Sets the objective c class prefix which is prepended to all objective c + /// generated classes from this .proto. There is no default. + /// </summary> public string ObjcClassPrefix { get { return objcClassPrefix_; } set { @@ -2452,8 +2737,12 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "csharp_namespace" field.</summary> public const int CsharpNamespaceFieldNumber = 37; private string csharpNamespace_ = ""; + /// <summary> + /// Namespace for generated classes; defaults to the package. + /// </summary> public string CsharpNamespace { get { return csharpNamespace_; } set { @@ -2461,8 +2750,13 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "javanano_use_deprecated_package" field.</summary> public const int JavananoUseDeprecatedPackageFieldNumber = 38; private bool javananoUseDeprecatedPackage_; + /// <summary> + /// Whether the nano proto compiler should generate in the deprecated non-nano + /// suffixed package. + /// </summary> public bool JavananoUseDeprecatedPackage { get { return javananoUseDeprecatedPackage_; } set { @@ -2470,10 +2764,14 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "uninterpreted_option" field.</summary> public const int UninterpretedOptionFieldNumber = 999; private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.UninterpretedOption> _repeated_uninterpretedOption_codec = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.Reflection.UninterpretedOption.Parser); private readonly pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption> uninterpretedOption_ = new pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption>(); + /// <summary> + /// The parser stores options it doesn't recognize here. See above. + /// </summary> public pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption> UninterpretedOption { get { return uninterpretedOption_; } } @@ -2776,11 +3074,24 @@ namespace Google.Protobuf.Reflection { } #region Nested types + /// <summary>Container for nested types declared in the FileOptions message type.</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Types { + /// <summary> + /// Generated classes can be optimized for speed or code size. + /// </summary> internal enum OptimizeMode { + /// <summary> + /// Generate complete code for parsing, serialization, + /// </summary> SPEED = 1, + /// <summary> + /// etc. + /// </summary> CODE_SIZE = 2, + /// <summary> + /// Generate code using MessageLite and the lite runtime. + /// </summary> LITE_RUNTIME = 3, } @@ -2820,8 +3131,26 @@ namespace Google.Protobuf.Reflection { return new MessageOptions(this); } + /// <summary>Field number for the "message_set_wire_format" field.</summary> public const int MessageSetWireFormatFieldNumber = 1; private bool messageSetWireFormat_; + /// <summary> + /// Set true to use the old proto1 MessageSet wire format for extensions. + /// This is provided for backwards-compatibility with the MessageSet wire + /// format. You should not use this for any other reason: It's less + /// efficient, has fewer features, and is more complicated. + /// The message must be defined exactly as follows: + /// message Foo { + /// option message_set_wire_format = true; + /// extensions 4 to max; + /// } + /// Note that the message cannot have any defined fields; MessageSets only + /// have extensions. + /// All extensions of your type must be singular messages; e.g. they cannot + /// be int32s, enums, or repeated messages. + /// Because this is an option, the above two restrictions are not enforced by + /// the protocol compiler. + /// </summary> public bool MessageSetWireFormat { get { return messageSetWireFormat_; } set { @@ -2829,8 +3158,14 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "no_standard_descriptor_accessor" field.</summary> public const int NoStandardDescriptorAccessorFieldNumber = 2; private bool noStandardDescriptorAccessor_; + /// <summary> + /// Disables the generation of the standard "descriptor()" accessor, which can + /// conflict with a field of the same name. This is meant to make migration + /// from proto1 easier; new code should avoid fields named "descriptor". + /// </summary> public bool NoStandardDescriptorAccessor { get { return noStandardDescriptorAccessor_; } set { @@ -2838,8 +3173,15 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "deprecated" field.</summary> public const int DeprecatedFieldNumber = 3; private bool deprecated_; + /// <summary> + /// Is this message deprecated? + /// Depending on the target platform, this can emit Deprecated annotations + /// for the message, or it will be completely ignored; in the very least, + /// this is a formalization for deprecating messages. + /// </summary> public bool Deprecated { get { return deprecated_; } set { @@ -2847,8 +3189,29 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "map_entry" field.</summary> public const int MapEntryFieldNumber = 7; private bool mapEntry_; + /// <summary> + /// Whether the message is an automatically generated map entry type for the + /// maps field. + /// For maps fields: + /// map<KeyType, ValueType> map_field = 1; + /// The parsed descriptor looks like: + /// message MapFieldEntry { + /// option map_entry = true; + /// optional KeyType key = 1; + /// optional ValueType value = 2; + /// } + /// repeated MapFieldEntry map_field = 1; + /// Implementations may choose not to generate the map_entry=true message, but + /// use a native map in the target language to hold the keys and values. + /// The reflection APIs in such implementions still need to work as + /// if the field is a repeated message field. + /// NOTE: Do not set the option in .proto files. Always use the maps syntax + /// instead. The option should only be implicitly set by the proto compiler + /// parser. + /// </summary> public bool MapEntry { get { return mapEntry_; } set { @@ -2856,10 +3219,14 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "uninterpreted_option" field.</summary> public const int UninterpretedOptionFieldNumber = 999; private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.UninterpretedOption> _repeated_uninterpretedOption_codec = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.Reflection.UninterpretedOption.Parser); private readonly pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption> uninterpretedOption_ = new pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption>(); + /// <summary> + /// The parser stores options it doesn't recognize here. See above. + /// </summary> public pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption> UninterpretedOption { get { return uninterpretedOption_; } } @@ -3020,8 +3387,15 @@ namespace Google.Protobuf.Reflection { return new FieldOptions(this); } + /// <summary>Field number for the "ctype" field.</summary> public const int CtypeFieldNumber = 1; private global::Google.Protobuf.Reflection.FieldOptions.Types.CType ctype_ = global::Google.Protobuf.Reflection.FieldOptions.Types.CType.STRING; + /// <summary> + /// The ctype option instructs the C++ code generator to use a different + /// representation of the field than it normally would. See the specific + /// options below. This option is not yet implemented in the open source + /// release -- sorry, we'll try to include it in a future version! + /// </summary> public global::Google.Protobuf.Reflection.FieldOptions.Types.CType Ctype { get { return ctype_; } set { @@ -3029,8 +3403,16 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "packed" field.</summary> public const int PackedFieldNumber = 2; private bool packed_; + /// <summary> + /// The packed option can be enabled for repeated primitive fields to enable + /// a more efficient representation on the wire. Rather than repeatedly + /// writing the tag and type for each element, the entire array is encoded as + /// a single length-delimited blob. In proto3, only explicit setting it to + /// false will avoid using packed encoding. + /// </summary> public bool Packed { get { return packed_; } set { @@ -3038,8 +3420,20 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "jstype" field.</summary> public const int JstypeFieldNumber = 6; private global::Google.Protobuf.Reflection.FieldOptions.Types.JSType jstype_ = global::Google.Protobuf.Reflection.FieldOptions.Types.JSType.JS_NORMAL; + /// <summary> + /// The jstype option determines the JavaScript type used for values of the + /// field. The option is permitted only for 64 bit integral and fixed types + /// (int64, uint64, sint64, fixed64, sfixed64). By default these types are + /// represented as JavaScript strings. This avoids loss of precision that can + /// happen when a large value is converted to a floating point JavaScript + /// numbers. Specifying JS_NUMBER for the jstype causes the generated + /// JavaScript code to use the JavaScript "number" type instead of strings. + /// This option is an enum to permit additional types to be added, + /// e.g. goog.math.Integer. + /// </summary> public global::Google.Protobuf.Reflection.FieldOptions.Types.JSType Jstype { get { return jstype_; } set { @@ -3047,8 +3441,35 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "lazy" field.</summary> public const int LazyFieldNumber = 5; private bool lazy_; + /// <summary> + /// Should this field be parsed lazily? Lazy applies only to message-type + /// fields. It means that when the outer message is initially parsed, the + /// inner message's contents will not be parsed but instead stored in encoded + /// form. The inner message will actually be parsed when it is first accessed. + /// This is only a hint. Implementations are free to choose whether to use + /// eager or lazy parsing regardless of the value of this option. However, + /// setting this option true suggests that the protocol author believes that + /// using lazy parsing on this field is worth the additional bookkeeping + /// overhead typically needed to implement it. + /// This option does not affect the public interface of any generated code; + /// all method signatures remain the same. Furthermore, thread-safety of the + /// interface is not affected by this option; const methods remain safe to + /// call from multiple threads concurrently, while non-const methods continue + /// to require exclusive access. + /// Note that implementations may choose not to check required fields within + /// a lazy sub-message. That is, calling IsInitialized() on the outher message + /// may return true even if the inner message has missing required fields. + /// This is necessary because otherwise the inner message would have to be + /// parsed in order to perform the check, defeating the purpose of lazy + /// parsing. An implementation which chooses not to check required fields + /// must be consistent about it. That is, for any particular sub-message, the + /// implementation must either *always* check its required fields, or *never* + /// check its required fields, regardless of whether or not the message has + /// been parsed. + /// </summary> public bool Lazy { get { return lazy_; } set { @@ -3056,8 +3477,15 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "deprecated" field.</summary> public const int DeprecatedFieldNumber = 3; private bool deprecated_; + /// <summary> + /// Is this field deprecated? + /// Depending on the target platform, this can emit Deprecated annotations + /// for accessors, or it will be completely ignored; in the very least, this + /// is a formalization for deprecating fields. + /// </summary> public bool Deprecated { get { return deprecated_; } set { @@ -3065,8 +3493,12 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "weak" field.</summary> public const int WeakFieldNumber = 10; private bool weak_; + /// <summary> + /// For Google-internal migration only. Do not use. + /// </summary> public bool Weak { get { return weak_; } set { @@ -3074,10 +3506,14 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "uninterpreted_option" field.</summary> public const int UninterpretedOptionFieldNumber = 999; private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.UninterpretedOption> _repeated_uninterpretedOption_codec = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.Reflection.UninterpretedOption.Parser); private readonly pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption> uninterpretedOption_ = new pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption>(); + /// <summary> + /// The parser stores options it doesn't recognize here. See above. + /// </summary> public pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption> UninterpretedOption { get { return uninterpretedOption_; } } @@ -3236,17 +3672,30 @@ namespace Google.Protobuf.Reflection { } #region Nested types + /// <summary>Container for nested types declared in the FieldOptions message type.</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Types { internal enum CType { + /// <summary> + /// Default mode. + /// </summary> STRING = 0, CORD = 1, STRING_PIECE = 2, } internal enum JSType { + /// <summary> + /// Use the default type. + /// </summary> JS_NORMAL = 0, + /// <summary> + /// Use JavaScript strings. + /// </summary> JS_STRING = 1, + /// <summary> + /// Use JavaScript numbers. + /// </summary> JS_NUMBER = 2, } @@ -3284,8 +3733,13 @@ namespace Google.Protobuf.Reflection { return new EnumOptions(this); } + /// <summary>Field number for the "allow_alias" field.</summary> public const int AllowAliasFieldNumber = 2; private bool allowAlias_; + /// <summary> + /// Set this option to true to allow mapping different tag names to the same + /// value. + /// </summary> public bool AllowAlias { get { return allowAlias_; } set { @@ -3293,8 +3747,15 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "deprecated" field.</summary> public const int DeprecatedFieldNumber = 3; private bool deprecated_; + /// <summary> + /// Is this enum deprecated? + /// Depending on the target platform, this can emit Deprecated annotations + /// for the enum, or it will be completely ignored; in the very least, this + /// is a formalization for deprecating enums. + /// </summary> public bool Deprecated { get { return deprecated_; } set { @@ -3302,10 +3763,14 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "uninterpreted_option" field.</summary> public const int UninterpretedOptionFieldNumber = 999; private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.UninterpretedOption> _repeated_uninterpretedOption_codec = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.Reflection.UninterpretedOption.Parser); private readonly pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption> uninterpretedOption_ = new pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption>(); + /// <summary> + /// The parser stores options it doesn't recognize here. See above. + /// </summary> public pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption> UninterpretedOption { get { return uninterpretedOption_; } } @@ -3429,8 +3894,15 @@ namespace Google.Protobuf.Reflection { return new EnumValueOptions(this); } + /// <summary>Field number for the "deprecated" field.</summary> public const int DeprecatedFieldNumber = 1; private bool deprecated_; + /// <summary> + /// Is this enum value deprecated? + /// Depending on the target platform, this can emit Deprecated annotations + /// for the enum value, or it will be completely ignored; in the very least, + /// this is a formalization for deprecating enum values. + /// </summary> public bool Deprecated { get { return deprecated_; } set { @@ -3438,10 +3910,14 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "uninterpreted_option" field.</summary> public const int UninterpretedOptionFieldNumber = 999; private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.UninterpretedOption> _repeated_uninterpretedOption_codec = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.Reflection.UninterpretedOption.Parser); private readonly pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption> uninterpretedOption_ = new pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption>(); + /// <summary> + /// The parser stores options it doesn't recognize here. See above. + /// </summary> public pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption> UninterpretedOption { get { return uninterpretedOption_; } } @@ -3549,8 +4025,15 @@ namespace Google.Protobuf.Reflection { return new ServiceOptions(this); } + /// <summary>Field number for the "deprecated" field.</summary> public const int DeprecatedFieldNumber = 33; private bool deprecated_; + /// <summary> + /// Is this service deprecated? + /// Depending on the target platform, this can emit Deprecated annotations + /// for the service, or it will be completely ignored; in the very least, + /// this is a formalization for deprecating services. + /// </summary> public bool Deprecated { get { return deprecated_; } set { @@ -3558,10 +4041,14 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "uninterpreted_option" field.</summary> public const int UninterpretedOptionFieldNumber = 999; private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.UninterpretedOption> _repeated_uninterpretedOption_codec = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.Reflection.UninterpretedOption.Parser); private readonly pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption> uninterpretedOption_ = new pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption>(); + /// <summary> + /// The parser stores options it doesn't recognize here. See above. + /// </summary> public pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption> UninterpretedOption { get { return uninterpretedOption_; } } @@ -3669,8 +4156,15 @@ namespace Google.Protobuf.Reflection { return new MethodOptions(this); } + /// <summary>Field number for the "deprecated" field.</summary> public const int DeprecatedFieldNumber = 33; private bool deprecated_; + /// <summary> + /// Is this method deprecated? + /// Depending on the target platform, this can emit Deprecated annotations + /// for the method, or it will be completely ignored; in the very least, + /// this is a formalization for deprecating methods. + /// </summary> public bool Deprecated { get { return deprecated_; } set { @@ -3678,10 +4172,14 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "uninterpreted_option" field.</summary> public const int UninterpretedOptionFieldNumber = 999; private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.UninterpretedOption> _repeated_uninterpretedOption_codec = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.Reflection.UninterpretedOption.Parser); private readonly pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption> uninterpretedOption_ = new pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption>(); + /// <summary> + /// The parser stores options it doesn't recognize here. See above. + /// </summary> public pbc::RepeatedField<global::Google.Protobuf.Reflection.UninterpretedOption> UninterpretedOption { get { return uninterpretedOption_; } } @@ -3761,6 +4259,14 @@ namespace Google.Protobuf.Reflection { } + /// <summary> + /// A message representing a option the parser does not recognize. This only + /// appears in options protos created by the compiler::Parser class. + /// DescriptorPool resolves these when building Descriptor objects. Therefore, + /// options protos in descriptor objects (e.g. returned by Descriptor::options(), + /// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions + /// in them. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] internal sealed partial class UninterpretedOption : pb::IMessage<UninterpretedOption> { private static readonly pb::MessageParser<UninterpretedOption> _parser = new pb::MessageParser<UninterpretedOption>(() => new UninterpretedOption()); @@ -3794,6 +4300,7 @@ namespace Google.Protobuf.Reflection { return new UninterpretedOption(this); } + /// <summary>Field number for the "name" field.</summary> public const int NameFieldNumber = 2; private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.UninterpretedOption.Types.NamePart> _repeated_name_codec = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.Reflection.UninterpretedOption.Types.NamePart.Parser); @@ -3802,8 +4309,13 @@ namespace Google.Protobuf.Reflection { get { return name_; } } + /// <summary>Field number for the "identifier_value" field.</summary> public const int IdentifierValueFieldNumber = 3; private string identifierValue_ = ""; + /// <summary> + /// The value of the uninterpreted option, in whatever type the tokenizer + /// identified it as during parsing. Exactly one of these should be set. + /// </summary> public string IdentifierValue { get { return identifierValue_; } set { @@ -3811,6 +4323,7 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "positive_int_value" field.</summary> public const int PositiveIntValueFieldNumber = 4; private ulong positiveIntValue_; public ulong PositiveIntValue { @@ -3820,6 +4333,7 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "negative_int_value" field.</summary> public const int NegativeIntValueFieldNumber = 5; private long negativeIntValue_; public long NegativeIntValue { @@ -3829,6 +4343,7 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "double_value" field.</summary> public const int DoubleValueFieldNumber = 6; private double doubleValue_; public double DoubleValue { @@ -3838,6 +4353,7 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "string_value" field.</summary> public const int StringValueFieldNumber = 7; private pb::ByteString stringValue_ = pb::ByteString.Empty; public pb::ByteString StringValue { @@ -3847,6 +4363,7 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "aggregate_value" field.</summary> public const int AggregateValueFieldNumber = 8; private string aggregateValue_ = ""; public string AggregateValue { @@ -4010,8 +4527,16 @@ namespace Google.Protobuf.Reflection { } #region Nested types + /// <summary>Container for nested types declared in the UninterpretedOption message type.</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Types { + /// <summary> + /// The name of the uninterpreted option. Each string represents a segment in + /// a dot-separated name. is_extension is true iff a segment represents an + /// extension (denoted with parentheses in options specs in .proto files). + /// E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents + /// "foo.(bar.baz).qux". + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] internal sealed partial class NamePart : pb::IMessage<NamePart> { private static readonly pb::MessageParser<NamePart> _parser = new pb::MessageParser<NamePart>(() => new NamePart()); @@ -4040,6 +4565,7 @@ namespace Google.Protobuf.Reflection { return new NamePart(this); } + /// <summary>Field number for the "name_part" field.</summary> public const int NamePart_FieldNumber = 1; private string namePart_ = ""; public string NamePart_ { @@ -4049,6 +4575,7 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "is_extension" field.</summary> public const int IsExtensionFieldNumber = 2; private bool isExtension_; public bool IsExtension { @@ -4145,6 +4672,10 @@ namespace Google.Protobuf.Reflection { } + /// <summary> + /// Encapsulates information about the original source file from which a + /// FileDescriptorProto was generated. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] internal sealed partial class SourceCodeInfo : pb::IMessage<SourceCodeInfo> { private static readonly pb::MessageParser<SourceCodeInfo> _parser = new pb::MessageParser<SourceCodeInfo>(() => new SourceCodeInfo()); @@ -4172,10 +4703,54 @@ namespace Google.Protobuf.Reflection { return new SourceCodeInfo(this); } + /// <summary>Field number for the "location" field.</summary> public const int LocationFieldNumber = 1; private static readonly pb::FieldCodec<global::Google.Protobuf.Reflection.SourceCodeInfo.Types.Location> _repeated_location_codec = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.Reflection.SourceCodeInfo.Types.Location.Parser); private readonly pbc::RepeatedField<global::Google.Protobuf.Reflection.SourceCodeInfo.Types.Location> location_ = new pbc::RepeatedField<global::Google.Protobuf.Reflection.SourceCodeInfo.Types.Location>(); + /// <summary> + /// A Location identifies a piece of source code in a .proto file which + /// corresponds to a particular definition. This information is intended + /// to be useful to IDEs, code indexers, documentation generators, and similar + /// tools. + /// For example, say we have a file like: + /// message Foo { + /// optional string foo = 1; + /// } + /// Let's look at just the field definition: + /// optional string foo = 1; + /// ^ ^^ ^^ ^ ^^^ + /// a bc de f ghi + /// We have the following locations: + /// span path represents + /// [a,i) [ 4, 0, 2, 0 ] The whole field definition. + /// [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + /// [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + /// [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + /// [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + /// Notes: + /// - A location may refer to a repeated field itself (i.e. not to any + /// particular index within it). This is used whenever a set of elements are + /// logically enclosed in a single code segment. For example, an entire + /// extend block (possibly containing multiple extension definitions) will + /// have an outer location whose path refers to the "extensions" repeated + /// field without an index. + /// - Multiple locations may have the same path. This happens when a single + /// logical declaration is spread out across multiple places. The most + /// obvious example is the "extend" block again -- there may be multiple + /// extend blocks in the same scope, each of which will have the same path. + /// - A location's span is not always a subset of its parent's span. For + /// example, the "extendee" of an extension declaration appears at the + /// beginning of the "extend" block and is shared by all extensions within + /// the block. + /// - Just because a location's span is a subset of some other location's span + /// does not mean that it is a descendent. For example, a "group" defines + /// both a type and a field in a single declaration. Thus, the locations + /// corresponding to the type and field and their components will overlap. + /// - Code which tries to interpret locations should probably be designed to + /// ignore those that it doesn't understand, as more types of locations could + /// be recorded in the future. + /// </summary> public pbc::RepeatedField<global::Google.Protobuf.Reflection.SourceCodeInfo.Types.Location> Location { get { return location_; } } @@ -4238,6 +4813,7 @@ namespace Google.Protobuf.Reflection { } #region Nested types + /// <summary>Container for nested types declared in the SourceCodeInfo message type.</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Types { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -4271,24 +4847,95 @@ namespace Google.Protobuf.Reflection { return new Location(this); } + /// <summary>Field number for the "path" field.</summary> public const int PathFieldNumber = 1; private static readonly pb::FieldCodec<int> _repeated_path_codec = pb::FieldCodec.ForInt32(10); private readonly pbc::RepeatedField<int> path_ = new pbc::RepeatedField<int>(); + /// <summary> + /// Identifies which part of the FileDescriptorProto was defined at this + /// location. + /// Each element is a field number or an index. They form a path from + /// the root FileDescriptorProto to the place where the definition. For + /// example, this path: + /// [ 4, 3, 2, 7, 1 ] + /// refers to: + /// file.message_type(3) // 4, 3 + /// .field(7) // 2, 7 + /// .name() // 1 + /// This is because FileDescriptorProto.message_type has field number 4: + /// repeated DescriptorProto message_type = 4; + /// and DescriptorProto.field has field number 2: + /// repeated FieldDescriptorProto field = 2; + /// and FieldDescriptorProto.name has field number 1: + /// optional string name = 1; + /// Thus, the above path gives the location of a field name. If we removed + /// the last element: + /// [ 4, 3, 2, 7 ] + /// this path refers to the whole field declaration (from the beginning + /// of the label to the terminating semicolon). + /// </summary> public pbc::RepeatedField<int> Path { get { return path_; } } + /// <summary>Field number for the "span" field.</summary> public const int SpanFieldNumber = 2; private static readonly pb::FieldCodec<int> _repeated_span_codec = pb::FieldCodec.ForInt32(18); private readonly pbc::RepeatedField<int> span_ = new pbc::RepeatedField<int>(); + /// <summary> + /// Always has exactly three or four elements: start line, start column, + /// end line (optional, otherwise assumed same as start line), end column. + /// These are packed into a single field for efficiency. Note that line + /// and column numbers are zero-based -- typically you will want to add + /// 1 to each before displaying to a user. + /// </summary> public pbc::RepeatedField<int> Span { get { return span_; } } + /// <summary>Field number for the "leading_comments" field.</summary> public const int LeadingCommentsFieldNumber = 3; private string leadingComments_ = ""; + /// <summary> + /// If this SourceCodeInfo represents a complete declaration, these are any + /// comments appearing before and after the declaration which appear to be + /// attached to the declaration. + /// A series of line comments appearing on consecutive lines, with no other + /// tokens appearing on those lines, will be treated as a single comment. + /// leading_detached_comments will keep paragraphs of comments that appear + /// before (but not connected to) the current element. Each paragraph, + /// separated by empty lines, will be one comment element in the repeated + /// field. + /// Only the comment content is provided; comment markers (e.g. //) are + /// stripped out. For block comments, leading whitespace and an asterisk + /// will be stripped from the beginning of each line other than the first. + /// Newlines are included in the output. + /// Examples: + /// optional int32 foo = 1; // Comment attached to foo. + /// // Comment attached to bar. + /// optional int32 bar = 2; + /// optional string baz = 3; + /// // Comment attached to baz. + /// // Another line attached to baz. + /// // Comment attached to qux. + /// // + /// // Another line attached to qux. + /// optional double qux = 4; + /// // Detached comment for corge. This is not leading or trailing comments + /// // to qux or corge because there are blank lines separating it from + /// // both. + /// // Detached comment for corge paragraph 2. + /// optional string corge = 5; + /// /* Block comment attached + /// * to corge. Leading asterisks + /// * will be removed. */ + /// /* Block comment attached to + /// * grault. */ + /// optional int32 grault = 6; + /// // ignored detached comments. + /// </summary> public string LeadingComments { get { return leadingComments_; } set { @@ -4296,6 +4943,7 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "trailing_comments" field.</summary> public const int TrailingCommentsFieldNumber = 4; private string trailingComments_ = ""; public string TrailingComments { @@ -4305,6 +4953,7 @@ namespace Google.Protobuf.Reflection { } } + /// <summary>Field number for the "leading_detached_comments" field.</summary> public const int LeadingDetachedCommentsFieldNumber = 6; private static readonly pb::FieldCodec<string> _repeated_leadingDetachedComments_codec = pb::FieldCodec.ForString(50); diff --git a/csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs index 901cbf47..619a6ac8 100644 --- a/csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs +++ b/csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs @@ -252,7 +252,7 @@ namespace Google.Protobuf.Reflection { if (fieldType != FieldType.Message) { - throw new InvalidOperationException("MessageType is only valid for enum fields."); + throw new InvalidOperationException("MessageType is only valid for message fields."); } return messageType; } diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs index 204b37cf..4a704018 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs @@ -11,10 +11,12 @@ namespace Google.Protobuf.WellKnownTypes { namespace Proto { + /// <summary>Holder for reflection information generated from google/protobuf/any.proto</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Any { #region Descriptor + /// <summary>File descriptor for google/protobuf/any.proto</summary> public static pbr::FileDescriptor Descriptor { get { return descriptor; } } @@ -23,9 +25,9 @@ namespace Google.Protobuf.WellKnownTypes { static Any() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "Chlnb29nbGUvcHJvdG9idWYvYW55LnByb3RvEg9nb29nbGUucHJvdG9idWYi", - "JgoDQW55EhAKCHR5cGVfdXJsGAEgASgJEg0KBXZhbHVlGAIgASgMQksKE2Nv", - "bS5nb29nbGUucHJvdG9idWZCCEFueVByb3RvUAGgAQGiAgNHUEKqAh5Hb29n", + "Chlnb29nbGUvcHJvdG9idWYvYW55LnByb3RvEg9nb29nbGUucHJvdG9idWYi", + "JgoDQW55EhAKCHR5cGVfdXJsGAEgASgJEg0KBXZhbHVlGAIgASgMQksKE2Nv", + "bS5nb29nbGUucHJvdG9idWZCCEFueVByb3RvUAGgAQGiAgNHUEKqAh5Hb29n", "bGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw==")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbr::FileDescriptor[] { }, @@ -38,6 +40,33 @@ namespace Google.Protobuf.WellKnownTypes { } } #region Messages + /// <summary> + /// `Any` contains an arbitrary serialized message along with a URL + /// that describes the type of the serialized message. + /// JSON + /// ==== + /// The JSON representation of an `Any` value uses the regular + /// representation of the deserialized, embedded message, with an + /// additional field `@type` which contains the type URL. Example: + /// package google.profile; + /// message Person { + /// string first_name = 1; + /// string last_name = 2; + /// } + /// { + /// "@type": "type.googleapis.com/google.profile.Person", + /// "firstName": <string>, + /// "lastName": <string> + /// } + /// If the embedded message type is well-known and has a custom JSON + /// representation, that representation will be embedded adding a field + /// `value` which holds the custom JSON in addition to the the `@type` + /// field. Example (for message [google.protobuf.Duration][google.protobuf.Duration]): + /// { + /// "@type": "type.googleapis.com/google.protobuf.Duration", + /// "value": "1.212s" + /// } + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Any : pb::IMessage<Any> { private static readonly pb::MessageParser<Any> _parser = new pb::MessageParser<Any>(() => new Any()); @@ -66,8 +95,27 @@ namespace Google.Protobuf.WellKnownTypes { return new Any(this); } + /// <summary>Field number for the "type_url" field.</summary> public const int TypeUrlFieldNumber = 1; private string typeUrl_ = ""; + /// <summary> + /// A URL/resource name whose content describes the type of the + /// serialized message. + /// For URLs which use the schema `http`, `https`, or no schema, the + /// following restrictions and interpretations apply: + /// * If no schema is provided, `https` is assumed. + /// * The last segment of the URL's path must represent the fully + /// qualified name of the type (as in `path/google.protobuf.Duration`). + /// * An HTTP GET on the URL must yield a [google.protobuf.Type][google.protobuf.Type] + /// value in binary format, or produce an error. + /// * Applications are allowed to cache lookup results based on the + /// URL, or have them precompiled into a binary to avoid any + /// lookup. Therefore, binary compatibility needs to be preserved + /// on changes to types. (Use versioned type names to manage + /// breaking changes.) + /// Schemas other than `http`, `https` (or the empty schema) might be + /// used with implementation specific semantics. + /// </summary> public string TypeUrl { get { return typeUrl_; } set { @@ -75,8 +123,12 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// <summary>Field number for the "value" field.</summary> public const int ValueFieldNumber = 2; private pb::ByteString value_ = pb::ByteString.Empty; + /// <summary> + /// Must be valid serialized data of the above specified type. + /// </summary> public pb::ByteString Value { get { return value_; } set { diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/AnyPartial.cs b/csharp/src/Google.Protobuf/WellKnownTypes/AnyPartial.cs new file mode 100644 index 00000000..082f7432 --- /dev/null +++ b/csharp/src/Google.Protobuf/WellKnownTypes/AnyPartial.cs @@ -0,0 +1,79 @@ +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion + +using Google.Protobuf.Reflection; + +namespace Google.Protobuf.WellKnownTypes +{ + public partial class Any + { + // This could be moved to MessageDescriptor if we wanted to, but keeping it here means + // all the Any-specific code is in the same place. + private static string GetTypeUrl(MessageDescriptor descriptor) + { + return "type.googleapis.com/" + descriptor.FullName; + } + + /// <summary> + /// Unpacks the content of this Any message into the target message type, + /// which must match the type URL within this Any message. + /// </summary> + /// <typeparam name="T">The type of message to unpack the content into.</typeparam> + /// <returns>The unpacked message.</returns> + /// <exception cref="InvalidProtocolBufferException">The target message type doesn't match the type URL in this message</exception> + public T Unpack<T>() where T : IMessage, new() + { + // Note: this doesn't perform as well is it might. We could take a MessageParser<T> in an alternative overload, + // which would be expected to perform slightly better... although the difference is likely to be negligible. + T target = new T(); + string targetTypeUrl = GetTypeUrl(target.Descriptor); + if (TypeUrl != targetTypeUrl) + { + throw new InvalidProtocolBufferException(string.Format("Type url for {0} is {1}; Any message's type url is {2}", + target.Descriptor.Name, targetTypeUrl, TypeUrl)); + } + target.MergeFrom(Value); + return target; + } + + /// <summary> + /// Packs the specified message into an Any message. + /// </summary> + /// <param name="message">The message to pack.</param> + /// <returns>An Any message with the content and type URL of <paramref name="message"/>.</returns> + public static Any Pack(IMessage message) + { + Preconditions.CheckNotNull(message, "message"); + return new Any { TypeUrl = GetTypeUrl(message.Descriptor), Value = message.ToByteString() }; + } + } +} diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Api.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Api.cs index a5f95093..2c64314d 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Api.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Api.cs @@ -11,10 +11,12 @@ namespace Google.Protobuf.WellKnownTypes { namespace Proto { + /// <summary>Holder for reflection information generated from google/protobuf/api.proto</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Api { #region Descriptor + /// <summary>File descriptor for google/protobuf/api.proto</summary> public static pbr::FileDescriptor Descriptor { get { return descriptor; } } @@ -23,24 +25,28 @@ namespace Google.Protobuf.WellKnownTypes { static Api() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "Chlnb29nbGUvcHJvdG9idWYvYXBpLnByb3RvEg9nb29nbGUucHJvdG9idWYa", - "JGdvb2dsZS9wcm90b2J1Zi9zb3VyY2VfY29udGV4dC5wcm90bxoaZ29vZ2xl", - "L3Byb3RvYnVmL3R5cGUucHJvdG8isAEKA0FwaRIMCgRuYW1lGAEgASgJEigK", - "B21ldGhvZHMYAiADKAsyFy5nb29nbGUucHJvdG9idWYuTWV0aG9kEigKB29w", - "dGlvbnMYAyADKAsyFy5nb29nbGUucHJvdG9idWYuT3B0aW9uEg8KB3ZlcnNp", - "b24YBCABKAkSNgoOc291cmNlX2NvbnRleHQYBSABKAsyHi5nb29nbGUucHJv", - "dG9idWYuU291cmNlQ29udGV4dCKsAQoGTWV0aG9kEgwKBG5hbWUYASABKAkS", - "GAoQcmVxdWVzdF90eXBlX3VybBgCIAEoCRIZChFyZXF1ZXN0X3N0cmVhbWlu", - "ZxgDIAEoCBIZChFyZXNwb25zZV90eXBlX3VybBgEIAEoCRIaChJyZXNwb25z", - "ZV9zdHJlYW1pbmcYBSABKAgSKAoHb3B0aW9ucxgGIAMoCzIXLmdvb2dsZS5w", - "cm90b2J1Zi5PcHRpb25CSAoTY29tLmdvb2dsZS5wcm90b2J1ZkIIQXBpUHJv", - "dG9QAaICA0dQQqoCHkdvb2dsZS5Qcm90b2J1Zi5XZWxsS25vd25UeXBlc2IG", - "cHJvdG8z")); + "Chlnb29nbGUvcHJvdG9idWYvYXBpLnByb3RvEg9nb29nbGUucHJvdG9idWYa", + "JGdvb2dsZS9wcm90b2J1Zi9zb3VyY2VfY29udGV4dC5wcm90bxoaZ29vZ2xl", + "L3Byb3RvYnVmL3R5cGUucHJvdG8igQIKA0FwaRIMCgRuYW1lGAEgASgJEigK", + "B21ldGhvZHMYAiADKAsyFy5nb29nbGUucHJvdG9idWYuTWV0aG9kEigKB29w", + "dGlvbnMYAyADKAsyFy5nb29nbGUucHJvdG9idWYuT3B0aW9uEg8KB3ZlcnNp", + "b24YBCABKAkSNgoOc291cmNlX2NvbnRleHQYBSABKAsyHi5nb29nbGUucHJv", + "dG9idWYuU291cmNlQ29udGV4dBImCgZtaXhpbnMYBiADKAsyFi5nb29nbGUu", + "cHJvdG9idWYuTWl4aW4SJwoGc3ludGF4GAcgASgOMhcuZ29vZ2xlLnByb3Rv", + "YnVmLlN5bnRheCLVAQoGTWV0aG9kEgwKBG5hbWUYASABKAkSGAoQcmVxdWVz", + "dF90eXBlX3VybBgCIAEoCRIZChFyZXF1ZXN0X3N0cmVhbWluZxgDIAEoCBIZ", + "ChFyZXNwb25zZV90eXBlX3VybBgEIAEoCRIaChJyZXNwb25zZV9zdHJlYW1p", + "bmcYBSABKAgSKAoHb3B0aW9ucxgGIAMoCzIXLmdvb2dsZS5wcm90b2J1Zi5P", + "cHRpb24SJwoGc3ludGF4GAcgASgOMhcuZ29vZ2xlLnByb3RvYnVmLlN5bnRh", + "eCIjCgVNaXhpbhIMCgRuYW1lGAEgASgJEgwKBHJvb3QYAiABKAlCSwoTY29t", + "Lmdvb2dsZS5wcm90b2J1ZkIIQXBpUHJvdG9QAaABAaICA0dQQqoCHkdvb2ds", + "ZS5Qcm90b2J1Zi5XZWxsS25vd25UeXBlc2IGcHJvdG8z")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.Proto.SourceContext.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.Type.Descriptor, }, new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] { - new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Api), new[]{ "Name", "Methods", "Options", "Version", "SourceContext" }, null, null, null), - new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Method), new[]{ "Name", "RequestTypeUrl", "RequestStreaming", "ResponseTypeUrl", "ResponseStreaming", "Options" }, null, null, null) + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Api), new[]{ "Name", "Methods", "Options", "Version", "SourceContext", "Mixins", "Syntax" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Method), new[]{ "Name", "RequestTypeUrl", "RequestStreaming", "ResponseTypeUrl", "ResponseStreaming", "Options", "Syntax" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Mixin), new[]{ "Name", "Root" }, null, null, null) })); } #endregion @@ -48,6 +54,9 @@ namespace Google.Protobuf.WellKnownTypes { } } #region Messages + /// <summary> + /// Api is a light-weight descriptor for a protocol buffer service. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Api : pb::IMessage<Api> { private static readonly pb::MessageParser<Api> _parser = new pb::MessageParser<Api>(() => new Api()); @@ -73,14 +82,21 @@ namespace Google.Protobuf.WellKnownTypes { options_ = other.options_.Clone(); version_ = other.version_; SourceContext = other.sourceContext_ != null ? other.SourceContext.Clone() : null; + mixins_ = other.mixins_.Clone(); + syntax_ = other.syntax_; } public Api Clone() { return new Api(this); } + /// <summary>Field number for the "name" field.</summary> public const int NameFieldNumber = 1; private string name_ = ""; + /// <summary> + /// The fully qualified name of this api, including package name + /// followed by the api's simple name. + /// </summary> public string Name { get { return name_; } set { @@ -88,24 +104,53 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// <summary>Field number for the "methods" field.</summary> public const int MethodsFieldNumber = 2; private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Method> _repeated_methods_codec = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Method.Parser); private readonly pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Method> methods_ = new pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Method>(); + /// <summary> + /// The methods of this api, in unspecified order. + /// </summary> public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Method> Methods { get { return methods_; } } + /// <summary>Field number for the "options" field.</summary> public const int OptionsFieldNumber = 3; private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Option> _repeated_options_codec = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.WellKnownTypes.Option.Parser); private readonly pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> options_ = new pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option>(); + /// <summary> + /// Any metadata attached to the API. + /// </summary> public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> Options { get { return options_; } } + /// <summary>Field number for the "version" field.</summary> public const int VersionFieldNumber = 4; private string version_ = ""; + /// <summary> + /// A version string for this api. If specified, must have the form + /// `major-version.minor-version`, as in `1.10`. If the minor version + /// is omitted, it defaults to zero. If the entire version field is + /// empty, the major version is derived from the package name, as + /// outlined below. If the field is not empty, the version in the + /// package name will be verified to be consistent with what is + /// provided here. + /// The versioning schema uses [semantic + /// versioning](http://semver.org) where the major version number + /// indicates a breaking change and the minor version an additive, + /// non-breaking change. Both version numbers are signals to users + /// what to expect from different versions, and should be carefully + /// chosen based on the product plan. + /// The major version is also reflected in the package name of the + /// API, which must end in `v<major-version>`, as in + /// `google.feature.v1`. For major versions 0 and 1, the suffix can + /// be omitted. Zero major versions must only be used for + /// experimental, none-GA apis. + /// </summary> public string Version { get { return version_; } set { @@ -113,8 +158,13 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// <summary>Field number for the "source_context" field.</summary> public const int SourceContextFieldNumber = 5; private global::Google.Protobuf.WellKnownTypes.SourceContext sourceContext_; + /// <summary> + /// Source context for the protocol buffer service represented by this + /// message. + /// </summary> public global::Google.Protobuf.WellKnownTypes.SourceContext SourceContext { get { return sourceContext_; } set { @@ -122,6 +172,31 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// <summary>Field number for the "mixins" field.</summary> + public const int MixinsFieldNumber = 6; + private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Mixin> _repeated_mixins_codec + = pb::FieldCodec.ForMessage(50, global::Google.Protobuf.WellKnownTypes.Mixin.Parser); + private readonly pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Mixin> mixins_ = new pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Mixin>(); + /// <summary> + /// Included APIs. See [Mixin][]. + /// </summary> + public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Mixin> Mixins { + get { return mixins_; } + } + + /// <summary>Field number for the "syntax" field.</summary> + public const int SyntaxFieldNumber = 7; + private global::Google.Protobuf.WellKnownTypes.Syntax syntax_ = global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2; + /// <summary> + /// The source syntax of the service. + /// </summary> + public global::Google.Protobuf.WellKnownTypes.Syntax Syntax { + get { return syntax_; } + set { + syntax_ = value; + } + } + public override bool Equals(object other) { return Equals(other as Api); } @@ -138,6 +213,8 @@ namespace Google.Protobuf.WellKnownTypes { if(!options_.Equals(other.options_)) return false; if (Version != other.Version) return false; if (!object.Equals(SourceContext, other.SourceContext)) return false; + if(!mixins_.Equals(other.mixins_)) return false; + if (Syntax != other.Syntax) return false; return true; } @@ -148,6 +225,8 @@ namespace Google.Protobuf.WellKnownTypes { hash ^= options_.GetHashCode(); if (Version.Length != 0) hash ^= Version.GetHashCode(); if (sourceContext_ != null) hash ^= SourceContext.GetHashCode(); + hash ^= mixins_.GetHashCode(); + if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) hash ^= Syntax.GetHashCode(); return hash; } @@ -170,6 +249,11 @@ namespace Google.Protobuf.WellKnownTypes { output.WriteRawTag(42); output.WriteMessage(SourceContext); } + mixins_.WriteTo(output, _repeated_mixins_codec); + if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) { + output.WriteRawTag(56); + output.WriteEnum((int) Syntax); + } } public int CalculateSize() { @@ -185,6 +269,10 @@ namespace Google.Protobuf.WellKnownTypes { if (sourceContext_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(SourceContext); } + size += mixins_.CalculateSize(_repeated_mixins_codec); + if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Syntax); + } return size; } @@ -206,6 +294,10 @@ namespace Google.Protobuf.WellKnownTypes { } SourceContext.MergeFrom(other.SourceContext); } + mixins_.Add(other.mixins_); + if (other.Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) { + Syntax = other.Syntax; + } } public void MergeFrom(pb::CodedInputStream input) { @@ -238,12 +330,23 @@ namespace Google.Protobuf.WellKnownTypes { input.ReadMessage(sourceContext_); break; } + case 50: { + mixins_.AddEntriesFrom(input, _repeated_mixins_codec); + break; + } + case 56: { + syntax_ = (global::Google.Protobuf.WellKnownTypes.Syntax) input.ReadEnum(); + break; + } } } } } + /// <summary> + /// Method represents a method of an api. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Method : pb::IMessage<Method> { private static readonly pb::MessageParser<Method> _parser = new pb::MessageParser<Method>(() => new Method()); @@ -270,14 +373,19 @@ namespace Google.Protobuf.WellKnownTypes { responseTypeUrl_ = other.responseTypeUrl_; responseStreaming_ = other.responseStreaming_; options_ = other.options_.Clone(); + syntax_ = other.syntax_; } public Method Clone() { return new Method(this); } + /// <summary>Field number for the "name" field.</summary> public const int NameFieldNumber = 1; private string name_ = ""; + /// <summary> + /// The simple name of this method. + /// </summary> public string Name { get { return name_; } set { @@ -285,8 +393,12 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// <summary>Field number for the "request_type_url" field.</summary> public const int RequestTypeUrlFieldNumber = 2; private string requestTypeUrl_ = ""; + /// <summary> + /// A URL of the input message type. + /// </summary> public string RequestTypeUrl { get { return requestTypeUrl_; } set { @@ -294,8 +406,12 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// <summary>Field number for the "request_streaming" field.</summary> public const int RequestStreamingFieldNumber = 3; private bool requestStreaming_; + /// <summary> + /// If true, the request is streamed. + /// </summary> public bool RequestStreaming { get { return requestStreaming_; } set { @@ -303,8 +419,12 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// <summary>Field number for the "response_type_url" field.</summary> public const int ResponseTypeUrlFieldNumber = 4; private string responseTypeUrl_ = ""; + /// <summary> + /// The URL of the output message type. + /// </summary> public string ResponseTypeUrl { get { return responseTypeUrl_; } set { @@ -312,8 +432,12 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// <summary>Field number for the "response_streaming" field.</summary> public const int ResponseStreamingFieldNumber = 5; private bool responseStreaming_; + /// <summary> + /// If true, the response is streamed. + /// </summary> public bool ResponseStreaming { get { return responseStreaming_; } set { @@ -321,14 +445,31 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// <summary>Field number for the "options" field.</summary> public const int OptionsFieldNumber = 6; private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Option> _repeated_options_codec = pb::FieldCodec.ForMessage(50, global::Google.Protobuf.WellKnownTypes.Option.Parser); private readonly pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> options_ = new pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option>(); + /// <summary> + /// Any metadata attached to the method. + /// </summary> public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> Options { get { return options_; } } + /// <summary>Field number for the "syntax" field.</summary> + public const int SyntaxFieldNumber = 7; + private global::Google.Protobuf.WellKnownTypes.Syntax syntax_ = global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2; + /// <summary> + /// The source syntax of this method. + /// </summary> + public global::Google.Protobuf.WellKnownTypes.Syntax Syntax { + get { return syntax_; } + set { + syntax_ = value; + } + } + public override bool Equals(object other) { return Equals(other as Method); } @@ -346,6 +487,7 @@ namespace Google.Protobuf.WellKnownTypes { if (ResponseTypeUrl != other.ResponseTypeUrl) return false; if (ResponseStreaming != other.ResponseStreaming) return false; if(!options_.Equals(other.options_)) return false; + if (Syntax != other.Syntax) return false; return true; } @@ -357,6 +499,7 @@ namespace Google.Protobuf.WellKnownTypes { if (ResponseTypeUrl.Length != 0) hash ^= ResponseTypeUrl.GetHashCode(); if (ResponseStreaming != false) hash ^= ResponseStreaming.GetHashCode(); hash ^= options_.GetHashCode(); + if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) hash ^= Syntax.GetHashCode(); return hash; } @@ -386,6 +529,10 @@ namespace Google.Protobuf.WellKnownTypes { output.WriteBool(ResponseStreaming); } options_.WriteTo(output, _repeated_options_codec); + if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) { + output.WriteRawTag(56); + output.WriteEnum((int) Syntax); + } } public int CalculateSize() { @@ -406,6 +553,9 @@ namespace Google.Protobuf.WellKnownTypes { size += 1 + 1; } size += options_.CalculateSize(_repeated_options_codec); + if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Syntax); + } return size; } @@ -429,6 +579,9 @@ namespace Google.Protobuf.WellKnownTypes { ResponseStreaming = other.ResponseStreaming; } options_.Add(other.options_); + if (other.Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) { + Syntax = other.Syntax; + } } public void MergeFrom(pb::CodedInputStream input) { @@ -462,6 +615,211 @@ namespace Google.Protobuf.WellKnownTypes { options_.AddEntriesFrom(input, _repeated_options_codec); break; } + case 56: { + syntax_ = (global::Google.Protobuf.WellKnownTypes.Syntax) input.ReadEnum(); + break; + } + } + } + } + + } + + /// <summary> + /// Declares an API to be included in this API. The including API must + /// redeclare all the methods from the included API, but documentation + /// and options are inherited as follows: + /// - If after comment and whitespace stripping, the documentation + /// string of the redeclared method is empty, it will be inherited + /// from the original method. + /// - Each annotation belonging to the service config (http, + /// visibility) which is not set in the redeclared method will be + /// inherited. + /// - If an http annotation is inherited, the path pattern will be + /// modified as follows. Any version prefix will be replaced by the + /// version of the including API plus the [root][] path if specified. + /// Example of a simple mixin: + /// package google.acl.v1; + /// service AccessControl { + /// // Get the underlying ACL object. + /// rpc GetAcl(GetAclRequest) returns (Acl) { + /// option (google.api.http).get = "/v1/{resource=**}:getAcl"; + /// } + /// } + /// package google.storage.v2; + /// service Storage { + /// // (-- see AccessControl.GetAcl --) + /// rpc GetAcl(GetAclRequest) returns (Acl); + /// // Get a data record. + /// rpc GetData(GetDataRequest) returns (Data) { + /// option (google.api.http).get = "/v2/{resource=**}"; + /// } + /// } + /// Example of a mixin configuration: + /// apis: + /// - name: google.storage.v2.Storage + /// mixins: + /// - name: google.acl.v1.AccessControl + /// The mixin construct implies that all methods in `AccessControl` are + /// also declared with same name and request/response types in + /// `Storage`. A documentation generator or annotation processor will + /// see the effective `Storage.GetAcl` method after inherting + /// documentation and annotations as follows: + /// service Storage { + /// // Get the underlying ACL object. + /// rpc GetAcl(GetAclRequest) returns (Acl) { + /// option (google.api.http).get = "/v2/{resource=**}:getAcl"; + /// } + /// ... + /// } + /// Note how the version in the path pattern changed from `v1` to `v2`. + /// If the `root` field in the mixin is specified, it should be a + /// relative path under which inherited HTTP paths are placed. Example: + /// apis: + /// - name: google.storage.v2.Storage + /// mixins: + /// - name: google.acl.v1.AccessControl + /// root: acls + /// This implies the following inherited HTTP annotation: + /// service Storage { + /// // Get the underlying ACL object. + /// rpc GetAcl(GetAclRequest) returns (Acl) { + /// option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; + /// } + /// ... + /// } + /// </summary> + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Mixin : pb::IMessage<Mixin> { + private static readonly pb::MessageParser<Mixin> _parser = new pb::MessageParser<Mixin>(() => new Mixin()); + public static pb::MessageParser<Mixin> Parser { get { return _parser; } } + + public static pbr::MessageDescriptor Descriptor { + get { return global::Google.Protobuf.WellKnownTypes.Proto.Api.Descriptor.MessageTypes[2]; } + } + + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + public Mixin() { + OnConstruction(); + } + + partial void OnConstruction(); + + public Mixin(Mixin other) : this() { + name_ = other.name_; + root_ = other.root_; + } + + public Mixin Clone() { + return new Mixin(this); + } + + /// <summary>Field number for the "name" field.</summary> + public const int NameFieldNumber = 1; + private string name_ = ""; + /// <summary> + /// The fully qualified name of the API which is included. + /// </summary> + public string Name { + get { return name_; } + set { + name_ = pb::Preconditions.CheckNotNull(value, "value"); + } + } + + /// <summary>Field number for the "root" field.</summary> + public const int RootFieldNumber = 2; + private string root_ = ""; + /// <summary> + /// If non-empty specifies a path under which inherited HTTP paths + /// are rooted. + /// </summary> + public string Root { + get { return root_; } + set { + root_ = pb::Preconditions.CheckNotNull(value, "value"); + } + } + + public override bool Equals(object other) { + return Equals(other as Mixin); + } + + public bool Equals(Mixin other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Name != other.Name) return false; + if (Root != other.Root) return false; + return true; + } + + public override int GetHashCode() { + int hash = 1; + if (Name.Length != 0) hash ^= Name.GetHashCode(); + if (Root.Length != 0) hash ^= Root.GetHashCode(); + return hash; + } + + public override string ToString() { + return pb::JsonFormatter.Default.Format(this); + } + + public void WriteTo(pb::CodedOutputStream output) { + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (Root.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Root); + } + } + + public int CalculateSize() { + int size = 0; + if (Name.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); + } + if (Root.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Root); + } + return size; + } + + public void MergeFrom(Mixin other) { + if (other == null) { + return; + } + if (other.Name.Length != 0) { + Name = other.Name; + } + if (other.Root.Length != 0) { + Root = other.Root; + } + } + + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + input.SkipLastField(); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + Root = input.ReadString(); + break; + } } } } diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs index aa34f2d8..39251e2e 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs @@ -11,10 +11,12 @@ namespace Google.Protobuf.WellKnownTypes { namespace Proto { + /// <summary>Holder for reflection information generated from google/protobuf/duration.proto</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Duration { #region Descriptor + /// <summary>File descriptor for google/protobuf/duration.proto</summary> public static pbr::FileDescriptor Descriptor { get { return descriptor; } } @@ -23,10 +25,10 @@ namespace Google.Protobuf.WellKnownTypes { static Duration() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "Ch5nb29nbGUvcHJvdG9idWYvZHVyYXRpb24ucHJvdG8SD2dvb2dsZS5wcm90", - "b2J1ZiIqCghEdXJhdGlvbhIPCgdzZWNvbmRzGAEgASgDEg0KBW5hbm9zGAIg", - "ASgFQlAKE2NvbS5nb29nbGUucHJvdG9idWZCDUR1cmF0aW9uUHJvdG9QAaAB", - "AaICA0dQQqoCHkdvb2dsZS5Qcm90b2J1Zi5XZWxsS25vd25UeXBlc2IGcHJv", + "Ch5nb29nbGUvcHJvdG9idWYvZHVyYXRpb24ucHJvdG8SD2dvb2dsZS5wcm90", + "b2J1ZiIqCghEdXJhdGlvbhIPCgdzZWNvbmRzGAEgASgDEg0KBW5hbm9zGAIg", + "ASgFQlAKE2NvbS5nb29nbGUucHJvdG9idWZCDUR1cmF0aW9uUHJvdG9QAaAB", + "AaICA0dQQqoCHkdvb2dsZS5Qcm90b2J1Zi5XZWxsS25vd25UeXBlc2IGcHJv", "dG8z")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbr::FileDescriptor[] { }, @@ -39,6 +41,40 @@ namespace Google.Protobuf.WellKnownTypes { } } #region Messages + /// <summary> + /// A Duration represents a signed, fixed-length span of time represented + /// as a count of seconds and fractions of seconds at nanosecond + /// resolution. It is independent of any calendar and concepts like "day" + /// or "month". It is related to Timestamp in that the difference between + /// two Timestamp values is a Duration and it can be added or subtracted + /// from a Timestamp. Range is approximately +-10,000 years. + /// Example 1: Compute Duration from two Timestamps in pseudo code. + /// Timestamp start = ...; + /// Timestamp end = ...; + /// Duration duration = ...; + /// duration.seconds = end.seconds - start.seconds; + /// duration.nanos = end.nanos - start.nanos; + /// if (duration.seconds < 0 && duration.nanos > 0) { + /// duration.seconds += 1; + /// duration.nanos -= 1000000000; + /// } else if (durations.seconds > 0 && duration.nanos < 0) { + /// duration.seconds -= 1; + /// duration.nanos += 1000000000; + /// } + /// Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + /// Timestamp start = ...; + /// Duration duration = ...; + /// Timestamp end = ...; + /// end.seconds = start.seconds + duration.seconds; + /// end.nanos = start.nanos + duration.nanos; + /// if (end.nanos < 0) { + /// end.seconds -= 1; + /// end.nanos += 1000000000; + /// } else if (end.nanos >= 1000000000) { + /// end.seconds += 1; + /// end.nanos -= 1000000000; + /// } + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Duration : pb::IMessage<Duration> { private static readonly pb::MessageParser<Duration> _parser = new pb::MessageParser<Duration>(() => new Duration()); @@ -67,8 +103,13 @@ namespace Google.Protobuf.WellKnownTypes { return new Duration(this); } + /// <summary>Field number for the "seconds" field.</summary> public const int SecondsFieldNumber = 1; private long seconds_; + /// <summary> + /// Signed seconds of the span of time. Must be from -315,576,000,000 + /// to +315,576,000,000 inclusive. + /// </summary> public long Seconds { get { return seconds_; } set { @@ -76,8 +117,17 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// <summary>Field number for the "nanos" field.</summary> public const int NanosFieldNumber = 2; private int nanos_; + /// <summary> + /// Signed fractions of a second at nanosecond resolution of the span + /// of time. Durations less than one second are represented with a 0 + /// `seconds` field and a positive or negative `nanos` field. For durations + /// of one second or more, a non-zero value for the `nanos` field must be + /// of the same sign as the `seconds` field. Must be from -999,999,999 + /// to +999,999,999 inclusive. + /// </summary> public int Nanos { get { return nanos_; } set { diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs index 7d699c1d..18223a9e 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs @@ -11,10 +11,12 @@ namespace Google.Protobuf.WellKnownTypes { namespace Proto { + /// <summary>Holder for reflection information generated from google/protobuf/empty.proto</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Empty { #region Descriptor + /// <summary>File descriptor for google/protobuf/empty.proto</summary> public static pbr::FileDescriptor Descriptor { get { return descriptor; } } @@ -23,10 +25,10 @@ namespace Google.Protobuf.WellKnownTypes { static Empty() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "Chtnb29nbGUvcHJvdG9idWYvZW1wdHkucHJvdG8SD2dvb2dsZS5wcm90b2J1", - "ZiIHCgVFbXB0eUJKChNjb20uZ29vZ2xlLnByb3RvYnVmQgpFbXB0eVByb3Rv", - "UAGiAgNHUEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnBy", - "b3RvMw==")); + "Chtnb29nbGUvcHJvdG9idWYvZW1wdHkucHJvdG8SD2dvb2dsZS5wcm90b2J1", + "ZiIHCgVFbXB0eUJNChNjb20uZ29vZ2xlLnByb3RvYnVmQgpFbXB0eVByb3Rv", + "UAGgAQGiAgNHUEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNi", + "BnByb3RvMw==")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] { @@ -38,6 +40,15 @@ namespace Google.Protobuf.WellKnownTypes { } } #region Messages + /// <summary> + /// A generic empty message that you can re-use to avoid defining duplicated + /// empty messages in your APIs. A typical example is to use it as the request + /// or the response type of an API method. For instance: + /// service Foo { + /// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + /// } + /// The JSON representation for `Empty` is empty JSON object `{}`. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Empty : pb::IMessage<Empty> { private static readonly pb::MessageParser<Empty> _parser = new pb::MessageParser<Empty>(() => new Empty()); diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs b/csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs index 0dac4403..33c814ef 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs @@ -11,10 +11,12 @@ namespace Google.Protobuf.WellKnownTypes { namespace Proto { + /// <summary>Holder for reflection information generated from google/protobuf/field_mask.proto</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class FieldMask { #region Descriptor + /// <summary>File descriptor for google/protobuf/field_mask.proto</summary> public static pbr::FileDescriptor Descriptor { get { return descriptor; } } @@ -23,10 +25,10 @@ namespace Google.Protobuf.WellKnownTypes { static FieldMask() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "CiBnb29nbGUvcHJvdG9idWYvZmllbGRfbWFzay5wcm90bxIPZ29vZ2xlLnBy", - "b3RvYnVmIhoKCUZpZWxkTWFzaxINCgVwYXRocxgBIAMoCUJOChNjb20uZ29v", - "Z2xlLnByb3RvYnVmQg5GaWVsZE1hc2tQcm90b1ABogIDR1BCqgIeR29vZ2xl", - "LlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM=")); + "CiBnb29nbGUvcHJvdG9idWYvZmllbGRfbWFzay5wcm90bxIPZ29vZ2xlLnBy", + "b3RvYnVmIhoKCUZpZWxkTWFzaxINCgVwYXRocxgBIAMoCUJRChNjb20uZ29v", + "Z2xlLnByb3RvYnVmQg5GaWVsZE1hc2tQcm90b1ABoAEBogIDR1BCqgIeR29v", + "Z2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] { @@ -38,6 +40,103 @@ namespace Google.Protobuf.WellKnownTypes { } } #region Messages + /// <summary> + /// `FieldMask` represents a set of symbolic field paths, for example: + /// paths: "f.a" + /// paths: "f.b.d" + /// Here `f` represents a field in some root message, `a` and `b` + /// fields in the message found in `f`, and `d` a field found in the + /// message in `f.b`. + /// Field masks are used to specify a subset of fields that should be + /// returned by a get operation or modified by an update operation. + /// Field masks also have a custom JSON encoding (see below). + /// # Field Masks in Projections + /// When used in the context of a projection, a response message or + /// sub-message is filtered by the API to only contain those fields as + /// specified in the mask. For example, if the mask in the previous + /// example is applied to a response message as follows: + /// f { + /// a : 22 + /// b { + /// d : 1 + /// x : 2 + /// } + /// y : 13 + /// } + /// z: 8 + /// The result will not contain specific values for fields x,y and z + /// (there value will be set to the default, and omitted in proto text + /// output): + /// f { + /// a : 22 + /// b { + /// d : 1 + /// } + /// } + /// A repeated field is not allowed except at the last position of a + /// field mask. + /// If a FieldMask object is not present in a get operation, the + /// operation applies to all fields (as if a FieldMask of all fields + /// had been specified). + /// Note that a field mask does not necessarily applies to the + /// top-level response message. In case of a REST get operation, the + /// field mask applies directly to the response, but in case of a REST + /// list operation, the mask instead applies to each individual message + /// in the returned resource list. In case of a REST custom method, + /// other definitions may be used. Where the mask applies will be + /// clearly documented together with its declaration in the API. In + /// any case, the effect on the returned resource/resources is required + /// behavior for APIs. + /// # Field Masks in Update Operations + /// A field mask in update operations specifies which fields of the + /// targeted resource are going to be updated. The API is required + /// to only change the values of the fields as specified in the mask + /// and leave the others untouched. If a resource is passed in to + /// describe the updated values, the API ignores the values of all + /// fields not covered by the mask. + /// In order to reset a field's value to the default, the field must + /// be in the mask and set to the default value in the provided resource. + /// Hence, in order to reset all fields of a resource, provide a default + /// instance of the resource and set all fields in the mask, or do + /// not provide a mask as described below. + /// If a field mask is not present on update, the operation applies to + /// all fields (as if a field mask of all fields has been specified). + /// Note that in the presence of schema evolution, this may mean that + /// fields the client does not know and has therefore not filled into + /// the request will be reset to their default. If this is unwanted + /// behavior, a specific service may require a client to always specify + /// a field mask, producing an error if not. + /// As with get operations, the location of the resource which + /// describes the updated values in the request message depends on the + /// operation kind. In any case, the effect of the field mask is + /// required to be honored by the API. + /// ## Considerations for HTTP REST + /// The HTTP kind of an update operation which uses a field mask must + /// be set to PATCH instead of PUT in order to satisfy HTTP semantics + /// (PUT must only be used for full updates). + /// # JSON Encoding of Field Masks + /// In JSON, a field mask is encoded as a single string where paths are + /// separated by a comma. Fields name in each path are converted + /// to/from lower-camel naming conventions. + /// As an example, consider the following message declarations: + /// message Profile { + /// User user = 1; + /// Photo photo = 2; + /// } + /// message User { + /// string display_name = 1; + /// string address = 2; + /// } + /// In proto a field mask for `Profile` may look as such: + /// mask { + /// paths: "user.display_name" + /// paths: "photo" + /// } + /// In JSON, the same mask is represented as below: + /// { + /// mask: "user.displayName,photo" + /// } + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class FieldMask : pb::IMessage<FieldMask> { private static readonly pb::MessageParser<FieldMask> _parser = new pb::MessageParser<FieldMask>(() => new FieldMask()); @@ -65,10 +164,14 @@ namespace Google.Protobuf.WellKnownTypes { return new FieldMask(this); } + /// <summary>Field number for the "paths" field.</summary> public const int PathsFieldNumber = 1; private static readonly pb::FieldCodec<string> _repeated_paths_codec = pb::FieldCodec.ForString(10); private readonly pbc::RepeatedField<string> paths_ = new pbc::RepeatedField<string>(); + /// <summary> + /// The set of field mask paths. + /// </summary> public pbc::RepeatedField<string> Paths { get { return paths_; } } diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs b/csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs index 8347999d..d87c54bd 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs @@ -11,10 +11,12 @@ namespace Google.Protobuf.WellKnownTypes { namespace Proto { + /// <summary>Holder for reflection information generated from google/protobuf/source_context.proto</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class SourceContext { #region Descriptor + /// <summary>File descriptor for google/protobuf/source_context.proto</summary> public static pbr::FileDescriptor Descriptor { get { return descriptor; } } @@ -23,11 +25,11 @@ namespace Google.Protobuf.WellKnownTypes { static SourceContext() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "CiRnb29nbGUvcHJvdG9idWYvc291cmNlX2NvbnRleHQucHJvdG8SD2dvb2ds", - "ZS5wcm90b2J1ZiIiCg1Tb3VyY2VDb250ZXh0EhEKCWZpbGVfbmFtZRgBIAEo", - "CUJSChNjb20uZ29vZ2xlLnByb3RvYnVmQhJTb3VyY2VDb250ZXh0UHJvdG9Q", - "AaICA0dQQqoCHkdvb2dsZS5Qcm90b2J1Zi5XZWxsS25vd25UeXBlc2IGcHJv", - "dG8z")); + "CiRnb29nbGUvcHJvdG9idWYvc291cmNlX2NvbnRleHQucHJvdG8SD2dvb2ds", + "ZS5wcm90b2J1ZiIiCg1Tb3VyY2VDb250ZXh0EhEKCWZpbGVfbmFtZRgBIAEo", + "CUJVChNjb20uZ29vZ2xlLnByb3RvYnVmQhJTb3VyY2VDb250ZXh0UHJvdG9Q", + "AaABAaICA0dQQqoCHkdvb2dsZS5Qcm90b2J1Zi5XZWxsS25vd25UeXBlc2IG", + "cHJvdG8z")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] { @@ -39,6 +41,10 @@ namespace Google.Protobuf.WellKnownTypes { } } #region Messages + /// <summary> + /// `SourceContext` represents information about the source of a + /// protobuf element, like the file in which it is defined. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class SourceContext : pb::IMessage<SourceContext> { private static readonly pb::MessageParser<SourceContext> _parser = new pb::MessageParser<SourceContext>(() => new SourceContext()); @@ -66,8 +72,13 @@ namespace Google.Protobuf.WellKnownTypes { return new SourceContext(this); } + /// <summary>Field number for the "file_name" field.</summary> public const int FileNameFieldNumber = 1; private string fileName_ = ""; + /// <summary> + /// The path-qualified name of the .proto file that contained the associated + /// protobuf element. For example: `"google/protobuf/source.proto"`. + /// </summary> public string FileName { get { return fileName_; } set { diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs index 1e8a8236..a9961bea 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs @@ -11,10 +11,12 @@ namespace Google.Protobuf.WellKnownTypes { namespace Proto { + /// <summary>Holder for reflection information generated from google/protobuf/struct.proto</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Struct { #region Descriptor + /// <summary>File descriptor for google/protobuf/struct.proto</summary> public static pbr::FileDescriptor Descriptor { get { return descriptor; } } @@ -23,19 +25,19 @@ namespace Google.Protobuf.WellKnownTypes { static Struct() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "Chxnb29nbGUvcHJvdG9idWYvc3RydWN0LnByb3RvEg9nb29nbGUucHJvdG9i", - "dWYihAEKBlN0cnVjdBIzCgZmaWVsZHMYASADKAsyIy5nb29nbGUucHJvdG9i", - "dWYuU3RydWN0LkZpZWxkc0VudHJ5GkUKC0ZpZWxkc0VudHJ5EgsKA2tleRgB", - "IAEoCRIlCgV2YWx1ZRgCIAEoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZToC", - "OAEi6gEKBVZhbHVlEjAKCm51bGxfdmFsdWUYASABKA4y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gLMhouZ29vZ2xlLnByb3RvYnVmLkxpc3RW", + "YWx1ZUgAQgYKBGtpbmQiMwoJTGlzdFZhbHVlEiYKBnZhbHVlcxgBIAMoCzIW", + "Lmdvb2dsZS5wcm90b2J1Zi5WYWx1ZSobCglOdWxsVmFsdWUSDgoKTlVMTF9W", + "QUxVRRAAQk4KE2NvbS5nb29nbGUucHJvdG9idWZCC1N0cnVjdFByb3RvUAGg", + "AQGiAgNHUEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnBy", "b3RvMw==")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbr::FileDescriptor[] { }, @@ -50,13 +52,30 @@ namespace Google.Protobuf.WellKnownTypes { } } #region Enums + /// <summary> + /// `NullValue` is a singleton enumeration to represent the null value for the + /// `Value` type union. + /// The JSON representation for `NullValue` is JSON `null`. + /// </summary> public enum NullValue { + /// <summary> + /// Null value. + /// </summary> NULL_VALUE = 0, } #endregion #region Messages + /// <summary> + /// `Struct` represents a structured data value, consisting of fields + /// which map to dynamically typed values. In some languages, `Struct` + /// might be supported by a native representation. For example, in + /// scripting languages like JS a struct is represented as an + /// object. The details of that representation are described together + /// with the proto support for the language. + /// The JSON representation for `Struct` is JSON object. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Struct : pb::IMessage<Struct> { private static readonly pb::MessageParser<Struct> _parser = new pb::MessageParser<Struct>(() => new Struct()); @@ -84,10 +103,14 @@ namespace Google.Protobuf.WellKnownTypes { return new Struct(this); } + /// <summary>Field number for the "fields" field.</summary> public const int FieldsFieldNumber = 1; private static readonly pbc::MapField<string, global::Google.Protobuf.WellKnownTypes.Value>.Codec _map_fields_codec = new pbc::MapField<string, global::Google.Protobuf.WellKnownTypes.Value>.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Value.Parser), 10); private readonly pbc::MapField<string, global::Google.Protobuf.WellKnownTypes.Value> fields_ = new pbc::MapField<string, global::Google.Protobuf.WellKnownTypes.Value>(); + /// <summary> + /// Map of dynamically typed values. + /// </summary> public pbc::MapField<string, global::Google.Protobuf.WellKnownTypes.Value> Fields { get { return fields_; } } @@ -151,6 +174,13 @@ namespace Google.Protobuf.WellKnownTypes { } + /// <summary> + /// `Value` represents a dynamically typed value which can be either + /// null, a number, a string, a boolean, a recursive struct value, or a + /// list of values. A producer of value is expected to set one of that + /// variants, absence of any variant indicates an error. + /// The JSON representation for `Value` is JSON value. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Value : pb::IMessage<Value> { private static readonly pb::MessageParser<Value> _parser = new pb::MessageParser<Value>(() => new Value()); @@ -198,7 +228,11 @@ namespace Google.Protobuf.WellKnownTypes { return new Value(this); } + /// <summary>Field number for the "null_value" field.</summary> public const int NullValueFieldNumber = 1; + /// <summary> + /// Represents a null value. + /// </summary> public global::Google.Protobuf.WellKnownTypes.NullValue NullValue { get { return kindCase_ == KindOneofCase.NullValue ? (global::Google.Protobuf.WellKnownTypes.NullValue) kind_ : global::Google.Protobuf.WellKnownTypes.NullValue.NULL_VALUE; } set { @@ -207,7 +241,11 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// <summary>Field number for the "number_value" field.</summary> public const int NumberValueFieldNumber = 2; + /// <summary> + /// Represents a double value. + /// </summary> public double NumberValue { get { return kindCase_ == KindOneofCase.NumberValue ? (double) kind_ : 0D; } set { @@ -216,7 +254,11 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// <summary>Field number for the "string_value" field.</summary> public const int StringValueFieldNumber = 3; + /// <summary> + /// Represents a string value. + /// </summary> public string StringValue { get { return kindCase_ == KindOneofCase.StringValue ? (string) kind_ : ""; } set { @@ -225,7 +267,11 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// <summary>Field number for the "bool_value" field.</summary> public const int BoolValueFieldNumber = 4; + /// <summary> + /// Represents a boolean value. + /// </summary> public bool BoolValue { get { return kindCase_ == KindOneofCase.BoolValue ? (bool) kind_ : false; } set { @@ -234,7 +280,11 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// <summary>Field number for the "struct_value" field.</summary> public const int StructValueFieldNumber = 5; + /// <summary> + /// Represents a structured value. + /// </summary> public global::Google.Protobuf.WellKnownTypes.Struct StructValue { get { return kindCase_ == KindOneofCase.StructValue ? (global::Google.Protobuf.WellKnownTypes.Struct) kind_ : null; } set { @@ -243,7 +293,11 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// <summary>Field number for the "list_value" field.</summary> public const int ListValueFieldNumber = 6; + /// <summary> + /// Represents a repeated `Value`. + /// </summary> public global::Google.Protobuf.WellKnownTypes.ListValue ListValue { get { return kindCase_ == KindOneofCase.ListValue ? (global::Google.Protobuf.WellKnownTypes.ListValue) kind_ : null; } set { @@ -253,6 +307,7 @@ namespace Google.Protobuf.WellKnownTypes { } private object kind_; + /// <summary>Enum of possible cases for the "kind" oneof.</summary> public enum KindOneofCase { None = 0, NullValue = 1, @@ -432,6 +487,10 @@ namespace Google.Protobuf.WellKnownTypes { } + /// <summary> + /// `ListValue` is a wrapper around a repeated field of values. + /// The JSON representation for `ListValue` is JSON array. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class ListValue : pb::IMessage<ListValue> { private static readonly pb::MessageParser<ListValue> _parser = new pb::MessageParser<ListValue>(() => new ListValue()); @@ -459,10 +518,14 @@ namespace Google.Protobuf.WellKnownTypes { return new ListValue(this); } + /// <summary>Field number for the "values" field.</summary> public const int ValuesFieldNumber = 1; private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Value> _repeated_values_codec = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.WellKnownTypes.Value.Parser); private readonly pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Value> values_ = new pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Value>(); + /// <summary> + /// Repeated field of dynamically typed values. + /// </summary> public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Value> Values { get { return values_; } } diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs index d7c0954f..f372f8fd 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs @@ -11,10 +11,12 @@ namespace Google.Protobuf.WellKnownTypes { namespace Proto { + /// <summary>Holder for reflection information generated from google/protobuf/timestamp.proto</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Timestamp { #region Descriptor + /// <summary>File descriptor for google/protobuf/timestamp.proto</summary> public static pbr::FileDescriptor Descriptor { get { return descriptor; } } @@ -23,10 +25,10 @@ namespace Google.Protobuf.WellKnownTypes { static Timestamp() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "Ch9nb29nbGUvcHJvdG9idWYvdGltZXN0YW1wLnByb3RvEg9nb29nbGUucHJv", - "dG9idWYiKwoJVGltZXN0YW1wEg8KB3NlY29uZHMYASABKAMSDQoFbmFub3MY", - "AiABKAVCUQoTY29tLmdvb2dsZS5wcm90b2J1ZkIOVGltZXN0YW1wUHJvdG9Q", - "AaABAaICA0dQQqoCHkdvb2dsZS5Qcm90b2J1Zi5XZWxsS25vd25UeXBlc2IG", + "Ch9nb29nbGUvcHJvdG9idWYvdGltZXN0YW1wLnByb3RvEg9nb29nbGUucHJv", + "dG9idWYiKwoJVGltZXN0YW1wEg8KB3NlY29uZHMYASABKAMSDQoFbmFub3MY", + "AiABKAVCUQoTY29tLmdvb2dsZS5wcm90b2J1ZkIOVGltZXN0YW1wUHJvdG9Q", + "AaABAaICA0dQQqoCHkdvb2dsZS5Qcm90b2J1Zi5XZWxsS25vd25UeXBlc2IG", "cHJvdG8z")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbr::FileDescriptor[] { }, @@ -39,6 +41,47 @@ namespace Google.Protobuf.WellKnownTypes { } } #region Messages + /// <summary> + /// A Timestamp represents a point in time independent of any time zone + /// or calendar, represented as seconds and fractions of seconds at + /// nanosecond resolution in UTC Epoch time. It is encoded using the + /// Proleptic Gregorian Calendar which extends the Gregorian calendar + /// backwards to year one. It is encoded assuming all minutes are 60 + /// seconds long, i.e. leap seconds are "smeared" so that no leap second + /// table is needed for interpretation. Range is from + /// 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. + /// By restricting to that range, we ensure that we can convert to + /// and from RFC 3339 date strings. + /// See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt). + /// Example 1: Compute Timestamp from POSIX `time()`. + /// Timestamp timestamp; + /// timestamp.set_seconds(time(NULL)); + /// timestamp.set_nanos(0); + /// Example 2: Compute Timestamp from POSIX `gettimeofday()`. + /// struct timeval tv; + /// gettimeofday(&tv, NULL); + /// Timestamp timestamp; + /// timestamp.set_seconds(tv.tv_sec); + /// timestamp.set_nanos(tv.tv_usec * 1000); + /// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + /// FILETIME ft; + /// GetSystemTimeAsFileTime(&ft); + /// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + /// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + /// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + /// Timestamp timestamp; + /// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + /// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + /// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + /// long millis = System.currentTimeMillis(); + /// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + /// .setNanos((int) ((millis % 1000) * 1000000)).build(); + /// Example 5: Compute Timestamp from current time in Python. + /// now = time.time() + /// seconds = int(now) + /// nanos = int((now - seconds) * 10**9) + /// timestamp = Timestamp(seconds=seconds, nanos=nanos) + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Timestamp : pb::IMessage<Timestamp> { private static readonly pb::MessageParser<Timestamp> _parser = new pb::MessageParser<Timestamp>(() => new Timestamp()); @@ -67,8 +110,14 @@ namespace Google.Protobuf.WellKnownTypes { return new Timestamp(this); } + /// <summary>Field number for the "seconds" field.</summary> public const int SecondsFieldNumber = 1; private long seconds_; + /// <summary> + /// Represents seconds of UTC time since Unix epoch + /// 1970-01-01T00:00:00Z. Must be from from 0001-01-01T00:00:00Z to + /// 9999-12-31T23:59:59Z inclusive. + /// </summary> public long Seconds { get { return seconds_; } set { @@ -76,8 +125,15 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// <summary>Field number for the "nanos" field.</summary> public const int NanosFieldNumber = 2; private int nanos_; + /// <summary> + /// Non-negative fractions of a second at nanosecond resolution. Negative + /// second values with fractions must still have non-negative nanos values + /// that count forward in time. Must be from 0 to 999,999,999 + /// inclusive. + /// </summary> public int Nanos { get { return nanos_; } set { diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs index ff2ecc57..3be90853 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs @@ -11,10 +11,12 @@ namespace Google.Protobuf.WellKnownTypes { namespace Proto { + /// <summary>Holder for reflection information generated from google/protobuf/type.proto</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Type { #region Descriptor + /// <summary>File descriptor for google/protobuf/type.proto</summary> public static pbr::FileDescriptor Descriptor { get { return descriptor; } } @@ -23,43 +25,46 @@ namespace Google.Protobuf.WellKnownTypes { static Type() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "Chpnb29nbGUvcHJvdG9idWYvdHlwZS5wcm90bxIPZ29vZ2xlLnByb3RvYnVm", - "Ghlnb29nbGUvcHJvdG9idWYvYW55Ln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RZUEVfU0lOVDY0EBIidAoLQ2FyZGluYWxpdHkS", - "FwoTQ0FSRElOQUxJVFlfVU5LTk9XThAAEhgKFENBUkRJTkFMSVRZX09QVElP", - "TkFMEAESGAoUQ0FSRElOQUxJVFlfUkVRVUlSRUQQAhIYChRDQVJESU5BTElU", - "WV9SRVBFQVRFRBADIqUBCgRFbnVtEgwKBG5hbWUYASABKAkSLQoJZW51bXZh", - "bHVlGAIgAygLMhouZ29vZ2xlLnByb3RvYnVmLkVudW1WYWx1ZRIoCgdvcHRp", - "b25zGAMgAygLMhcuZ29vZ2xlLnByb3RvYnVmLk9wdGlvbhI2Cg5zb3VyY2Vf", - "Y29udGV4dBgEIAEoCzIeLmdvb2dsZS5wcm90b2J1Zi5Tb3VyY2VDb250ZXh0", - "IlMKCUVudW1WYWx1ZRIMCgRuYW1lGAEgASgJEg4KBm51bWJlchgCIAEoBRIo", - "CgdvcHRpb25zGAMgAygLMhcuZ29vZ2xlLnByb3RvYnVmLk9wdGlvbiI7CgZP", - "cHRpb24SDAoEbmFtZRgBIAEoCRIjCgV2YWx1ZRgCIAEoCzIULmdvb2dsZS5w", - "cm90b2J1Zi5BbnlCSQoTY29tLmdvb2dsZS5wcm90b2J1ZkIJVHlwZVByb3Rv", - "UAGiAgNHUEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnBy", - "b3RvMw==")); + "Chpnb29nbGUvcHJvdG9idWYvdHlwZS5wcm90bxIPZ29vZ2xlLnByb3RvYnVm", + "Ghlnb29nbGUvcHJvdG9idWYvYW55LnByb3RvGiRnb29nbGUvcHJvdG9idWYv", + "c291cmNlX2NvbnRleHQucHJvdG8i1wEKBFR5cGUSDAoEbmFtZRgBIAEoCRIm", + "CgZmaWVsZHMYAiADKAsyFi5nb29nbGUucHJvdG9idWYuRmllbGQSDgoGb25l", + "b2ZzGAMgAygJEigKB29wdGlvbnMYBCADKAsyFy5nb29nbGUucHJvdG9idWYu", + "T3B0aW9uEjYKDn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FMSVRZX1JFUVVJUkVEEAISGAoUQ0FSRElOQUxJVFlfUkVQRUFURUQQAyLO", + "AQoERW51bRIMCgRuYW1lGAEgASgJEi0KCWVudW12YWx1ZRgCIAMoCzIaLmdv", + "b2dsZS5wcm90b2J1Zi5FbnVtVmFsdWUSKAoHb3B0aW9ucxgDIAMoCzIXLmdv", + "b2dsZS5wcm90b2J1Zi5PcHRpb24SNgoOc291cmNlX2NvbnRleHQYBCABKAsy", + "Hi5nb29nbGUucHJvdG9idWYuU291cmNlQ29udGV4dBInCgZzeW50YXgYBSAB", + "KA4yFy5nb29nbGUucHJvdG9idWYuU3ludGF4IlMKCUVudW1WYWx1ZRIMCgRu", + "YW1lGAEgASgJEg4KBm51bWJlchgCIAEoBRIoCgdvcHRpb25zGAMgAygLMhcu", + "Z29vZ2xlLnByb3RvYnVmLk9wdGlvbiI7CgZPcHRpb24SDAoEbmFtZRgBIAEo", + "CRIjCgV2YWx1ZRgCIAEoCzIULmdvb2dsZS5wcm90b2J1Zi5BbnkqLgoGU3lu", + "dGF4EhEKDVNZTlRBWF9QUk9UTzIQABIRCg1TWU5UQVhfUFJPVE8zEAFCTAoT", + "Y29tLmdvb2dsZS5wcm90b2J1ZkIJVHlwZVByb3RvUAGgAQGiAgNHUEKqAh5H", + "b29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw==")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.Proto.Any.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.SourceContext.Descriptor, }, - new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] { - new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Type), new[]{ "Name", "Fields", "Oneofs", "Options", "SourceContext" }, null, null, null), - new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Field), new[]{ "Kind", "Cardinality", "Number", "Name", "TypeUrl", "OneofIndex", "Packed", "Options" }, null, new[]{ typeof(global::Google.Protobuf.WellKnownTypes.Field.Types.Kind), typeof(global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality) }, null), - new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Enum), new[]{ "Name", "Enumvalue", "Options", "SourceContext" }, null, null, null), + new pbr::GeneratedCodeInfo(new[] {typeof(global::Google.Protobuf.WellKnownTypes.Syntax), }, new pbr::GeneratedCodeInfo[] { + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Type), new[]{ "Name", "Fields", "Oneofs", "Options", "SourceContext", "Syntax" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Field), new[]{ "Kind", "Cardinality", "Number", "Name", "TypeUrl", "OneofIndex", "Packed", "Options", "JsonName" }, null, new[]{ typeof(global::Google.Protobuf.WellKnownTypes.Field.Types.Kind), typeof(global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality) }, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Enum), new[]{ "Name", "Enumvalue", "Options", "SourceContext", "Syntax" }, null, null, null), new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.EnumValue), new[]{ "Name", "Number", "Options" }, null, null, null), new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Option), new[]{ "Name", "Value" }, null, null, null) })); @@ -68,7 +73,27 @@ namespace Google.Protobuf.WellKnownTypes { } } + #region Enums + /// <summary> + /// Syntax specifies the syntax in which a service element was defined. + /// </summary> + public enum Syntax { + /// <summary> + /// Syntax "proto2" + /// </summary> + SYNTAX_PROTO2 = 0, + /// <summary> + /// Syntax "proto3" + /// </summary> + SYNTAX_PROTO3 = 1, + } + + #endregion + #region Messages + /// <summary> + /// A light-weight descriptor for a proto message type. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Type : pb::IMessage<Type> { private static readonly pb::MessageParser<Type> _parser = new pb::MessageParser<Type>(() => new Type()); @@ -94,14 +119,19 @@ namespace Google.Protobuf.WellKnownTypes { oneofs_ = other.oneofs_.Clone(); options_ = other.options_.Clone(); SourceContext = other.sourceContext_ != null ? other.SourceContext.Clone() : null; + syntax_ = other.syntax_; } public Type Clone() { return new Type(this); } + /// <summary>Field number for the "name" field.</summary> public const int NameFieldNumber = 1; private string name_ = ""; + /// <summary> + /// The fully qualified message name. + /// </summary> public string Name { get { return name_; } set { @@ -109,32 +139,48 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// <summary>Field number for the "fields" field.</summary> public const int FieldsFieldNumber = 2; private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Field> _repeated_fields_codec = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Field.Parser); private readonly pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Field> fields_ = new pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Field>(); + /// <summary> + /// The list of fields. + /// </summary> public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Field> Fields { get { return fields_; } } + /// <summary>Field number for the "oneofs" field.</summary> public const int OneofsFieldNumber = 3; private static readonly pb::FieldCodec<string> _repeated_oneofs_codec = pb::FieldCodec.ForString(26); private readonly pbc::RepeatedField<string> oneofs_ = new pbc::RepeatedField<string>(); + /// <summary> + /// The list of oneof definitions. + /// </summary> public pbc::RepeatedField<string> Oneofs { get { return oneofs_; } } + /// <summary>Field number for the "options" field.</summary> public const int OptionsFieldNumber = 4; private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Option> _repeated_options_codec = pb::FieldCodec.ForMessage(34, global::Google.Protobuf.WellKnownTypes.Option.Parser); private readonly pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> options_ = new pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option>(); + /// <summary> + /// The proto options. + /// </summary> public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> Options { get { return options_; } } + /// <summary>Field number for the "source_context" field.</summary> public const int SourceContextFieldNumber = 5; private global::Google.Protobuf.WellKnownTypes.SourceContext sourceContext_; + /// <summary> + /// The source context. + /// </summary> public global::Google.Protobuf.WellKnownTypes.SourceContext SourceContext { get { return sourceContext_; } set { @@ -142,6 +188,19 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// <summary>Field number for the "syntax" field.</summary> + public const int SyntaxFieldNumber = 6; + private global::Google.Protobuf.WellKnownTypes.Syntax syntax_ = global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2; + /// <summary> + /// The source syntax. + /// </summary> + public global::Google.Protobuf.WellKnownTypes.Syntax Syntax { + get { return syntax_; } + set { + syntax_ = value; + } + } + public override bool Equals(object other) { return Equals(other as Type); } @@ -158,6 +217,7 @@ namespace Google.Protobuf.WellKnownTypes { if(!oneofs_.Equals(other.oneofs_)) return false; if(!options_.Equals(other.options_)) return false; if (!object.Equals(SourceContext, other.SourceContext)) return false; + if (Syntax != other.Syntax) return false; return true; } @@ -168,6 +228,7 @@ namespace Google.Protobuf.WellKnownTypes { hash ^= oneofs_.GetHashCode(); hash ^= options_.GetHashCode(); if (sourceContext_ != null) hash ^= SourceContext.GetHashCode(); + if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) hash ^= Syntax.GetHashCode(); return hash; } @@ -187,6 +248,10 @@ namespace Google.Protobuf.WellKnownTypes { output.WriteRawTag(42); output.WriteMessage(SourceContext); } + if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) { + output.WriteRawTag(48); + output.WriteEnum((int) Syntax); + } } public int CalculateSize() { @@ -200,6 +265,9 @@ namespace Google.Protobuf.WellKnownTypes { if (sourceContext_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(SourceContext); } + if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Syntax); + } return size; } @@ -219,6 +287,9 @@ namespace Google.Protobuf.WellKnownTypes { } SourceContext.MergeFrom(other.SourceContext); } + if (other.Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) { + Syntax = other.Syntax; + } } public void MergeFrom(pb::CodedInputStream input) { @@ -251,12 +322,19 @@ namespace Google.Protobuf.WellKnownTypes { input.ReadMessage(sourceContext_); break; } + case 48: { + syntax_ = (global::Google.Protobuf.WellKnownTypes.Syntax) input.ReadEnum(); + break; + } } } } } + /// <summary> + /// Field represents a single field of a message type. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Field : pb::IMessage<Field> { private static readonly pb::MessageParser<Field> _parser = new pb::MessageParser<Field>(() => new Field()); @@ -285,14 +363,19 @@ namespace Google.Protobuf.WellKnownTypes { oneofIndex_ = other.oneofIndex_; packed_ = other.packed_; options_ = other.options_.Clone(); + jsonName_ = other.jsonName_; } public Field Clone() { return new Field(this); } + /// <summary>Field number for the "kind" field.</summary> public const int KindFieldNumber = 1; private global::Google.Protobuf.WellKnownTypes.Field.Types.Kind kind_ = global::Google.Protobuf.WellKnownTypes.Field.Types.Kind.TYPE_UNKNOWN; + /// <summary> + /// The field kind. + /// </summary> public global::Google.Protobuf.WellKnownTypes.Field.Types.Kind Kind { get { return kind_; } set { @@ -300,8 +383,12 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// <summary>Field number for the "cardinality" field.</summary> public const int CardinalityFieldNumber = 2; private global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality cardinality_ = global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality.CARDINALITY_UNKNOWN; + /// <summary> + /// The field cardinality, i.e. optional/required/repeated. + /// </summary> public global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality Cardinality { get { return cardinality_; } set { @@ -309,8 +396,12 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// <summary>Field number for the "number" field.</summary> public const int NumberFieldNumber = 3; private int number_; + /// <summary> + /// The proto field number. + /// </summary> public int Number { get { return number_; } set { @@ -318,8 +409,12 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// <summary>Field number for the "name" field.</summary> public const int NameFieldNumber = 4; private string name_ = ""; + /// <summary> + /// The field name. + /// </summary> public string Name { get { return name_; } set { @@ -327,8 +422,13 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// <summary>Field number for the "type_url" field.</summary> public const int TypeUrlFieldNumber = 6; private string typeUrl_ = ""; + /// <summary> + /// The type URL (without the scheme) when the type is MESSAGE or ENUM, + /// such as `type.googleapis.com/google.protobuf.Empty`. + /// </summary> public string TypeUrl { get { return typeUrl_; } set { @@ -336,8 +436,12 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// <summary>Field number for the "oneof_index" field.</summary> public const int OneofIndexFieldNumber = 7; private int oneofIndex_; + /// <summary> + /// Index in Type.oneofs. Starts at 1. Zero means no oneof mapping. + /// </summary> public int OneofIndex { get { return oneofIndex_; } set { @@ -345,8 +449,12 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// <summary>Field number for the "packed" field.</summary> public const int PackedFieldNumber = 8; private bool packed_; + /// <summary> + /// Whether to use alternative packed wire representation. + /// </summary> public bool Packed { get { return packed_; } set { @@ -354,14 +462,31 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// <summary>Field number for the "options" field.</summary> public const int OptionsFieldNumber = 9; private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Option> _repeated_options_codec = pb::FieldCodec.ForMessage(74, global::Google.Protobuf.WellKnownTypes.Option.Parser); private readonly pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> options_ = new pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option>(); + /// <summary> + /// The proto options. + /// </summary> public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> Options { get { return options_; } } + /// <summary>Field number for the "json_name" field.</summary> + public const int JsonNameFieldNumber = 10; + private string jsonName_ = ""; + /// <summary> + /// The JSON name for this field. + /// </summary> + public string JsonName { + get { return jsonName_; } + set { + jsonName_ = pb::Preconditions.CheckNotNull(value, "value"); + } + } + public override bool Equals(object other) { return Equals(other as Field); } @@ -381,6 +506,7 @@ namespace Google.Protobuf.WellKnownTypes { if (OneofIndex != other.OneofIndex) return false; if (Packed != other.Packed) return false; if(!options_.Equals(other.options_)) return false; + if (JsonName != other.JsonName) return false; return true; } @@ -394,6 +520,7 @@ namespace Google.Protobuf.WellKnownTypes { if (OneofIndex != 0) hash ^= OneofIndex.GetHashCode(); if (Packed != false) hash ^= Packed.GetHashCode(); hash ^= options_.GetHashCode(); + if (JsonName.Length != 0) hash ^= JsonName.GetHashCode(); return hash; } @@ -431,6 +558,10 @@ namespace Google.Protobuf.WellKnownTypes { output.WriteBool(Packed); } options_.WriteTo(output, _repeated_options_codec); + if (JsonName.Length != 0) { + output.WriteRawTag(82); + output.WriteString(JsonName); + } } public int CalculateSize() { @@ -457,6 +588,9 @@ namespace Google.Protobuf.WellKnownTypes { size += 1 + 1; } size += options_.CalculateSize(_repeated_options_codec); + if (JsonName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(JsonName); + } return size; } @@ -486,6 +620,9 @@ namespace Google.Protobuf.WellKnownTypes { Packed = other.Packed; } options_.Add(other.options_); + if (other.JsonName.Length != 0) { + JsonName = other.JsonName; + } } public void MergeFrom(pb::CodedInputStream input) { @@ -527,38 +664,120 @@ namespace Google.Protobuf.WellKnownTypes { options_.AddEntriesFrom(input, _repeated_options_codec); break; } + case 82: { + JsonName = input.ReadString(); + break; + } } } } #region Nested types + /// <summary>Container for nested types declared in the Field message type.</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Types { + /// <summary> + /// Kind represents a basic field type. + /// </summary> public enum Kind { + /// <summary> + /// Field type unknown. + /// </summary> TYPE_UNKNOWN = 0, + /// <summary> + /// Field type double. + /// </summary> TYPE_DOUBLE = 1, + /// <summary> + /// Field type float. + /// </summary> TYPE_FLOAT = 2, + /// <summary> + /// Field type int64. + /// </summary> TYPE_INT64 = 3, + /// <summary> + /// Field type uint64. + /// </summary> TYPE_UINT64 = 4, + /// <summary> + /// Field type int32. + /// </summary> TYPE_INT32 = 5, + /// <summary> + /// Field type fixed64. + /// </summary> TYPE_FIXED64 = 6, + /// <summary> + /// Field type fixed32. + /// </summary> TYPE_FIXED32 = 7, + /// <summary> + /// Field type bool. + /// </summary> TYPE_BOOL = 8, + /// <summary> + /// Field type string. + /// </summary> TYPE_STRING = 9, + /// <summary> + /// Field type group (deprecated proto2 type) + /// </summary> + TYPE_GROUP = 10, + /// <summary> + /// Field type message. + /// </summary> TYPE_MESSAGE = 11, + /// <summary> + /// Field type bytes. + /// </summary> TYPE_BYTES = 12, + /// <summary> + /// Field type uint32. + /// </summary> TYPE_UINT32 = 13, + /// <summary> + /// Field type enum. + /// </summary> TYPE_ENUM = 14, + /// <summary> + /// Field type sfixed32. + /// </summary> TYPE_SFIXED32 = 15, + /// <summary> + /// Field type sfixed64. + /// </summary> TYPE_SFIXED64 = 16, + /// <summary> + /// Field type sint32. + /// </summary> TYPE_SINT32 = 17, + /// <summary> + /// Field type sint64. + /// </summary> TYPE_SINT64 = 18, } + /// <summary> + /// Cardinality represents whether a field is optional, required, or + /// repeated. + /// </summary> public enum Cardinality { + /// <summary> + /// The field cardinality is unknown. Typically an error condition. + /// </summary> CARDINALITY_UNKNOWN = 0, + /// <summary> + /// For optional fields. + /// </summary> CARDINALITY_OPTIONAL = 1, + /// <summary> + /// For required fields. Not used for proto3. + /// </summary> CARDINALITY_REQUIRED = 2, + /// <summary> + /// For repeated fields. + /// </summary> CARDINALITY_REPEATED = 3, } @@ -567,6 +786,9 @@ namespace Google.Protobuf.WellKnownTypes { } + /// <summary> + /// Enum type definition. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Enum : pb::IMessage<Enum> { private static readonly pb::MessageParser<Enum> _parser = new pb::MessageParser<Enum>(() => new Enum()); @@ -591,14 +813,19 @@ namespace Google.Protobuf.WellKnownTypes { enumvalue_ = other.enumvalue_.Clone(); options_ = other.options_.Clone(); SourceContext = other.sourceContext_ != null ? other.SourceContext.Clone() : null; + syntax_ = other.syntax_; } public Enum Clone() { return new Enum(this); } + /// <summary>Field number for the "name" field.</summary> public const int NameFieldNumber = 1; private string name_ = ""; + /// <summary> + /// Enum type name. + /// </summary> public string Name { get { return name_; } set { @@ -606,24 +833,36 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// <summary>Field number for the "enumvalue" field.</summary> public const int EnumvalueFieldNumber = 2; private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.EnumValue> _repeated_enumvalue_codec = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.EnumValue.Parser); private readonly pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.EnumValue> enumvalue_ = new pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.EnumValue>(); + /// <summary> + /// Enum value definitions. + /// </summary> public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.EnumValue> Enumvalue { get { return enumvalue_; } } + /// <summary>Field number for the "options" field.</summary> public const int OptionsFieldNumber = 3; private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Option> _repeated_options_codec = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.WellKnownTypes.Option.Parser); private readonly pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> options_ = new pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option>(); + /// <summary> + /// Proto options for the enum type. + /// </summary> public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> Options { get { return options_; } } + /// <summary>Field number for the "source_context" field.</summary> public const int SourceContextFieldNumber = 4; private global::Google.Protobuf.WellKnownTypes.SourceContext sourceContext_; + /// <summary> + /// The source context. + /// </summary> public global::Google.Protobuf.WellKnownTypes.SourceContext SourceContext { get { return sourceContext_; } set { @@ -631,6 +870,19 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// <summary>Field number for the "syntax" field.</summary> + public const int SyntaxFieldNumber = 5; + private global::Google.Protobuf.WellKnownTypes.Syntax syntax_ = global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2; + /// <summary> + /// The source syntax. + /// </summary> + public global::Google.Protobuf.WellKnownTypes.Syntax Syntax { + get { return syntax_; } + set { + syntax_ = value; + } + } + public override bool Equals(object other) { return Equals(other as Enum); } @@ -646,6 +898,7 @@ namespace Google.Protobuf.WellKnownTypes { if(!enumvalue_.Equals(other.enumvalue_)) return false; if(!options_.Equals(other.options_)) return false; if (!object.Equals(SourceContext, other.SourceContext)) return false; + if (Syntax != other.Syntax) return false; return true; } @@ -655,6 +908,7 @@ namespace Google.Protobuf.WellKnownTypes { hash ^= enumvalue_.GetHashCode(); hash ^= options_.GetHashCode(); if (sourceContext_ != null) hash ^= SourceContext.GetHashCode(); + if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) hash ^= Syntax.GetHashCode(); return hash; } @@ -673,6 +927,10 @@ namespace Google.Protobuf.WellKnownTypes { output.WriteRawTag(34); output.WriteMessage(SourceContext); } + if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) { + output.WriteRawTag(40); + output.WriteEnum((int) Syntax); + } } public int CalculateSize() { @@ -685,6 +943,9 @@ namespace Google.Protobuf.WellKnownTypes { if (sourceContext_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(SourceContext); } + if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Syntax); + } return size; } @@ -703,6 +964,9 @@ namespace Google.Protobuf.WellKnownTypes { } SourceContext.MergeFrom(other.SourceContext); } + if (other.Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) { + Syntax = other.Syntax; + } } public void MergeFrom(pb::CodedInputStream input) { @@ -731,12 +995,19 @@ namespace Google.Protobuf.WellKnownTypes { input.ReadMessage(sourceContext_); break; } + case 40: { + syntax_ = (global::Google.Protobuf.WellKnownTypes.Syntax) input.ReadEnum(); + break; + } } } } } + /// <summary> + /// Enum value definition. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class EnumValue : pb::IMessage<EnumValue> { private static readonly pb::MessageParser<EnumValue> _parser = new pb::MessageParser<EnumValue>(() => new EnumValue()); @@ -766,8 +1037,12 @@ namespace Google.Protobuf.WellKnownTypes { return new EnumValue(this); } + /// <summary>Field number for the "name" field.</summary> public const int NameFieldNumber = 1; private string name_ = ""; + /// <summary> + /// Enum value name. + /// </summary> public string Name { get { return name_; } set { @@ -775,8 +1050,12 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// <summary>Field number for the "number" field.</summary> public const int NumberFieldNumber = 2; private int number_; + /// <summary> + /// Enum value number. + /// </summary> public int Number { get { return number_; } set { @@ -784,10 +1063,14 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// <summary>Field number for the "options" field.</summary> public const int OptionsFieldNumber = 3; private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Option> _repeated_options_codec = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.WellKnownTypes.Option.Parser); private readonly pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> options_ = new pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option>(); + /// <summary> + /// Proto options for the enum value. + /// </summary> public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> Options { get { return options_; } } @@ -883,6 +1166,9 @@ namespace Google.Protobuf.WellKnownTypes { } + /// <summary> + /// Proto option attached to messages/fields/enums etc. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Option : pb::IMessage<Option> { private static readonly pb::MessageParser<Option> _parser = new pb::MessageParser<Option>(() => new Option()); @@ -911,8 +1197,12 @@ namespace Google.Protobuf.WellKnownTypes { return new Option(this); } + /// <summary>Field number for the "name" field.</summary> public const int NameFieldNumber = 1; private string name_ = ""; + /// <summary> + /// Proto option name. + /// </summary> public string Name { get { return name_; } set { @@ -920,8 +1210,12 @@ namespace Google.Protobuf.WellKnownTypes { } } + /// <summary>Field number for the "value" field.</summary> public const int ValueFieldNumber = 2; private global::Google.Protobuf.WellKnownTypes.Any value_; + /// <summary> + /// Proto option value. + /// </summary> public global::Google.Protobuf.WellKnownTypes.Any Value { get { return value_; } set { diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Wrappers.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Wrappers.cs index 9ecaf47c..d26395f8 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Wrappers.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Wrappers.cs @@ -9,10 +9,12 @@ using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; namespace Google.Protobuf.WellKnownTypes { + /// <summary>Holder for reflection information generated from google/protobuf/wrappers.proto</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Wrappers { #region Descriptor + /// <summary>File descriptor for google/protobuf/wrappers.proto</summary> public static pbr::FileDescriptor Descriptor { get { return descriptor; } } @@ -21,15 +23,15 @@ namespace Google.Protobuf.WellKnownTypes { static Wrappers() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "Ch5nb29nbGUvcHJvdG9idWYvd3JhcHBlcnMucHJvdG8SD2dvb2dsZS5wcm90", - "b2J1ZiIcCgtEb3VibGVWYWx1ZRINCgV2YWx1ZRgBIAEoASIbCgpGbG9hdFZh", - "bHVlEg0KBXZhbHVlGAEgASgCIhsKCkludDY0VmFsdWUSDQoFdmFsdWUYASAB", - "KAMiHAoLVUludDY0VmFsdWUSDQoFdmFsdWUYASABKAQiGwoKSW50MzJWYWx1", - "ZRINCgV2YWx1ZRgBIAEoBSIcCgtVSW50MzJWYWx1ZRINCgV2YWx1ZRgBIAEo", - "DSIaCglCb29sVmFsdWUSDQoFdmFsdWUYASABKAgiHAoLU3RyaW5nVmFsdWUS", - "DQoFdmFsdWUYASABKAkiGwoKQnl0ZXNWYWx1ZRINCgV2YWx1ZRgBIAEoDEJN", - "ChNjb20uZ29vZ2xlLnByb3RvYnVmQg1XcmFwcGVyc1Byb3RvUAGiAgNHUEKq", - "Ah5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw==")); + "Ch5nb29nbGUvcHJvdG9idWYvd3JhcHBlcnMucHJvdG8SD2dvb2dsZS5wcm90", + "b2J1ZiIcCgtEb3VibGVWYWx1ZRINCgV2YWx1ZRgBIAEoASIbCgpGbG9hdFZh", + "bHVlEg0KBXZhbHVlGAEgASgCIhsKCkludDY0VmFsdWUSDQoFdmFsdWUYASAB", + "KAMiHAoLVUludDY0VmFsdWUSDQoFdmFsdWUYASABKAQiGwoKSW50MzJWYWx1", + "ZRINCgV2YWx1ZRgBIAEoBSIcCgtVSW50MzJWYWx1ZRINCgV2YWx1ZRgBIAEo", + "DSIaCglCb29sVmFsdWUSDQoFdmFsdWUYASABKAgiHAoLU3RyaW5nVmFsdWUS", + "DQoFdmFsdWUYASABKAkiGwoKQnl0ZXNWYWx1ZRINCgV2YWx1ZRgBIAEoDEJQ", + "ChNjb20uZ29vZ2xlLnByb3RvYnVmQg1XcmFwcGVyc1Byb3RvUAGgAQGiAgNH", + "UEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw==")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] { @@ -48,6 +50,10 @@ namespace Google.Protobuf.WellKnownTypes { } #region Messages + /// <summary> + /// Wrapper message for `double`. + /// The JSON representation for `DoubleValue` is JSON number. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class DoubleValue : pb::IMessage<DoubleValue> { private static readonly pb::MessageParser<DoubleValue> _parser = new pb::MessageParser<DoubleValue>(() => new DoubleValue()); @@ -75,8 +81,12 @@ namespace Google.Protobuf.WellKnownTypes { return new DoubleValue(this); } + /// <summary>Field number for the "value" field.</summary> public const int ValueFieldNumber = 1; private double value_; + /// <summary> + /// The double value. + /// </summary> public double Value { get { return value_; } set { @@ -150,6 +160,10 @@ namespace Google.Protobuf.WellKnownTypes { } + /// <summary> + /// Wrapper message for `float`. + /// The JSON representation for `FloatValue` is JSON number. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class FloatValue : pb::IMessage<FloatValue> { private static readonly pb::MessageParser<FloatValue> _parser = new pb::MessageParser<FloatValue>(() => new FloatValue()); @@ -177,8 +191,12 @@ namespace Google.Protobuf.WellKnownTypes { return new FloatValue(this); } + /// <summary>Field number for the "value" field.</summary> public const int ValueFieldNumber = 1; private float value_; + /// <summary> + /// The float value. + /// </summary> public float Value { get { return value_; } set { @@ -252,6 +270,10 @@ namespace Google.Protobuf.WellKnownTypes { } + /// <summary> + /// Wrapper message for `int64`. + /// The JSON representation for `Int64Value` is JSON string. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Int64Value : pb::IMessage<Int64Value> { private static readonly pb::MessageParser<Int64Value> _parser = new pb::MessageParser<Int64Value>(() => new Int64Value()); @@ -279,8 +301,12 @@ namespace Google.Protobuf.WellKnownTypes { return new Int64Value(this); } + /// <summary>Field number for the "value" field.</summary> public const int ValueFieldNumber = 1; private long value_; + /// <summary> + /// The int64 value. + /// </summary> public long Value { get { return value_; } set { @@ -354,6 +380,10 @@ namespace Google.Protobuf.WellKnownTypes { } + /// <summary> + /// Wrapper message for `uint64`. + /// The JSON representation for `UInt64Value` is JSON string. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class UInt64Value : pb::IMessage<UInt64Value> { private static readonly pb::MessageParser<UInt64Value> _parser = new pb::MessageParser<UInt64Value>(() => new UInt64Value()); @@ -381,8 +411,12 @@ namespace Google.Protobuf.WellKnownTypes { return new UInt64Value(this); } + /// <summary>Field number for the "value" field.</summary> public const int ValueFieldNumber = 1; private ulong value_; + /// <summary> + /// The uint64 value. + /// </summary> public ulong Value { get { return value_; } set { @@ -456,6 +490,10 @@ namespace Google.Protobuf.WellKnownTypes { } + /// <summary> + /// Wrapper message for `int32`. + /// The JSON representation for `Int32Value` is JSON number. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Int32Value : pb::IMessage<Int32Value> { private static readonly pb::MessageParser<Int32Value> _parser = new pb::MessageParser<Int32Value>(() => new Int32Value()); @@ -483,8 +521,12 @@ namespace Google.Protobuf.WellKnownTypes { return new Int32Value(this); } + /// <summary>Field number for the "value" field.</summary> public const int ValueFieldNumber = 1; private int value_; + /// <summary> + /// The int32 value. + /// </summary> public int Value { get { return value_; } set { @@ -558,6 +600,10 @@ namespace Google.Protobuf.WellKnownTypes { } + /// <summary> + /// Wrapper message for `uint32`. + /// The JSON representation for `UInt32Value` is JSON number. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class UInt32Value : pb::IMessage<UInt32Value> { private static readonly pb::MessageParser<UInt32Value> _parser = new pb::MessageParser<UInt32Value>(() => new UInt32Value()); @@ -585,8 +631,12 @@ namespace Google.Protobuf.WellKnownTypes { return new UInt32Value(this); } + /// <summary>Field number for the "value" field.</summary> public const int ValueFieldNumber = 1; private uint value_; + /// <summary> + /// The uint32 value. + /// </summary> public uint Value { get { return value_; } set { @@ -660,6 +710,10 @@ namespace Google.Protobuf.WellKnownTypes { } + /// <summary> + /// Wrapper message for `bool`. + /// The JSON representation for `BoolValue` is JSON `true` and `false`. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class BoolValue : pb::IMessage<BoolValue> { private static readonly pb::MessageParser<BoolValue> _parser = new pb::MessageParser<BoolValue>(() => new BoolValue()); @@ -687,8 +741,12 @@ namespace Google.Protobuf.WellKnownTypes { return new BoolValue(this); } + /// <summary>Field number for the "value" field.</summary> public const int ValueFieldNumber = 1; private bool value_; + /// <summary> + /// The bool value. + /// </summary> public bool Value { get { return value_; } set { @@ -762,6 +820,10 @@ namespace Google.Protobuf.WellKnownTypes { } + /// <summary> + /// Wrapper message for `string`. + /// The JSON representation for `StringValue` is JSON string. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class StringValue : pb::IMessage<StringValue> { private static readonly pb::MessageParser<StringValue> _parser = new pb::MessageParser<StringValue>(() => new StringValue()); @@ -789,8 +851,12 @@ namespace Google.Protobuf.WellKnownTypes { return new StringValue(this); } + /// <summary>Field number for the "value" field.</summary> public const int ValueFieldNumber = 1; private string value_ = ""; + /// <summary> + /// The string value. + /// </summary> public string Value { get { return value_; } set { @@ -864,6 +930,10 @@ namespace Google.Protobuf.WellKnownTypes { } + /// <summary> + /// Wrapper message for `bytes`. + /// The JSON representation for `BytesValue` is JSON string. + /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class BytesValue : pb::IMessage<BytesValue> { private static readonly pb::MessageParser<BytesValue> _parser = new pb::MessageParser<BytesValue>(() => new BytesValue()); @@ -891,8 +961,12 @@ namespace Google.Protobuf.WellKnownTypes { return new BytesValue(this); } + /// <summary>Field number for the "value" field.</summary> public const int ValueFieldNumber = 1; private pb::ByteString value_ = pb::ByteString.Empty; + /// <summary> + /// The bytes value. + /// </summary> public pb::ByteString Value { get { return value_; } set { diff --git a/generate_descriptor_proto.sh b/generate_descriptor_proto.sh index b6e6e07b..cd906896 100755 --- a/generate_descriptor_proto.sh +++ b/generate_descriptor_proto.sh @@ -92,3 +92,8 @@ do PROCESS_ROUND=$((PROCESS_ROUND + 1)) done cd .. + +if test -x objectivec/generate_descriptors_proto.sh; then + echo "Generating messages for objc." + objectivec/generate_descriptors_proto.sh $@ +fi diff --git a/objectivec/DevTools/full_mac_build.sh b/objectivec/DevTools/full_mac_build.sh index 2192b760..c38fce7c 100755 --- a/objectivec/DevTools/full_mac_build.sh +++ b/objectivec/DevTools/full_mac_build.sh @@ -202,9 +202,9 @@ if [[ "${DO_XCODE_IOS_TESTS}" == "yes" ]] ; then # Don't need to worry about form factors or retina/non retina; # just pick a mix of OS Versions and 32/64 bit. -destination "platform=iOS Simulator,name=iPhone 4s,OS=7.1" # 32bit - -destination "platform=iOS Simulator,name=iPhone 6,OS=8.3" # 64bit + -destination "platform=iOS Simulator,name=iPhone 6,OS=8.4" # 64bit -destination "platform=iOS Simulator,name=iPad 2,OS=7.1" # 32bit - -destination "platform=iOS Simulator,name=iPad Air,OS=8.3" # 64bit + -destination "platform=iOS Simulator,name=iPad Air,OS=8.4" # 64bit ) header "Doing Xcode iOS build/tests - Debug" "${XCODEBUILD_TEST_BASE_IOS[@]}" -configuration Debug test diff --git a/objectivec/GPBBootstrap.h b/objectivec/GPBBootstrap.h index 3dd2de83..c49c7e20 100644 --- a/objectivec/GPBBootstrap.h +++ b/objectivec/GPBBootstrap.h @@ -46,12 +46,20 @@ // Used in the generated code to give sizes to enums. int32_t was chosen based // on the fact that Protocol Buffers enums are limited to this range. -// The complexity and double definition here are so we get the nice name -// for objective C, but also define the name with a trailing underscore so -// the Swift bridge will have one where the names line up to support short -// names since they are scoped to the enum. -// https://developer.apple.com/library/ios/documentation/Swift/Conceptual/BuildingCocoaApps/InteractingWithCAPIs.html#//apple_ref/doc/uid/TP40014216-CH8-XID_11 -#define GPB_ENUM(X) NS_ENUM(int32_t, X) +#if !__has_feature(objc_fixed_enum) + #error All supported Xcode versions should support objc_fixed_enum. +#endif +// If the headers are imported into Objective-C++, we can run into an issue +// where the defintion of NS_ENUM (really CF_ENUM) changes based on the C++ +// standard that is in effect. If it isn't C++11 or higher, the definition +// doesn't allow us to forward declare. We work around this one case by +// providing a local definition. The default case has to use NS_ENUM for the +// magic that is Swift bridging of enums. +#if (__cplusplus && __cplusplus < 201103L) + #define GPB_ENUM(X) enum X : int32_t X; enum X : int32_t +#else + #define GPB_ENUM(X) NS_ENUM(int32_t, X) +#endif // GPB_ENUM_FWD_DECLARE is used for forward declaring enums, ex: // GPB_ENUM_FWD_DECLARE(Foo_Enum) // @property (nonatomic) Foo_Enum value; diff --git a/objectivec/GPBDictionary.h b/objectivec/GPBDictionary.h index cc4a698a..6961cfc3 100644 --- a/objectivec/GPBDictionary.h +++ b/objectivec/GPBDictionary.h @@ -360,30 +360,30 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; + (instancetype)dictionary; -+ (instancetype)dictionaryWithValue:(id)value - forKey:(uint32_t)key; -+ (instancetype)dictionaryWithValues:(const id GPB_UNSAFE_UNRETAINED [])values - forKeys:(const uint32_t [])keys - count:(NSUInteger)count; ++ (instancetype)dictionaryWithObject:(id)object + forKey:(uint32_t)key; ++ (instancetype)dictionaryWithObjects:(const id GPB_UNSAFE_UNRETAINED [])objects + forKeys:(const uint32_t [])keys + count:(NSUInteger)count; + (instancetype)dictionaryWithDictionary:(GPBUInt32ObjectDictionary *)dictionary; + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; -- (instancetype)initWithValues:(const id GPB_UNSAFE_UNRETAINED [])values - forKeys:(const uint32_t [])keys - count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithObjects:(const id GPB_UNSAFE_UNRETAINED [])objects + forKeys:(const uint32_t [])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; - (instancetype)initWithDictionary:(GPBUInt32ObjectDictionary *)dictionary; - (instancetype)initWithCapacity:(NSUInteger)numItems; -- (id)valueForKey:(uint32_t)key; +- (id)objectForKey:(uint32_t)key; -- (void)enumerateKeysAndValuesUsingBlock: - (void (^)(uint32_t key, id value, BOOL *stop))block; +- (void)enumerateKeysAndObjectsUsingBlock: + (void (^)(uint32_t key, id object, BOOL *stop))block; - (void)addEntriesFromDictionary:(GPBUInt32ObjectDictionary *)otherDictionary; -- (void)setValue:(id)value forKey:(uint32_t)key; +- (void)setObject:(id)object forKey:(uint32_t)key; -- (void)removeValueForKey:(uint32_t)aKey; +- (void)removeObjectForKey:(uint32_t)aKey; - (void)removeAll; @end @@ -706,30 +706,30 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; + (instancetype)dictionary; -+ (instancetype)dictionaryWithValue:(id)value - forKey:(int32_t)key; -+ (instancetype)dictionaryWithValues:(const id GPB_UNSAFE_UNRETAINED [])values - forKeys:(const int32_t [])keys - count:(NSUInteger)count; ++ (instancetype)dictionaryWithObject:(id)object + forKey:(int32_t)key; ++ (instancetype)dictionaryWithObjects:(const id GPB_UNSAFE_UNRETAINED [])objects + forKeys:(const int32_t [])keys + count:(NSUInteger)count; + (instancetype)dictionaryWithDictionary:(GPBInt32ObjectDictionary *)dictionary; + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; -- (instancetype)initWithValues:(const id GPB_UNSAFE_UNRETAINED [])values - forKeys:(const int32_t [])keys - count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithObjects:(const id GPB_UNSAFE_UNRETAINED [])objects + forKeys:(const int32_t [])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; - (instancetype)initWithDictionary:(GPBInt32ObjectDictionary *)dictionary; - (instancetype)initWithCapacity:(NSUInteger)numItems; -- (id)valueForKey:(int32_t)key; +- (id)objectForKey:(int32_t)key; -- (void)enumerateKeysAndValuesUsingBlock: - (void (^)(int32_t key, id value, BOOL *stop))block; +- (void)enumerateKeysAndObjectsUsingBlock: + (void (^)(int32_t key, id object, BOOL *stop))block; - (void)addEntriesFromDictionary:(GPBInt32ObjectDictionary *)otherDictionary; -- (void)setValue:(id)value forKey:(int32_t)key; +- (void)setObject:(id)object forKey:(int32_t)key; -- (void)removeValueForKey:(int32_t)aKey; +- (void)removeObjectForKey:(int32_t)aKey; - (void)removeAll; @end @@ -1052,30 +1052,30 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; + (instancetype)dictionary; -+ (instancetype)dictionaryWithValue:(id)value - forKey:(uint64_t)key; -+ (instancetype)dictionaryWithValues:(const id GPB_UNSAFE_UNRETAINED [])values - forKeys:(const uint64_t [])keys - count:(NSUInteger)count; ++ (instancetype)dictionaryWithObject:(id)object + forKey:(uint64_t)key; ++ (instancetype)dictionaryWithObjects:(const id GPB_UNSAFE_UNRETAINED [])objects + forKeys:(const uint64_t [])keys + count:(NSUInteger)count; + (instancetype)dictionaryWithDictionary:(GPBUInt64ObjectDictionary *)dictionary; + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; -- (instancetype)initWithValues:(const id GPB_UNSAFE_UNRETAINED [])values - forKeys:(const uint64_t [])keys - count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithObjects:(const id GPB_UNSAFE_UNRETAINED [])objects + forKeys:(const uint64_t [])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; - (instancetype)initWithDictionary:(GPBUInt64ObjectDictionary *)dictionary; - (instancetype)initWithCapacity:(NSUInteger)numItems; -- (id)valueForKey:(uint64_t)key; +- (id)objectForKey:(uint64_t)key; -- (void)enumerateKeysAndValuesUsingBlock: - (void (^)(uint64_t key, id value, BOOL *stop))block; +- (void)enumerateKeysAndObjectsUsingBlock: + (void (^)(uint64_t key, id object, BOOL *stop))block; - (void)addEntriesFromDictionary:(GPBUInt64ObjectDictionary *)otherDictionary; -- (void)setValue:(id)value forKey:(uint64_t)key; +- (void)setObject:(id)object forKey:(uint64_t)key; -- (void)removeValueForKey:(uint64_t)aKey; +- (void)removeObjectForKey:(uint64_t)aKey; - (void)removeAll; @end @@ -1398,30 +1398,30 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; + (instancetype)dictionary; -+ (instancetype)dictionaryWithValue:(id)value - forKey:(int64_t)key; -+ (instancetype)dictionaryWithValues:(const id GPB_UNSAFE_UNRETAINED [])values - forKeys:(const int64_t [])keys - count:(NSUInteger)count; ++ (instancetype)dictionaryWithObject:(id)object + forKey:(int64_t)key; ++ (instancetype)dictionaryWithObjects:(const id GPB_UNSAFE_UNRETAINED [])objects + forKeys:(const int64_t [])keys + count:(NSUInteger)count; + (instancetype)dictionaryWithDictionary:(GPBInt64ObjectDictionary *)dictionary; + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; -- (instancetype)initWithValues:(const id GPB_UNSAFE_UNRETAINED [])values - forKeys:(const int64_t [])keys - count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithObjects:(const id GPB_UNSAFE_UNRETAINED [])objects + forKeys:(const int64_t [])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; - (instancetype)initWithDictionary:(GPBInt64ObjectDictionary *)dictionary; - (instancetype)initWithCapacity:(NSUInteger)numItems; -- (id)valueForKey:(int64_t)key; +- (id)objectForKey:(int64_t)key; -- (void)enumerateKeysAndValuesUsingBlock: - (void (^)(int64_t key, id value, BOOL *stop))block; +- (void)enumerateKeysAndObjectsUsingBlock: + (void (^)(int64_t key, id object, BOOL *stop))block; - (void)addEntriesFromDictionary:(GPBInt64ObjectDictionary *)otherDictionary; -- (void)setValue:(id)value forKey:(int64_t)key; +- (void)setObject:(id)object forKey:(int64_t)key; -- (void)removeValueForKey:(int64_t)aKey; +- (void)removeObjectForKey:(int64_t)aKey; - (void)removeAll; @end @@ -1744,30 +1744,30 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSUInteger count; + (instancetype)dictionary; -+ (instancetype)dictionaryWithValue:(id)value - forKey:(BOOL)key; -+ (instancetype)dictionaryWithValues:(const id GPB_UNSAFE_UNRETAINED [])values - forKeys:(const BOOL [])keys - count:(NSUInteger)count; ++ (instancetype)dictionaryWithObject:(id)object + forKey:(BOOL)key; ++ (instancetype)dictionaryWithObjects:(const id GPB_UNSAFE_UNRETAINED [])objects + forKeys:(const BOOL [])keys + count:(NSUInteger)count; + (instancetype)dictionaryWithDictionary:(GPBBoolObjectDictionary *)dictionary; + (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; -- (instancetype)initWithValues:(const id GPB_UNSAFE_UNRETAINED [])values - forKeys:(const BOOL [])keys - count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithObjects:(const id GPB_UNSAFE_UNRETAINED [])objects + forKeys:(const BOOL [])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; - (instancetype)initWithDictionary:(GPBBoolObjectDictionary *)dictionary; - (instancetype)initWithCapacity:(NSUInteger)numItems; -- (id)valueForKey:(BOOL)key; +- (id)objectForKey:(BOOL)key; -- (void)enumerateKeysAndValuesUsingBlock: - (void (^)(BOOL key, id value, BOOL *stop))block; +- (void)enumerateKeysAndObjectsUsingBlock: + (void (^)(BOOL key, id object, BOOL *stop))block; - (void)addEntriesFromDictionary:(GPBBoolObjectDictionary *)otherDictionary; -- (void)setValue:(id)value forKey:(BOOL)key; +- (void)setObject:(id)object forKey:(BOOL)key; -- (void)removeValueForKey:(BOOL)aKey; +- (void)removeObjectForKey:(BOOL)aKey; - (void)removeAll; @end @@ -2107,13 +2107,13 @@ NS_ASSUME_NONNULL_END //%DICTIONARY_KEY_TO_POD_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, Double, double) //%DICTIONARY_KEY_TO_ENUM_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, Enum, int32_t) //%PDDM-DEFINE DICTIONARY_KEY_TO_POD_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, VALUE_NAME, VALUE_TYPE) -//%DICTIONARY_COMMON_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, VALUE_NAME, VALUE_TYPE, POD) +//%DICTIONARY_COMMON_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, VALUE_NAME, VALUE_TYPE, POD, value) //%PDDM-DEFINE DICTIONARY_POD_KEY_TO_OBJECT_INTERFACE(KEY_NAME, KEY_TYPE, VALUE_NAME, VALUE_TYPE) -//%DICTIONARY_COMMON_INTERFACE(KEY_NAME, KEY_TYPE, , POD, VALUE_NAME, VALUE_TYPE, OBJECT) +//%DICTIONARY_COMMON_INTERFACE(KEY_NAME, KEY_TYPE, , POD, VALUE_NAME, VALUE_TYPE, OBJECT, object) //%PDDM-DEFINE VALUE_FOR_KEY_POD(KEY_TYPE, VALUE_TYPE) //%- (BOOL)valueForKey:(KEY_TYPE)key value:(nullable VALUE_TYPE *)value; //%PDDM-DEFINE VALUE_FOR_KEY_OBJECT(KEY_TYPE, VALUE_TYPE) -//%- (VALUE_TYPE)valueForKey:(KEY_TYPE)key; +//%- (VALUE_TYPE)objectForKey:(KEY_TYPE)key; //%PDDM-DEFINE VALUE_FOR_KEY_Enum(KEY_TYPE, VALUE_TYPE) //%VALUE_FOR_KEY_POD(KEY_TYPE, VALUE_TYPE) //%PDDM-DEFINE ARRAY_ARG_MODIFIERPOD() @@ -2122,7 +2122,7 @@ NS_ASSUME_NONNULL_END // Nothing //%PDDM-DEFINE ARRAY_ARG_MODIFIEROBJECT() //%GPB_UNSAFE_UNRETAINED ## -//%PDDM-DEFINE DICTIONARY_COMMON_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, VALUE_NAME, VALUE_TYPE, VHELPER) +//%PDDM-DEFINE DICTIONARY_COMMON_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, VALUE_NAME, VALUE_TYPE, VHELPER, VNAME) //%#pragma mark - KEY_NAME -> VALUE_NAME //% //%@interface GPB##KEY_NAME##VALUE_NAME##Dictionary : NSObject <NSCopying> @@ -2130,25 +2130,25 @@ NS_ASSUME_NONNULL_END //%@property(nonatomic, readonly) NSUInteger count; //% //%+ (instancetype)dictionary; -//%+ (instancetype)dictionaryWithValue:(VALUE_TYPE)value -//% forKey:(KEY_TYPE##KisP$S##KisP)key; -//%+ (instancetype)dictionaryWithValues:(const VALUE_TYPE ARRAY_ARG_MODIFIER##VHELPER()[])values -//% forKeys:(const KEY_TYPE##KisP$S##KisP ARRAY_ARG_MODIFIER##KHELPER()[])keys -//% count:(NSUInteger)count; +//%+ (instancetype)dictionaryWith##VNAME$u##:(VALUE_TYPE)##VNAME +//% ##VNAME$S## forKey:(KEY_TYPE##KisP$S##KisP)key; +//%+ (instancetype)dictionaryWith##VNAME$u##s:(const VALUE_TYPE ARRAY_ARG_MODIFIER##VHELPER()[])##VNAME##s +//% ##VNAME$S## forKeys:(const KEY_TYPE##KisP$S##KisP ARRAY_ARG_MODIFIER##KHELPER()[])keys +//% ##VNAME$S## count:(NSUInteger)count; //%+ (instancetype)dictionaryWithDictionary:(GPB##KEY_NAME##VALUE_NAME##Dictionary *)dictionary; //%+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; //% -//%- (instancetype)initWithValues:(const VALUE_TYPE ARRAY_ARG_MODIFIER##VHELPER()[])values -//% forKeys:(const KEY_TYPE##KisP$S##KisP ARRAY_ARG_MODIFIER##KHELPER()[])keys -//% count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; +//%- (instancetype)initWith##VNAME$u##s:(const VALUE_TYPE ARRAY_ARG_MODIFIER##VHELPER()[])##VNAME##s +//% ##VNAME$S## forKeys:(const KEY_TYPE##KisP$S##KisP ARRAY_ARG_MODIFIER##KHELPER()[])keys +//% ##VNAME$S## count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; //%- (instancetype)initWithDictionary:(GPB##KEY_NAME##VALUE_NAME##Dictionary *)dictionary; //%- (instancetype)initWithCapacity:(NSUInteger)numItems; //% -//%DICTIONARY_IMMUTABLE_INTERFACE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, VHELPER) +//%DICTIONARY_IMMUTABLE_INTERFACE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, VHELPER, VNAME) //% //%- (void)addEntriesFromDictionary:(GPB##KEY_NAME##VALUE_NAME##Dictionary *)otherDictionary; //% -//%DICTIONARY_MUTABLE_INTERFACE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, VHELPER) +//%DICTIONARY_MUTABLE_INTERFACE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, VHELPER, VNAME) //% //%@end //% @@ -2189,7 +2189,7 @@ NS_ASSUME_NONNULL_END //%// is not a valid enumerator as defined by validationFunc. If the actual value is //%// desired, use "raw" version of the method. //% -//%DICTIONARY_IMMUTABLE_INTERFACE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, VHELPER) +//%DICTIONARY_IMMUTABLE_INTERFACE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, VHELPER, value) //% //%// These methods bypass the validationFunc to provide access to values that were not //%// known at the time the binary was compiled. @@ -2206,21 +2206,21 @@ NS_ASSUME_NONNULL_END //%// to the default value. Use the rawValue methods below to assign non enumerator //%// values. //% -//%DICTIONARY_MUTABLE_INTERFACE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, VHELPER) +//%DICTIONARY_MUTABLE_INTERFACE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, VHELPER, value) //% //%@end //% -//%PDDM-DEFINE DICTIONARY_IMMUTABLE_INTERFACE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, VHELPER) +//%PDDM-DEFINE DICTIONARY_IMMUTABLE_INTERFACE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, VHELPER, VNAME) //%VALUE_FOR_KEY_##VHELPER(KEY_TYPE##KisP$S##KisP, VALUE_TYPE) //% -//%- (void)enumerateKeysAndValuesUsingBlock: -//% (void (^)(KEY_TYPE KisP##key, VALUE_TYPE value, BOOL *stop))block; +//%- (void)enumerateKeysAnd##VNAME$u##sUsingBlock: +//% (void (^)(KEY_TYPE KisP##key, VALUE_TYPE VNAME, BOOL *stop))block; -//%PDDM-DEFINE DICTIONARY_MUTABLE_INTERFACE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, VHELPER) -//%- (void)setValue:(VALUE_TYPE)value forKey:(KEY_TYPE##KisP$S##KisP)key; +//%PDDM-DEFINE DICTIONARY_MUTABLE_INTERFACE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, VHELPER, VNAME) +//%- (void)set##VNAME$u##:(VALUE_TYPE)##VNAME forKey:(KEY_TYPE##KisP$S##KisP)key; //%DICTIONARY_EXTRA_MUTABLE_METHODS_##VHELPER(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE) -//%- (void)removeValueForKey:(KEY_TYPE##KisP$S##KisP)aKey; +//%- (void)remove##VNAME$u##ForKey:(KEY_TYPE##KisP$S##KisP)aKey; //%- (void)removeAll; //%PDDM-DEFINE DICTIONARY_EXTRA_MUTABLE_METHODS_POD(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE) diff --git a/objectivec/GPBDictionary.m b/objectivec/GPBDictionary.m index df634279..31ee410e 100644 --- a/objectivec/GPBDictionary.m +++ b/objectivec/GPBDictionary.m @@ -479,6 +479,12 @@ void GPBDictionaryReadEntry(id mapDictionary, case GPBDataTypeBytes: value.valueData = [GPBEmptyNSData() retain]; break; +#if defined(__clang_analyzer__) + case GPBDataTypeGroup: + // Maps can't really have Groups as the value type, but this case is needed + // so the analyzer won't report the posibility of send nil in for the value + // in the NSMutableDictionary case below. +#endif case GPBDataTypeMessage: { value.valueMessage = [[field.msgClass alloc] init]; break; @@ -491,7 +497,8 @@ void GPBDictionaryReadEntry(id mapDictionary, if ((keyDataType == GPBDataTypeString) && GPBDataTypeIsObject(valueDataType)) { // mapDictionary is an NSMutableDictionary - [mapDictionary setObject:value.valueString forKey:key.valueString]; + [(NSMutableDictionary *)mapDictionary setObject:value.valueString + forKey:key.valueString]; } else { if (valueDataType == GPBDataTypeEnum) { if (GPBHasPreservingUnknownEnumSemantics([parentMessage descriptor].file.syntax) || @@ -536,12 +543,12 @@ void GPBDictionaryReadEntry(id mapDictionary, //%DICTIONARY_KEY_TO_ENUM_IMPL(KEY_NAME, KEY_TYPE, KisP, Enum, int32_t, KHELPER) //%PDDM-DEFINE DICTIONARY_KEY_TO_POD_IMPL(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, KHELPER) -//%DICTIONARY_COMMON_IMPL(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, KHELPER, POD) +//%DICTIONARY_COMMON_IMPL(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, KHELPER, POD, value) //%PDDM-DEFINE DICTIONARY_POD_KEY_TO_OBJECT_IMPL(KEY_NAME, KEY_TYPE, VALUE_NAME, VALUE_TYPE) -//%DICTIONARY_COMMON_IMPL(KEY_NAME, KEY_TYPE, , VALUE_NAME, VALUE_TYPE, POD, OBJECT) +//%DICTIONARY_COMMON_IMPL(KEY_NAME, KEY_TYPE, , VALUE_NAME, VALUE_TYPE, POD, OBJECT, object) -//%PDDM-DEFINE DICTIONARY_COMMON_IMPL(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, KHELPER, VHELPER) +//%PDDM-DEFINE DICTIONARY_COMMON_IMPL(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, KHELPER, VHELPER, VNAME) //%#pragma mark - KEY_NAME -> VALUE_NAME //% //%@implementation GPB##KEY_NAME##VALUE_NAME##Dictionary { @@ -550,30 +557,30 @@ void GPBDictionaryReadEntry(id mapDictionary, //%} //% //%+ (instancetype)dictionary { -//% return [[[self alloc] initWithValues:NULL forKeys:NULL count:0] autorelease]; +//% return [[[self alloc] initWith##VNAME$u##s:NULL forKeys:NULL count:0] autorelease]; //%} //% -//%+ (instancetype)dictionaryWithValue:(VALUE_TYPE)value -//% forKey:(KEY_TYPE##KisP$S##KisP)key { -//% // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: +//%+ (instancetype)dictionaryWith##VNAME$u##:(VALUE_TYPE)##VNAME +//% ##VNAME$S## forKey:(KEY_TYPE##KisP$S##KisP)key { +//% // Cast is needed so the compiler knows what class we are invoking initWith##VNAME$u##s:forKeys:count: //% // on to get the type correct. -//% return [[(GPB##KEY_NAME##VALUE_NAME##Dictionary*)[self alloc] initWithValues:&value -//% KEY_NAME$S VALUE_NAME$S forKeys:&key -//% KEY_NAME$S VALUE_NAME$S count:1] autorelease]; +//% return [[(GPB##KEY_NAME##VALUE_NAME##Dictionary*)[self alloc] initWith##VNAME$u##s:&##VNAME +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:&key +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:1] autorelease]; //%} //% -//%+ (instancetype)dictionaryWithValues:(const VALUE_TYPE [])values -//% forKeys:(const KEY_TYPE##KisP$S##KisP [])keys -//% count:(NSUInteger)count { -//% // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: +//%+ (instancetype)dictionaryWith##VNAME$u##s:(const VALUE_TYPE [])##VNAME##s +//% ##VNAME$S## forKeys:(const KEY_TYPE##KisP$S##KisP [])keys +//% ##VNAME$S## count:(NSUInteger)count { +//% // Cast is needed so the compiler knows what class we are invoking initWith##VNAME$u##s:forKeys:count: //% // on to get the type correct. -//% return [[(GPB##KEY_NAME##VALUE_NAME##Dictionary*)[self alloc] initWithValues:values +//% return [[(GPB##KEY_NAME##VALUE_NAME##Dictionary*)[self alloc] initWith##VNAME$u##s:##VNAME##s //% KEY_NAME$S VALUE_NAME$S forKeys:keys //% KEY_NAME$S VALUE_NAME$S count:count] autorelease]; //%} //% //%+ (instancetype)dictionaryWithDictionary:(GPB##KEY_NAME##VALUE_NAME##Dictionary *)dictionary { -//% // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: +//% // Cast is needed so the compiler knows what class we are invoking initWithDictionary: //% // on to get the type correct. //% return [[(GPB##KEY_NAME##VALUE_NAME##Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; //%} @@ -583,18 +590,18 @@ void GPBDictionaryReadEntry(id mapDictionary, //%} //% //%- (instancetype)init { -//% return [self initWithValues:NULL forKeys:NULL count:0]; +//% return [self initWith##VNAME$u##s:NULL forKeys:NULL count:0]; //%} //% -//%- (instancetype)initWithValues:(const VALUE_TYPE [])values -//% forKeys:(const KEY_TYPE##KisP$S##KisP [])keys -//% count:(NSUInteger)count { +//%- (instancetype)initWith##VNAME$u##s:(const VALUE_TYPE [])##VNAME##s +//% ##VNAME$S## forKeys:(const KEY_TYPE##KisP$S##KisP [])keys +//% ##VNAME$S## count:(NSUInteger)count { //% self = [super init]; //% if (self) { //% _dictionary = [[NSMutableDictionary alloc] init]; -//% if (count && values && keys) { +//% if (count && VNAME##s && keys) { //% for (NSUInteger i = 0; i < count; ++i) { -//% [_dictionary setObject:WRAPPED##VHELPER(values[i]) forKey:WRAPPED##KHELPER(keys[i])]; +//% [_dictionary setObject:WRAPPED##VHELPER(VNAME##s[i]) forKey:WRAPPED##KHELPER(keys[i])]; //% } //% } //% } @@ -602,7 +609,7 @@ void GPBDictionaryReadEntry(id mapDictionary, //%} //% //%- (instancetype)initWithDictionary:(GPB##KEY_NAME##VALUE_NAME##Dictionary *)dictionary { -//% self = [self initWithValues:NULL forKeys:NULL count:0]; +//% self = [self initWith##VNAME$u##s:NULL forKeys:NULL count:0]; //% if (self) { //% if (dictionary) { //% [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; @@ -613,14 +620,14 @@ void GPBDictionaryReadEntry(id mapDictionary, //% //%- (instancetype)initWithCapacity:(NSUInteger)numItems { //% #pragma unused(numItems) -//% return [self initWithValues:NULL forKeys:NULL count:0]; +//% return [self initWith##VNAME$u##s:NULL forKeys:NULL count:0]; //%} //% -//%DICTIONARY_IMMUTABLE_CORE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, KHELPER, VHELPER, ) +//%DICTIONARY_IMMUTABLE_CORE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, KHELPER, VHELPER, VNAME, ) //% //%VALUE_FOR_KEY_##VHELPER(KEY_TYPE##KisP$S##KisP, VALUE_NAME, VALUE_TYPE, KHELPER) //% -//%DICTIONARY_MUTABLE_CORE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, KHELPER, VHELPER, ) +//%DICTIONARY_MUTABLE_CORE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, KHELPER, VHELPER, VNAME, ) //% //%@end //% @@ -730,7 +737,7 @@ void GPBDictionaryReadEntry(id mapDictionary, //% return [self initWithValidationFunction:func rawValues:NULL forKeys:NULL count:0]; //%} //% -//%DICTIONARY_IMMUTABLE_CORE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, KHELPER, VHELPER, Raw) +//%DICTIONARY_IMMUTABLE_CORE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, KHELPER, VHELPER, value, Raw) //% //%- (BOOL)valueForKey:(KEY_TYPE##KisP$S##KisP)key value:(VALUE_TYPE *)value { //% NSNumber *wrapped = [_dictionary objectForKey:WRAPPED##KHELPER(key)]; @@ -766,7 +773,7 @@ void GPBDictionaryReadEntry(id mapDictionary, //% }]; //%} //% -//%DICTIONARY_MUTABLE_CORE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, KHELPER, VHELPER, Raw) +//%DICTIONARY_MUTABLE_CORE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, KHELPER, VHELPER, value, Raw) //% //%- (void)setValue:(VALUE_TYPE)value forKey:(KEY_TYPE##KisP$S##KisP)key { //% if (!_validationFunc(value)) { @@ -784,7 +791,7 @@ void GPBDictionaryReadEntry(id mapDictionary, //%@end //% -//%PDDM-DEFINE DICTIONARY_IMMUTABLE_CORE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, KHELPER, VHELPER, ACCESSOR_NAME) +//%PDDM-DEFINE DICTIONARY_IMMUTABLE_CORE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, KHELPER, VHELPER, VNAME, ACCESSOR_NAME) //%- (void)dealloc { //% NSAssert(!_autocreator, //% @"%@: Autocreator must be cleared before release, autocreator: %@", @@ -819,12 +826,12 @@ void GPBDictionaryReadEntry(id mapDictionary, //% return _dictionary.count; //%} //% -//%- (void)enumerateKeysAnd##ACCESSOR_NAME##ValuesUsingBlock: -//% (void (^)(KEY_TYPE KisP##key, VALUE_TYPE value, BOOL *stop))block { +//%- (void)enumerateKeysAnd##ACCESSOR_NAME##VNAME$u##sUsingBlock: +//% (void (^)(KEY_TYPE KisP##key, VALUE_TYPE VNAME, BOOL *stop))block { //% [_dictionary enumerateKeysAndObjectsUsingBlock:^(ENUM_TYPE##KHELPER(KEY_TYPE)##aKey, -//% ENUM_TYPE##VHELPER(VALUE_TYPE)##aValue, +//% ENUM_TYPE##VHELPER(VALUE_TYPE)##a##VNAME$u, //% BOOL *stop) { -//% block(UNWRAP##KEY_NAME(aKey), UNWRAP##VALUE_NAME(aValue), stop); +//% block(UNWRAP##KEY_NAME(aKey), UNWRAP##VALUE_NAME(a##VNAME$u), stop); //% }]; //%} //% @@ -838,11 +845,11 @@ void GPBDictionaryReadEntry(id mapDictionary, //% GPBDataType keyDataType = field.mapKeyDataType; //% __block size_t result = 0; //% [_dictionary enumerateKeysAndObjectsUsingBlock:^(ENUM_TYPE##KHELPER(KEY_TYPE)##aKey, -//% ENUM_TYPE##VHELPER(VALUE_TYPE)##aValue, +//% ENUM_TYPE##VHELPER(VALUE_TYPE)##a##VNAME$u##, //% BOOL *stop) { //% #pragma unused(stop) //% size_t msgSize = ComputeDict##KEY_NAME##FieldSize(UNWRAP##KEY_NAME(aKey), kMapKeyFieldNumber, keyDataType); -//% msgSize += ComputeDict##VALUE_NAME##FieldSize(UNWRAP##VALUE_NAME(aValue), kMapValueFieldNumber, valueDataType); +//% msgSize += ComputeDict##VALUE_NAME##FieldSize(UNWRAP##VALUE_NAME(a##VNAME$u), kMapValueFieldNumber, valueDataType); //% result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; //% }]; //% size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); @@ -856,18 +863,18 @@ void GPBDictionaryReadEntry(id mapDictionary, //% GPBDataType keyDataType = field.mapKeyDataType; //% uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); //% [_dictionary enumerateKeysAndObjectsUsingBlock:^(ENUM_TYPE##KHELPER(KEY_TYPE)##aKey, -//% ENUM_TYPE##VHELPER(VALUE_TYPE)##aValue, +//% ENUM_TYPE##VHELPER(VALUE_TYPE)##a##VNAME$u, //% BOOL *stop) { //% #pragma unused(stop) //% // Write the tag. //% [outputStream writeInt32NoTag:tag]; //% // Write the size of the message. //% size_t msgSize = ComputeDict##KEY_NAME##FieldSize(UNWRAP##KEY_NAME(aKey), kMapKeyFieldNumber, keyDataType); -//% msgSize += ComputeDict##VALUE_NAME##FieldSize(UNWRAP##VALUE_NAME(aValue), kMapValueFieldNumber, valueDataType); +//% msgSize += ComputeDict##VALUE_NAME##FieldSize(UNWRAP##VALUE_NAME(a##VNAME$u), kMapValueFieldNumber, valueDataType); //% [outputStream writeInt32NoTag:(int32_t)msgSize]; //% // Write the fields. //% WriteDict##KEY_NAME##Field(outputStream, UNWRAP##KEY_NAME(aKey), kMapKeyFieldNumber, keyDataType); -//% WriteDict##VALUE_NAME##Field(outputStream, UNWRAP##VALUE_NAME(aValue), kMapValueFieldNumber, valueDataType); +//% WriteDict##VALUE_NAME##Field(outputStream, UNWRAP##VALUE_NAME(a##VNAME$u), kMapValueFieldNumber, valueDataType); //% }]; //%} //% @@ -877,12 +884,12 @@ void GPBDictionaryReadEntry(id mapDictionary, //%} //% //%- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { -//% [self enumerateKeysAnd##ACCESSOR_NAME##ValuesUsingBlock:^(KEY_TYPE KisP##key, VALUE_TYPE value, BOOL *stop) { +//% [self enumerateKeysAnd##ACCESSOR_NAME##VNAME$u##sUsingBlock:^(KEY_TYPE KisP##key, VALUE_TYPE VNAME, BOOL *stop) { //% #pragma unused(stop) -//% block(TEXT_FORMAT_OBJ##KEY_NAME(key), TEXT_FORMAT_OBJ##VALUE_NAME(value)); +//% block(TEXT_FORMAT_OBJ##KEY_NAME(key), TEXT_FORMAT_OBJ##VALUE_NAME(VNAME)); //% }]; //%} -//%PDDM-DEFINE DICTIONARY_MUTABLE_CORE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, KHELPER, VHELPER, ACCESSOR_NAME) +//%PDDM-DEFINE DICTIONARY_MUTABLE_CORE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, KHELPER, VHELPER, VNAME, ACCESSOR_NAME) //%- (void)add##ACCESSOR_NAME##EntriesFromDictionary:(GPB##KEY_NAME##VALUE_NAME##Dictionary *)otherDictionary { //% if (otherDictionary) { //% [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; @@ -892,14 +899,14 @@ void GPBDictionaryReadEntry(id mapDictionary, //% } //%} //% -//%- (void)set##ACCESSOR_NAME##Value:(VALUE_TYPE)value forKey:(KEY_TYPE##KisP$S##KisP)key { -//% [_dictionary setObject:WRAPPED##VHELPER(value) forKey:WRAPPED##KHELPER(key)]; +//%- (void)set##ACCESSOR_NAME##VNAME$u##:(VALUE_TYPE)VNAME forKey:(KEY_TYPE##KisP$S##KisP)key { +//% [_dictionary setObject:WRAPPED##VHELPER(VNAME) forKey:WRAPPED##KHELPER(key)]; //% if (_autocreator) { //% GPBAutocreatedDictionaryModified(_autocreator, self); //% } //%} //% -//%- (void)removeValueForKey:(KEY_TYPE##KisP$S##KisP)aKey { +//%- (void)remove##VNAME$u##ForKey:(KEY_TYPE##KisP$S##KisP)aKey { //% [_dictionary removeObjectForKey:WRAPPED##KHELPER(aKey)]; //%} //% @@ -912,11 +919,11 @@ void GPBDictionaryReadEntry(id mapDictionary, // //%PDDM-DEFINE DICTIONARY_BOOL_KEY_TO_POD_IMPL(VALUE_NAME, VALUE_TYPE) -//%DICTIONARY_BOOL_KEY_TO_VALUE_IMPL(VALUE_NAME, VALUE_TYPE, POD) +//%DICTIONARY_BOOL_KEY_TO_VALUE_IMPL(VALUE_NAME, VALUE_TYPE, POD, value) //%PDDM-DEFINE DICTIONARY_BOOL_KEY_TO_OBJECT_IMPL(VALUE_NAME, VALUE_TYPE) -//%DICTIONARY_BOOL_KEY_TO_VALUE_IMPL(VALUE_NAME, VALUE_TYPE, OBJECT) +//%DICTIONARY_BOOL_KEY_TO_VALUE_IMPL(VALUE_NAME, VALUE_TYPE, OBJECT, object) -//%PDDM-DEFINE DICTIONARY_BOOL_KEY_TO_VALUE_IMPL(VALUE_NAME, VALUE_TYPE, HELPER) +//%PDDM-DEFINE DICTIONARY_BOOL_KEY_TO_VALUE_IMPL(VALUE_NAME, VALUE_TYPE, HELPER, VNAME) //%#pragma mark - Bool -> VALUE_NAME //% //%@implementation GPBBool##VALUE_NAME##Dictionary { @@ -925,30 +932,30 @@ void GPBDictionaryReadEntry(id mapDictionary, //%BOOL_DICT_HAS_STORAGE_##HELPER()} //% //%+ (instancetype)dictionary { -//% return [[[self alloc] initWithValues:NULL forKeys:NULL count:0] autorelease]; +//% return [[[self alloc] initWith##VNAME$u##s:NULL forKeys:NULL count:0] autorelease]; //%} //% -//%+ (instancetype)dictionaryWithValue:(VALUE_TYPE)value -//% forKey:(BOOL)key { -//% // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: +//%+ (instancetype)dictionaryWith##VNAME$u##:(VALUE_TYPE)VNAME +//% ##VNAME$S## forKey:(BOOL)key { +//% // Cast is needed so the compiler knows what class we are invoking initWith##VNAME$u##s:forKeys:count: //% // on to get the type correct. -//% return [[(GPBBool##VALUE_NAME##Dictionary*)[self alloc] initWithValues:&value -//% VALUE_NAME$S forKeys:&key -//% VALUE_NAME$S count:1] autorelease]; +//% return [[(GPBBool##VALUE_NAME##Dictionary*)[self alloc] initWith##VNAME$u##s:&##VNAME +//% VALUE_NAME$S ##VNAME$S## forKeys:&key +//% VALUE_NAME$S ##VNAME$S## count:1] autorelease]; //%} //% -//%+ (instancetype)dictionaryWithValues:(const VALUE_TYPE [])values -//% forKeys:(const BOOL [])keys -//% count:(NSUInteger)count { -//% // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: +//%+ (instancetype)dictionaryWith##VNAME$u##s:(const VALUE_TYPE [])##VNAME##s +//% ##VNAME$S## forKeys:(const BOOL [])keys +//% ##VNAME$S## count:(NSUInteger)count { +//% // Cast is needed so the compiler knows what class we are invoking initWith##VNAME$u##s:forKeys:count: //% // on to get the type correct. -//% return [[(GPBBool##VALUE_NAME##Dictionary*)[self alloc] initWithValues:values -//% VALUE_NAME$S forKeys:keys -//% VALUE_NAME$S count:count] autorelease]; +//% return [[(GPBBool##VALUE_NAME##Dictionary*)[self alloc] initWith##VNAME$u##s:##VNAME##s +//% VALUE_NAME$S ##VNAME$S## forKeys:keys +//% VALUE_NAME$S ##VNAME$S## count:count] autorelease]; //%} //% //%+ (instancetype)dictionaryWithDictionary:(GPBBool##VALUE_NAME##Dictionary *)dictionary { -//% // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: +//% // Cast is needed so the compiler knows what class we are invoking initWithDictionary: //% // on to get the type correct. //% return [[(GPBBool##VALUE_NAME##Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; //%} @@ -958,14 +965,14 @@ void GPBDictionaryReadEntry(id mapDictionary, //%} //% //%- (instancetype)init { -//% return [self initWithValues:NULL forKeys:NULL count:0]; +//% return [self initWith##VNAME$u##s:NULL forKeys:NULL count:0]; //%} //% //%BOOL_DICT_INITS_##HELPER(VALUE_NAME, VALUE_TYPE) //% //%- (instancetype)initWithCapacity:(NSUInteger)numItems { //% #pragma unused(numItems) -//% return [self initWithValues:NULL forKeys:NULL count:0]; +//% return [self initWith##VNAME$u##s:NULL forKeys:NULL count:0]; //%} //% //%BOOL_DICT_DEALLOC##HELPER() @@ -1025,8 +1032,8 @@ void GPBDictionaryReadEntry(id mapDictionary, //% } //%} //% -//%- (void)enumerateKeysAndValuesUsingBlock: -//% (void (^)(BOOL key, VALUE_TYPE value, BOOL *stop))block { +//%- (void)enumerateKeysAnd##VNAME$u##sUsingBlock: +//% (void (^)(BOOL key, VALUE_TYPE VNAME, BOOL *stop))block { //% BOOL stop = NO; //% if (BOOL_DICT_HAS##HELPER(0, )) { //% block(NO, _values[0], &stop); @@ -1282,7 +1289,7 @@ void GPBDictionaryReadEntry(id mapDictionary, // //%PDDM-DEFINE VALUE_FOR_KEY_OBJECT(KEY_TYPE, VALUE_NAME, VALUE_TYPE, KHELPER) -//%- (VALUE_TYPE)valueForKey:(KEY_TYPE)key { +//%- (VALUE_TYPE)objectForKey:(KEY_TYPE)key { //% VALUE_TYPE result = [_dictionary objectForKey:WRAPPED##KHELPER(key)]; //% return result; //%} @@ -1361,22 +1368,22 @@ void GPBDictionaryReadEntry(id mapDictionary, //%PDDM-DEFINE BOOL_DICT_HAS_STORAGE_OBJECT() // Empty //%PDDM-DEFINE BOOL_DICT_INITS_OBJECT(VALUE_NAME, VALUE_TYPE) -//%- (instancetype)initWithValues:(const VALUE_TYPE [])values -//% forKeys:(const BOOL [])keys -//% count:(NSUInteger)count { +//%- (instancetype)initWithObjects:(const VALUE_TYPE [])objects +//% forKeys:(const BOOL [])keys +//% count:(NSUInteger)count { //% self = [super init]; //% if (self) { //% for (NSUInteger i = 0; i < count; ++i) { //% int idx = keys[i] ? 1 : 0; //% [_values[idx] release]; -//% _values[idx] = (VALUE_TYPE)[values[i] retain]; +//% _values[idx] = (VALUE_TYPE)[objects[i] retain]; //% } //% } //% return self; //%} //% //%- (instancetype)initWithDictionary:(GPBBool##VALUE_NAME##Dictionary *)dictionary { -//% self = [self initWithValues:NULL forKeys:NULL count:0]; +//% self = [self initWithObjects:NULL forKeys:NULL count:0]; //% if (self) { //% if (dictionary) { //% _values[0] = [dictionary->_values[0] retain]; @@ -1399,7 +1406,7 @@ void GPBDictionaryReadEntry(id mapDictionary, //%PDDM-DEFINE BOOL_DICT_HASOBJECT(IDX, REF) //%REF##_values[IDX] != nil //%PDDM-DEFINE BOOL_VALUE_FOR_KEY_OBJECT(VALUE_TYPE) -//%- (VALUE_TYPE)valueForKey:(BOOL)key { +//%- (VALUE_TYPE)objectForKey:(BOOL)key { //% return _values[key ? 1 : 0]; //%} //%PDDM-DEFINE BOOL_SET_GPBVALUE_FOR_KEY_OBJECT(VALUE_NAME, VALUE_TYPE, VisP) @@ -1425,16 +1432,16 @@ void GPBDictionaryReadEntry(id mapDictionary, //% } //%} //% -//%- (void)setValue:(VALUE_TYPE)value forKey:(BOOL)key { +//%- (void)setObject:(VALUE_TYPE)object forKey:(BOOL)key { //% int idx = (key ? 1 : 0); //% [_values[idx] release]; -//% _values[idx] = [value retain]; +//% _values[idx] = [object retain]; //% if (_autocreator) { //% GPBAutocreatedDictionaryModified(_autocreator, self); //% } //%} //% -//%- (void)removeValueForKey:(BOOL)aKey { +//%- (void)removeObjectForKey:(BOOL)aKey { //% int idx = (aKey ? 1 : 0); //% [_values[idx] release]; //% _values[idx] = nil; @@ -1484,7 +1491,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionaryWithDictionary:(GPBUInt32UInt32Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBUInt32UInt32Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -1690,7 +1697,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionaryWithDictionary:(GPBUInt32Int32Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBUInt32Int32Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -1896,7 +1903,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionaryWithDictionary:(GPBUInt32UInt64Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBUInt32UInt64Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -2102,7 +2109,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionaryWithDictionary:(GPBUInt32Int64Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBUInt32Int64Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -2308,7 +2315,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionaryWithDictionary:(GPBUInt32BoolDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBUInt32BoolDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -2514,7 +2521,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionaryWithDictionary:(GPBUInt32FloatDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBUInt32FloatDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -2720,7 +2727,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionaryWithDictionary:(GPBUInt32DoubleDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBUInt32DoubleDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -3188,30 +3195,30 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionary { - return [[[self alloc] initWithValues:NULL forKeys:NULL count:0] autorelease]; + return [[[self alloc] initWithObjects:NULL forKeys:NULL count:0] autorelease]; } -+ (instancetype)dictionaryWithValue:(id)value - forKey:(uint32_t)key { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: ++ (instancetype)dictionaryWithObject:(id)object + forKey:(uint32_t)key { + // Cast is needed so the compiler knows what class we are invoking initWithObjects:forKeys:count: // on to get the type correct. - return [[(GPBUInt32ObjectDictionary*)[self alloc] initWithValues:&value - forKeys:&key - count:1] autorelease]; + return [[(GPBUInt32ObjectDictionary*)[self alloc] initWithObjects:&object + forKeys:&key + count:1] autorelease]; } -+ (instancetype)dictionaryWithValues:(const id [])values - forKeys:(const uint32_t [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: ++ (instancetype)dictionaryWithObjects:(const id [])objects + forKeys:(const uint32_t [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithObjects:forKeys:count: // on to get the type correct. - return [[(GPBUInt32ObjectDictionary*)[self alloc] initWithValues:values + return [[(GPBUInt32ObjectDictionary*)[self alloc] initWithObjects:objects forKeys:keys count:count] autorelease]; } + (instancetype)dictionaryWithDictionary:(GPBUInt32ObjectDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBUInt32ObjectDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -3221,18 +3228,18 @@ void GPBDictionaryReadEntry(id mapDictionary, } - (instancetype)init { - return [self initWithValues:NULL forKeys:NULL count:0]; + return [self initWithObjects:NULL forKeys:NULL count:0]; } -- (instancetype)initWithValues:(const id [])values - forKeys:(const uint32_t [])keys - count:(NSUInteger)count { +- (instancetype)initWithObjects:(const id [])objects + forKeys:(const uint32_t [])keys + count:(NSUInteger)count { self = [super init]; if (self) { _dictionary = [[NSMutableDictionary alloc] init]; - if (count && values && keys) { + if (count && objects && keys) { for (NSUInteger i = 0; i < count; ++i) { - [_dictionary setObject:values[i] forKey:@(keys[i])]; + [_dictionary setObject:objects[i] forKey:@(keys[i])]; } } } @@ -3240,7 +3247,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } - (instancetype)initWithDictionary:(GPBUInt32ObjectDictionary *)dictionary { - self = [self initWithValues:NULL forKeys:NULL count:0]; + self = [self initWithObjects:NULL forKeys:NULL count:0]; if (self) { if (dictionary) { [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; @@ -3251,7 +3258,7 @@ void GPBDictionaryReadEntry(id mapDictionary, - (instancetype)initWithCapacity:(NSUInteger)numItems { #pragma unused(numItems) - return [self initWithValues:NULL forKeys:NULL count:0]; + return [self initWithObjects:NULL forKeys:NULL count:0]; } - (void)dealloc { @@ -3288,12 +3295,12 @@ void GPBDictionaryReadEntry(id mapDictionary, return _dictionary.count; } -- (void)enumerateKeysAndValuesUsingBlock: - (void (^)(uint32_t key, id value, BOOL *stop))block { +- (void)enumerateKeysAndObjectsUsingBlock: + (void (^)(uint32_t key, id object, BOOL *stop))block { [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, - id aValue, + id aObject, BOOL *stop) { - block([aKey unsignedIntValue], aValue, stop); + block([aKey unsignedIntValue], aObject, stop); }]; } @@ -3330,11 +3337,11 @@ void GPBDictionaryReadEntry(id mapDictionary, GPBDataType keyDataType = field.mapKeyDataType; __block size_t result = 0; [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, - id aValue, + id aObject, BOOL *stop) { #pragma unused(stop) size_t msgSize = ComputeDictUInt32FieldSize([aKey unsignedIntValue], kMapKeyFieldNumber, keyDataType); - msgSize += ComputeDictObjectFieldSize(aValue, kMapValueFieldNumber, valueDataType); + msgSize += ComputeDictObjectFieldSize(aObject, kMapValueFieldNumber, valueDataType); result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; }]; size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); @@ -3348,18 +3355,18 @@ void GPBDictionaryReadEntry(id mapDictionary, GPBDataType keyDataType = field.mapKeyDataType; uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, - id aValue, + id aObject, BOOL *stop) { #pragma unused(stop) // Write the tag. [outputStream writeInt32NoTag:tag]; // Write the size of the message. size_t msgSize = ComputeDictUInt32FieldSize([aKey unsignedIntValue], kMapKeyFieldNumber, keyDataType); - msgSize += ComputeDictObjectFieldSize(aValue, kMapValueFieldNumber, valueDataType); + msgSize += ComputeDictObjectFieldSize(aObject, kMapValueFieldNumber, valueDataType); [outputStream writeInt32NoTag:(int32_t)msgSize]; // Write the fields. WriteDictUInt32Field(outputStream, [aKey unsignedIntValue], kMapKeyFieldNumber, keyDataType); - WriteDictObjectField(outputStream, aValue, kMapValueFieldNumber, valueDataType); + WriteDictObjectField(outputStream, aObject, kMapValueFieldNumber, valueDataType); }]; } @@ -3369,13 +3376,13 @@ void GPBDictionaryReadEntry(id mapDictionary, } - (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { - [self enumerateKeysAndValuesUsingBlock:^(uint32_t key, id value, BOOL *stop) { + [self enumerateKeysAndObjectsUsingBlock:^(uint32_t key, id object, BOOL *stop) { #pragma unused(stop) - block([NSString stringWithFormat:@"%u", key], value); + block([NSString stringWithFormat:@"%u", key], object); }]; } -- (id)valueForKey:(uint32_t)key { +- (id)objectForKey:(uint32_t)key { id result = [_dictionary objectForKey:@(key)]; return result; } @@ -3389,14 +3396,14 @@ void GPBDictionaryReadEntry(id mapDictionary, } } -- (void)setValue:(id)value forKey:(uint32_t)key { - [_dictionary setObject:value forKey:@(key)]; +- (void)setObject:(id)object forKey:(uint32_t)key { + [_dictionary setObject:object forKey:@(key)]; if (_autocreator) { GPBAutocreatedDictionaryModified(_autocreator, self); } } -- (void)removeValueForKey:(uint32_t)aKey { +- (void)removeObjectForKey:(uint32_t)aKey { [_dictionary removeObjectForKey:@(aKey)]; } @@ -3440,7 +3447,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionaryWithDictionary:(GPBInt32UInt32Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBInt32UInt32Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -3646,7 +3653,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionaryWithDictionary:(GPBInt32Int32Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBInt32Int32Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -3852,7 +3859,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionaryWithDictionary:(GPBInt32UInt64Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBInt32UInt64Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -4058,7 +4065,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionaryWithDictionary:(GPBInt32Int64Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBInt32Int64Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -4264,7 +4271,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionaryWithDictionary:(GPBInt32BoolDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBInt32BoolDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -4470,7 +4477,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionaryWithDictionary:(GPBInt32FloatDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBInt32FloatDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -4676,7 +4683,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionaryWithDictionary:(GPBInt32DoubleDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBInt32DoubleDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -5144,30 +5151,30 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionary { - return [[[self alloc] initWithValues:NULL forKeys:NULL count:0] autorelease]; + return [[[self alloc] initWithObjects:NULL forKeys:NULL count:0] autorelease]; } -+ (instancetype)dictionaryWithValue:(id)value - forKey:(int32_t)key { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: ++ (instancetype)dictionaryWithObject:(id)object + forKey:(int32_t)key { + // Cast is needed so the compiler knows what class we are invoking initWithObjects:forKeys:count: // on to get the type correct. - return [[(GPBInt32ObjectDictionary*)[self alloc] initWithValues:&value - forKeys:&key - count:1] autorelease]; + return [[(GPBInt32ObjectDictionary*)[self alloc] initWithObjects:&object + forKeys:&key + count:1] autorelease]; } -+ (instancetype)dictionaryWithValues:(const id [])values - forKeys:(const int32_t [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: ++ (instancetype)dictionaryWithObjects:(const id [])objects + forKeys:(const int32_t [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithObjects:forKeys:count: // on to get the type correct. - return [[(GPBInt32ObjectDictionary*)[self alloc] initWithValues:values + return [[(GPBInt32ObjectDictionary*)[self alloc] initWithObjects:objects forKeys:keys count:count] autorelease]; } + (instancetype)dictionaryWithDictionary:(GPBInt32ObjectDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBInt32ObjectDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -5177,18 +5184,18 @@ void GPBDictionaryReadEntry(id mapDictionary, } - (instancetype)init { - return [self initWithValues:NULL forKeys:NULL count:0]; + return [self initWithObjects:NULL forKeys:NULL count:0]; } -- (instancetype)initWithValues:(const id [])values - forKeys:(const int32_t [])keys - count:(NSUInteger)count { +- (instancetype)initWithObjects:(const id [])objects + forKeys:(const int32_t [])keys + count:(NSUInteger)count { self = [super init]; if (self) { _dictionary = [[NSMutableDictionary alloc] init]; - if (count && values && keys) { + if (count && objects && keys) { for (NSUInteger i = 0; i < count; ++i) { - [_dictionary setObject:values[i] forKey:@(keys[i])]; + [_dictionary setObject:objects[i] forKey:@(keys[i])]; } } } @@ -5196,7 +5203,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } - (instancetype)initWithDictionary:(GPBInt32ObjectDictionary *)dictionary { - self = [self initWithValues:NULL forKeys:NULL count:0]; + self = [self initWithObjects:NULL forKeys:NULL count:0]; if (self) { if (dictionary) { [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; @@ -5207,7 +5214,7 @@ void GPBDictionaryReadEntry(id mapDictionary, - (instancetype)initWithCapacity:(NSUInteger)numItems { #pragma unused(numItems) - return [self initWithValues:NULL forKeys:NULL count:0]; + return [self initWithObjects:NULL forKeys:NULL count:0]; } - (void)dealloc { @@ -5244,12 +5251,12 @@ void GPBDictionaryReadEntry(id mapDictionary, return _dictionary.count; } -- (void)enumerateKeysAndValuesUsingBlock: - (void (^)(int32_t key, id value, BOOL *stop))block { +- (void)enumerateKeysAndObjectsUsingBlock: + (void (^)(int32_t key, id object, BOOL *stop))block { [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, - id aValue, + id aObject, BOOL *stop) { - block([aKey intValue], aValue, stop); + block([aKey intValue], aObject, stop); }]; } @@ -5286,11 +5293,11 @@ void GPBDictionaryReadEntry(id mapDictionary, GPBDataType keyDataType = field.mapKeyDataType; __block size_t result = 0; [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, - id aValue, + id aObject, BOOL *stop) { #pragma unused(stop) size_t msgSize = ComputeDictInt32FieldSize([aKey intValue], kMapKeyFieldNumber, keyDataType); - msgSize += ComputeDictObjectFieldSize(aValue, kMapValueFieldNumber, valueDataType); + msgSize += ComputeDictObjectFieldSize(aObject, kMapValueFieldNumber, valueDataType); result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; }]; size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); @@ -5304,18 +5311,18 @@ void GPBDictionaryReadEntry(id mapDictionary, GPBDataType keyDataType = field.mapKeyDataType; uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, - id aValue, + id aObject, BOOL *stop) { #pragma unused(stop) // Write the tag. [outputStream writeInt32NoTag:tag]; // Write the size of the message. size_t msgSize = ComputeDictInt32FieldSize([aKey intValue], kMapKeyFieldNumber, keyDataType); - msgSize += ComputeDictObjectFieldSize(aValue, kMapValueFieldNumber, valueDataType); + msgSize += ComputeDictObjectFieldSize(aObject, kMapValueFieldNumber, valueDataType); [outputStream writeInt32NoTag:(int32_t)msgSize]; // Write the fields. WriteDictInt32Field(outputStream, [aKey intValue], kMapKeyFieldNumber, keyDataType); - WriteDictObjectField(outputStream, aValue, kMapValueFieldNumber, valueDataType); + WriteDictObjectField(outputStream, aObject, kMapValueFieldNumber, valueDataType); }]; } @@ -5325,13 +5332,13 @@ void GPBDictionaryReadEntry(id mapDictionary, } - (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { - [self enumerateKeysAndValuesUsingBlock:^(int32_t key, id value, BOOL *stop) { + [self enumerateKeysAndObjectsUsingBlock:^(int32_t key, id object, BOOL *stop) { #pragma unused(stop) - block([NSString stringWithFormat:@"%d", key], value); + block([NSString stringWithFormat:@"%d", key], object); }]; } -- (id)valueForKey:(int32_t)key { +- (id)objectForKey:(int32_t)key { id result = [_dictionary objectForKey:@(key)]; return result; } @@ -5345,14 +5352,14 @@ void GPBDictionaryReadEntry(id mapDictionary, } } -- (void)setValue:(id)value forKey:(int32_t)key { - [_dictionary setObject:value forKey:@(key)]; +- (void)setObject:(id)object forKey:(int32_t)key { + [_dictionary setObject:object forKey:@(key)]; if (_autocreator) { GPBAutocreatedDictionaryModified(_autocreator, self); } } -- (void)removeValueForKey:(int32_t)aKey { +- (void)removeObjectForKey:(int32_t)aKey { [_dictionary removeObjectForKey:@(aKey)]; } @@ -5396,7 +5403,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionaryWithDictionary:(GPBUInt64UInt32Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBUInt64UInt32Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -5602,7 +5609,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionaryWithDictionary:(GPBUInt64Int32Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBUInt64Int32Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -5808,7 +5815,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionaryWithDictionary:(GPBUInt64UInt64Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBUInt64UInt64Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -6014,7 +6021,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionaryWithDictionary:(GPBUInt64Int64Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBUInt64Int64Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -6220,7 +6227,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionaryWithDictionary:(GPBUInt64BoolDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBUInt64BoolDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -6426,7 +6433,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionaryWithDictionary:(GPBUInt64FloatDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBUInt64FloatDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -6632,7 +6639,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionaryWithDictionary:(GPBUInt64DoubleDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBUInt64DoubleDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -7100,30 +7107,30 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionary { - return [[[self alloc] initWithValues:NULL forKeys:NULL count:0] autorelease]; + return [[[self alloc] initWithObjects:NULL forKeys:NULL count:0] autorelease]; } -+ (instancetype)dictionaryWithValue:(id)value - forKey:(uint64_t)key { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: ++ (instancetype)dictionaryWithObject:(id)object + forKey:(uint64_t)key { + // Cast is needed so the compiler knows what class we are invoking initWithObjects:forKeys:count: // on to get the type correct. - return [[(GPBUInt64ObjectDictionary*)[self alloc] initWithValues:&value - forKeys:&key - count:1] autorelease]; + return [[(GPBUInt64ObjectDictionary*)[self alloc] initWithObjects:&object + forKeys:&key + count:1] autorelease]; } -+ (instancetype)dictionaryWithValues:(const id [])values - forKeys:(const uint64_t [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: ++ (instancetype)dictionaryWithObjects:(const id [])objects + forKeys:(const uint64_t [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithObjects:forKeys:count: // on to get the type correct. - return [[(GPBUInt64ObjectDictionary*)[self alloc] initWithValues:values + return [[(GPBUInt64ObjectDictionary*)[self alloc] initWithObjects:objects forKeys:keys count:count] autorelease]; } + (instancetype)dictionaryWithDictionary:(GPBUInt64ObjectDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBUInt64ObjectDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -7133,18 +7140,18 @@ void GPBDictionaryReadEntry(id mapDictionary, } - (instancetype)init { - return [self initWithValues:NULL forKeys:NULL count:0]; + return [self initWithObjects:NULL forKeys:NULL count:0]; } -- (instancetype)initWithValues:(const id [])values - forKeys:(const uint64_t [])keys - count:(NSUInteger)count { +- (instancetype)initWithObjects:(const id [])objects + forKeys:(const uint64_t [])keys + count:(NSUInteger)count { self = [super init]; if (self) { _dictionary = [[NSMutableDictionary alloc] init]; - if (count && values && keys) { + if (count && objects && keys) { for (NSUInteger i = 0; i < count; ++i) { - [_dictionary setObject:values[i] forKey:@(keys[i])]; + [_dictionary setObject:objects[i] forKey:@(keys[i])]; } } } @@ -7152,7 +7159,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } - (instancetype)initWithDictionary:(GPBUInt64ObjectDictionary *)dictionary { - self = [self initWithValues:NULL forKeys:NULL count:0]; + self = [self initWithObjects:NULL forKeys:NULL count:0]; if (self) { if (dictionary) { [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; @@ -7163,7 +7170,7 @@ void GPBDictionaryReadEntry(id mapDictionary, - (instancetype)initWithCapacity:(NSUInteger)numItems { #pragma unused(numItems) - return [self initWithValues:NULL forKeys:NULL count:0]; + return [self initWithObjects:NULL forKeys:NULL count:0]; } - (void)dealloc { @@ -7200,12 +7207,12 @@ void GPBDictionaryReadEntry(id mapDictionary, return _dictionary.count; } -- (void)enumerateKeysAndValuesUsingBlock: - (void (^)(uint64_t key, id value, BOOL *stop))block { +- (void)enumerateKeysAndObjectsUsingBlock: + (void (^)(uint64_t key, id object, BOOL *stop))block { [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, - id aValue, + id aObject, BOOL *stop) { - block([aKey unsignedLongLongValue], aValue, stop); + block([aKey unsignedLongLongValue], aObject, stop); }]; } @@ -7242,11 +7249,11 @@ void GPBDictionaryReadEntry(id mapDictionary, GPBDataType keyDataType = field.mapKeyDataType; __block size_t result = 0; [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, - id aValue, + id aObject, BOOL *stop) { #pragma unused(stop) size_t msgSize = ComputeDictUInt64FieldSize([aKey unsignedLongLongValue], kMapKeyFieldNumber, keyDataType); - msgSize += ComputeDictObjectFieldSize(aValue, kMapValueFieldNumber, valueDataType); + msgSize += ComputeDictObjectFieldSize(aObject, kMapValueFieldNumber, valueDataType); result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; }]; size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); @@ -7260,18 +7267,18 @@ void GPBDictionaryReadEntry(id mapDictionary, GPBDataType keyDataType = field.mapKeyDataType; uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, - id aValue, + id aObject, BOOL *stop) { #pragma unused(stop) // Write the tag. [outputStream writeInt32NoTag:tag]; // Write the size of the message. size_t msgSize = ComputeDictUInt64FieldSize([aKey unsignedLongLongValue], kMapKeyFieldNumber, keyDataType); - msgSize += ComputeDictObjectFieldSize(aValue, kMapValueFieldNumber, valueDataType); + msgSize += ComputeDictObjectFieldSize(aObject, kMapValueFieldNumber, valueDataType); [outputStream writeInt32NoTag:(int32_t)msgSize]; // Write the fields. WriteDictUInt64Field(outputStream, [aKey unsignedLongLongValue], kMapKeyFieldNumber, keyDataType); - WriteDictObjectField(outputStream, aValue, kMapValueFieldNumber, valueDataType); + WriteDictObjectField(outputStream, aObject, kMapValueFieldNumber, valueDataType); }]; } @@ -7281,13 +7288,13 @@ void GPBDictionaryReadEntry(id mapDictionary, } - (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { - [self enumerateKeysAndValuesUsingBlock:^(uint64_t key, id value, BOOL *stop) { + [self enumerateKeysAndObjectsUsingBlock:^(uint64_t key, id object, BOOL *stop) { #pragma unused(stop) - block([NSString stringWithFormat:@"%llu", key], value); + block([NSString stringWithFormat:@"%llu", key], object); }]; } -- (id)valueForKey:(uint64_t)key { +- (id)objectForKey:(uint64_t)key { id result = [_dictionary objectForKey:@(key)]; return result; } @@ -7301,14 +7308,14 @@ void GPBDictionaryReadEntry(id mapDictionary, } } -- (void)setValue:(id)value forKey:(uint64_t)key { - [_dictionary setObject:value forKey:@(key)]; +- (void)setObject:(id)object forKey:(uint64_t)key { + [_dictionary setObject:object forKey:@(key)]; if (_autocreator) { GPBAutocreatedDictionaryModified(_autocreator, self); } } -- (void)removeValueForKey:(uint64_t)aKey { +- (void)removeObjectForKey:(uint64_t)aKey { [_dictionary removeObjectForKey:@(aKey)]; } @@ -7352,7 +7359,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionaryWithDictionary:(GPBInt64UInt32Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBInt64UInt32Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -7558,7 +7565,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionaryWithDictionary:(GPBInt64Int32Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBInt64Int32Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -7764,7 +7771,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionaryWithDictionary:(GPBInt64UInt64Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBInt64UInt64Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -7970,7 +7977,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionaryWithDictionary:(GPBInt64Int64Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBInt64Int64Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -8176,7 +8183,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionaryWithDictionary:(GPBInt64BoolDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBInt64BoolDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -8382,7 +8389,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionaryWithDictionary:(GPBInt64FloatDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBInt64FloatDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -8588,7 +8595,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionaryWithDictionary:(GPBInt64DoubleDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBInt64DoubleDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -9056,30 +9063,30 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionary { - return [[[self alloc] initWithValues:NULL forKeys:NULL count:0] autorelease]; + return [[[self alloc] initWithObjects:NULL forKeys:NULL count:0] autorelease]; } -+ (instancetype)dictionaryWithValue:(id)value - forKey:(int64_t)key { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: ++ (instancetype)dictionaryWithObject:(id)object + forKey:(int64_t)key { + // Cast is needed so the compiler knows what class we are invoking initWithObjects:forKeys:count: // on to get the type correct. - return [[(GPBInt64ObjectDictionary*)[self alloc] initWithValues:&value - forKeys:&key - count:1] autorelease]; + return [[(GPBInt64ObjectDictionary*)[self alloc] initWithObjects:&object + forKeys:&key + count:1] autorelease]; } -+ (instancetype)dictionaryWithValues:(const id [])values - forKeys:(const int64_t [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: ++ (instancetype)dictionaryWithObjects:(const id [])objects + forKeys:(const int64_t [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithObjects:forKeys:count: // on to get the type correct. - return [[(GPBInt64ObjectDictionary*)[self alloc] initWithValues:values + return [[(GPBInt64ObjectDictionary*)[self alloc] initWithObjects:objects forKeys:keys count:count] autorelease]; } + (instancetype)dictionaryWithDictionary:(GPBInt64ObjectDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBInt64ObjectDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -9089,18 +9096,18 @@ void GPBDictionaryReadEntry(id mapDictionary, } - (instancetype)init { - return [self initWithValues:NULL forKeys:NULL count:0]; + return [self initWithObjects:NULL forKeys:NULL count:0]; } -- (instancetype)initWithValues:(const id [])values - forKeys:(const int64_t [])keys - count:(NSUInteger)count { +- (instancetype)initWithObjects:(const id [])objects + forKeys:(const int64_t [])keys + count:(NSUInteger)count { self = [super init]; if (self) { _dictionary = [[NSMutableDictionary alloc] init]; - if (count && values && keys) { + if (count && objects && keys) { for (NSUInteger i = 0; i < count; ++i) { - [_dictionary setObject:values[i] forKey:@(keys[i])]; + [_dictionary setObject:objects[i] forKey:@(keys[i])]; } } } @@ -9108,7 +9115,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } - (instancetype)initWithDictionary:(GPBInt64ObjectDictionary *)dictionary { - self = [self initWithValues:NULL forKeys:NULL count:0]; + self = [self initWithObjects:NULL forKeys:NULL count:0]; if (self) { if (dictionary) { [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; @@ -9119,7 +9126,7 @@ void GPBDictionaryReadEntry(id mapDictionary, - (instancetype)initWithCapacity:(NSUInteger)numItems { #pragma unused(numItems) - return [self initWithValues:NULL forKeys:NULL count:0]; + return [self initWithObjects:NULL forKeys:NULL count:0]; } - (void)dealloc { @@ -9156,12 +9163,12 @@ void GPBDictionaryReadEntry(id mapDictionary, return _dictionary.count; } -- (void)enumerateKeysAndValuesUsingBlock: - (void (^)(int64_t key, id value, BOOL *stop))block { +- (void)enumerateKeysAndObjectsUsingBlock: + (void (^)(int64_t key, id object, BOOL *stop))block { [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, - id aValue, + id aObject, BOOL *stop) { - block([aKey longLongValue], aValue, stop); + block([aKey longLongValue], aObject, stop); }]; } @@ -9198,11 +9205,11 @@ void GPBDictionaryReadEntry(id mapDictionary, GPBDataType keyDataType = field.mapKeyDataType; __block size_t result = 0; [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, - id aValue, + id aObject, BOOL *stop) { #pragma unused(stop) size_t msgSize = ComputeDictInt64FieldSize([aKey longLongValue], kMapKeyFieldNumber, keyDataType); - msgSize += ComputeDictObjectFieldSize(aValue, kMapValueFieldNumber, valueDataType); + msgSize += ComputeDictObjectFieldSize(aObject, kMapValueFieldNumber, valueDataType); result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; }]; size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); @@ -9216,18 +9223,18 @@ void GPBDictionaryReadEntry(id mapDictionary, GPBDataType keyDataType = field.mapKeyDataType; uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, - id aValue, + id aObject, BOOL *stop) { #pragma unused(stop) // Write the tag. [outputStream writeInt32NoTag:tag]; // Write the size of the message. size_t msgSize = ComputeDictInt64FieldSize([aKey longLongValue], kMapKeyFieldNumber, keyDataType); - msgSize += ComputeDictObjectFieldSize(aValue, kMapValueFieldNumber, valueDataType); + msgSize += ComputeDictObjectFieldSize(aObject, kMapValueFieldNumber, valueDataType); [outputStream writeInt32NoTag:(int32_t)msgSize]; // Write the fields. WriteDictInt64Field(outputStream, [aKey longLongValue], kMapKeyFieldNumber, keyDataType); - WriteDictObjectField(outputStream, aValue, kMapValueFieldNumber, valueDataType); + WriteDictObjectField(outputStream, aObject, kMapValueFieldNumber, valueDataType); }]; } @@ -9237,13 +9244,13 @@ void GPBDictionaryReadEntry(id mapDictionary, } - (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { - [self enumerateKeysAndValuesUsingBlock:^(int64_t key, id value, BOOL *stop) { + [self enumerateKeysAndObjectsUsingBlock:^(int64_t key, id object, BOOL *stop) { #pragma unused(stop) - block([NSString stringWithFormat:@"%lld", key], value); + block([NSString stringWithFormat:@"%lld", key], object); }]; } -- (id)valueForKey:(int64_t)key { +- (id)objectForKey:(int64_t)key { id result = [_dictionary objectForKey:@(key)]; return result; } @@ -9257,14 +9264,14 @@ void GPBDictionaryReadEntry(id mapDictionary, } } -- (void)setValue:(id)value forKey:(int64_t)key { - [_dictionary setObject:value forKey:@(key)]; +- (void)setObject:(id)object forKey:(int64_t)key { + [_dictionary setObject:object forKey:@(key)]; if (_autocreator) { GPBAutocreatedDictionaryModified(_autocreator, self); } } -- (void)removeValueForKey:(int64_t)aKey { +- (void)removeObjectForKey:(int64_t)aKey { [_dictionary removeObjectForKey:@(aKey)]; } @@ -9308,7 +9315,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionaryWithDictionary:(GPBStringUInt32Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBStringUInt32Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -9514,7 +9521,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionaryWithDictionary:(GPBStringInt32Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBStringInt32Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -9720,7 +9727,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionaryWithDictionary:(GPBStringUInt64Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBStringUInt64Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -9926,7 +9933,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionaryWithDictionary:(GPBStringInt64Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBStringInt64Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -10132,7 +10139,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionaryWithDictionary:(GPBStringBoolDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBStringBoolDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -10338,7 +10345,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionaryWithDictionary:(GPBStringFloatDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBStringFloatDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -10544,7 +10551,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionaryWithDictionary:(GPBStringDoubleDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBStringDoubleDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -11042,7 +11049,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionaryWithDictionary:(GPBBoolUInt32Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBBoolUInt32Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -11283,7 +11290,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionaryWithDictionary:(GPBBoolInt32Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBBoolInt32Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -11524,7 +11531,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionaryWithDictionary:(GPBBoolUInt64Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBBoolUInt64Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -11765,7 +11772,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionaryWithDictionary:(GPBBoolInt64Dictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBBoolInt64Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -12006,7 +12013,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionaryWithDictionary:(GPBBoolBoolDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBBoolBoolDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -12247,7 +12254,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionaryWithDictionary:(GPBBoolFloatDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBBoolFloatDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -12488,7 +12495,7 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionaryWithDictionary:(GPBBoolDoubleDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBBoolDoubleDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -12705,30 +12712,30 @@ void GPBDictionaryReadEntry(id mapDictionary, } + (instancetype)dictionary { - return [[[self alloc] initWithValues:NULL forKeys:NULL count:0] autorelease]; + return [[[self alloc] initWithObjects:NULL forKeys:NULL count:0] autorelease]; } -+ (instancetype)dictionaryWithValue:(id)value - forKey:(BOOL)key { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: ++ (instancetype)dictionaryWithObject:(id)object + forKey:(BOOL)key { + // Cast is needed so the compiler knows what class we are invoking initWithObjects:forKeys:count: // on to get the type correct. - return [[(GPBBoolObjectDictionary*)[self alloc] initWithValues:&value - forKeys:&key - count:1] autorelease]; + return [[(GPBBoolObjectDictionary*)[self alloc] initWithObjects:&object + forKeys:&key + count:1] autorelease]; } -+ (instancetype)dictionaryWithValues:(const id [])values - forKeys:(const BOOL [])keys - count:(NSUInteger)count { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: ++ (instancetype)dictionaryWithObjects:(const id [])objects + forKeys:(const BOOL [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithObjects:forKeys:count: // on to get the type correct. - return [[(GPBBoolObjectDictionary*)[self alloc] initWithValues:values - forKeys:keys - count:count] autorelease]; + return [[(GPBBoolObjectDictionary*)[self alloc] initWithObjects:objects + forKeys:keys + count:count] autorelease]; } + (instancetype)dictionaryWithDictionary:(GPBBoolObjectDictionary *)dictionary { - // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: // on to get the type correct. return [[(GPBBoolObjectDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; } @@ -12738,25 +12745,25 @@ void GPBDictionaryReadEntry(id mapDictionary, } - (instancetype)init { - return [self initWithValues:NULL forKeys:NULL count:0]; + return [self initWithObjects:NULL forKeys:NULL count:0]; } -- (instancetype)initWithValues:(const id [])values - forKeys:(const BOOL [])keys - count:(NSUInteger)count { +- (instancetype)initWithObjects:(const id [])objects + forKeys:(const BOOL [])keys + count:(NSUInteger)count { self = [super init]; if (self) { for (NSUInteger i = 0; i < count; ++i) { int idx = keys[i] ? 1 : 0; [_values[idx] release]; - _values[idx] = (id)[values[i] retain]; + _values[idx] = (id)[objects[i] retain]; } } return self; } - (instancetype)initWithDictionary:(GPBBoolObjectDictionary *)dictionary { - self = [self initWithValues:NULL forKeys:NULL count:0]; + self = [self initWithObjects:NULL forKeys:NULL count:0]; if (self) { if (dictionary) { _values[0] = [dictionary->_values[0] retain]; @@ -12768,7 +12775,7 @@ void GPBDictionaryReadEntry(id mapDictionary, - (instancetype)initWithCapacity:(NSUInteger)numItems { #pragma unused(numItems) - return [self initWithValues:NULL forKeys:NULL count:0]; + return [self initWithObjects:NULL forKeys:NULL count:0]; } - (void)dealloc { @@ -12822,7 +12829,7 @@ void GPBDictionaryReadEntry(id mapDictionary, return ((_values[0] != nil) ? 1 : 0) + ((_values[1] != nil) ? 1 : 0); } -- (id)valueForKey:(BOOL)key { +- (id)objectForKey:(BOOL)key { return _values[key ? 1 : 0]; } @@ -12842,8 +12849,8 @@ void GPBDictionaryReadEntry(id mapDictionary, } } -- (void)enumerateKeysAndValuesUsingBlock: - (void (^)(BOOL key, id value, BOOL *stop))block { +- (void)enumerateKeysAndObjectsUsingBlock: + (void (^)(BOOL key, id object, BOOL *stop))block { BOOL stop = NO; if (_values[0] != nil) { block(NO, _values[0], &stop); @@ -12924,16 +12931,16 @@ void GPBDictionaryReadEntry(id mapDictionary, } } -- (void)setValue:(id)value forKey:(BOOL)key { +- (void)setObject:(id)object forKey:(BOOL)key { int idx = (key ? 1 : 0); [_values[idx] release]; - _values[idx] = [value retain]; + _values[idx] = [object retain]; if (_autocreator) { GPBAutocreatedDictionaryModified(_autocreator, self); } } -- (void)removeValueForKey:(BOOL)aKey { +- (void)removeObjectForKey:(BOOL)aKey { int idx = (aKey ? 1 : 0); [_values[idx] release]; _values[idx] = nil; diff --git a/objectivec/ProtocolBuffers_OSX.xcodeproj/project.pbxproj b/objectivec/ProtocolBuffers_OSX.xcodeproj/project.pbxproj index b0a0712e..08d0b7ef 100644 --- a/objectivec/ProtocolBuffers_OSX.xcodeproj/project.pbxproj +++ b/objectivec/ProtocolBuffers_OSX.xcodeproj/project.pbxproj @@ -58,6 +58,7 @@ F4487C831AAF6AB300531423 /* GPBMessageTests+Merge.m in Sources */ = {isa = PBXBuildFile; fileRef = F4487C821AAF6AB300531423 /* GPBMessageTests+Merge.m */; }; F45C69CC16DFD08D0081955B /* GPBExtensionInternals.m in Sources */ = {isa = PBXBuildFile; fileRef = F45C69CB16DFD08D0081955B /* GPBExtensionInternals.m */; }; F45E57C71AE6DC6A000B7D99 /* text_format_map_unittest_data.txt in Resources */ = {isa = PBXBuildFile; fileRef = F45E57C61AE6DC6A000B7D99 /* text_format_map_unittest_data.txt */; }; + F4B51B1E1BBC610700744318 /* GPBObjectiveCPlusPlusTest.mm in Sources */ = {isa = PBXBuildFile; fileRef = F4B51B1D1BBC610700744318 /* GPBObjectiveCPlusPlusTest.mm */; }; F4E675971B21D0000054530B /* Any.pbobjc.m in Sources */ = {isa = PBXBuildFile; fileRef = F4E675871B21D0000054530B /* Any.pbobjc.m */; }; F4E675991B21D0000054530B /* Api.pbobjc.m in Sources */ = {isa = PBXBuildFile; fileRef = F4E675891B21D0000054530B /* Api.pbobjc.m */; }; F4E6759B1B21D0000054530B /* Empty.pbobjc.m in Sources */ = {isa = PBXBuildFile; fileRef = F4E6758B1B21D0000054530B /* Empty.pbobjc.m */; }; @@ -193,6 +194,7 @@ F45C69CB16DFD08D0081955B /* GPBExtensionInternals.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBExtensionInternals.m; sourceTree = "<group>"; }; F45E57C61AE6DC6A000B7D99 /* text_format_map_unittest_data.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = text_format_map_unittest_data.txt; sourceTree = "<group>"; }; F4AC9E1D1A8BEB3500BD6E83 /* unittest_cycle.proto */ = {isa = PBXFileReference; lastKnownFileType = text; path = unittest_cycle.proto; sourceTree = "<group>"; }; + F4B51B1D1BBC610700744318 /* GPBObjectiveCPlusPlusTest.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GPBObjectiveCPlusPlusTest.mm; sourceTree = "<group>"; }; F4B6B8AF1A9CC98000892426 /* GPBUnknownField_PackagePrivate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPBUnknownField_PackagePrivate.h; sourceTree = "<group>"; }; F4B6B8B21A9CCBDA00892426 /* GPBUnknownFieldSet_PackagePrivate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPBUnknownFieldSet_PackagePrivate.h; sourceTree = "<group>"; }; F4B6B8B61A9CD1DE00892426 /* GPBExtensionInternals.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPBExtensionInternals.h; sourceTree = "<group>"; }; @@ -415,6 +417,7 @@ F4487C821AAF6AB300531423 /* GPBMessageTests+Merge.m */, F4487C741AADF7F500531423 /* GPBMessageTests+Runtime.m */, F4487C7E1AAF62CD00531423 /* GPBMessageTests+Serialization.m */, + F4B51B1D1BBC610700744318 /* GPBObjectiveCPlusPlusTest.mm */, F41C175C1833D3310064ED4D /* GPBPerfTests.m */, 8BA9364418DA5F4B0056FA2A /* GPBStringTests.m */, 8B4248BA1A8C256A00BC1EC6 /* GPBSwiftTests.swift */, @@ -668,6 +671,7 @@ 8BBEA4AA147C727D00C4ADB7 /* GPBCodedOuputStreamTests.m in Sources */, F4E675B21B21D0A70054530B /* SourceContext.pbobjc.m in Sources */, 8BBEA4AC147C727D00C4ADB7 /* GPBMessageTests.m in Sources */, + F4B51B1E1BBC610700744318 /* GPBObjectiveCPlusPlusTest.mm in Sources */, F4487C7F1AAF62CD00531423 /* GPBMessageTests+Serialization.m in Sources */, 8B4248DC1A92933A00BC1EC6 /* GPBWellKnownTypesTest.m in Sources */, F4E675B01B21D0A70054530B /* Empty.pbobjc.m in Sources */, diff --git a/objectivec/ProtocolBuffers_iOS.xcodeproj/project.pbxproj b/objectivec/ProtocolBuffers_iOS.xcodeproj/project.pbxproj index 23e9f169..14e51037 100644 --- a/objectivec/ProtocolBuffers_iOS.xcodeproj/project.pbxproj +++ b/objectivec/ProtocolBuffers_iOS.xcodeproj/project.pbxproj @@ -66,6 +66,7 @@ F4487C851AAF6AC500531423 /* GPBMessageTests+Merge.m in Sources */ = {isa = PBXBuildFile; fileRef = F4487C841AAF6AC500531423 /* GPBMessageTests+Merge.m */; }; F45C69CC16DFD08D0081955B /* GPBExtensionInternals.m in Sources */ = {isa = PBXBuildFile; fileRef = F45C69CB16DFD08D0081955B /* GPBExtensionInternals.m */; }; F45E57C91AE6DC98000B7D99 /* text_format_map_unittest_data.txt in Resources */ = {isa = PBXBuildFile; fileRef = F45E57C81AE6DC98000B7D99 /* text_format_map_unittest_data.txt */; }; + F4B51B1C1BBC5C7100744318 /* GPBObjectiveCPlusPlusTest.mm in Sources */ = {isa = PBXBuildFile; fileRef = F4B51B1B1BBC5C7100744318 /* GPBObjectiveCPlusPlusTest.mm */; }; F4E675C81B21D1610054530B /* Any.pbobjc.m in Sources */ = {isa = PBXBuildFile; fileRef = F4E675B71B21D1440054530B /* Any.pbobjc.m */; }; F4E675C91B21D1610054530B /* Api.pbobjc.m in Sources */ = {isa = PBXBuildFile; fileRef = F4E675B91B21D1440054530B /* Api.pbobjc.m */; }; F4E675CA1B21D1610054530B /* Empty.pbobjc.m in Sources */ = {isa = PBXBuildFile; fileRef = F4E675BC1B21D1440054530B /* Empty.pbobjc.m */; }; @@ -214,6 +215,7 @@ F45C69CB16DFD08D0081955B /* GPBExtensionInternals.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBExtensionInternals.m; sourceTree = "<group>"; }; F45E57C81AE6DC98000B7D99 /* text_format_map_unittest_data.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = text_format_map_unittest_data.txt; sourceTree = "<group>"; }; F4AC9E1C1A8BEB1000BD6E83 /* unittest_cycle.proto */ = {isa = PBXFileReference; lastKnownFileType = text; path = unittest_cycle.proto; sourceTree = "<group>"; }; + F4B51B1B1BBC5C7100744318 /* GPBObjectiveCPlusPlusTest.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GPBObjectiveCPlusPlusTest.mm; sourceTree = "<group>"; }; F4B6B8B01A9CC99500892426 /* GPBUnknownField_PackagePrivate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPBUnknownField_PackagePrivate.h; sourceTree = "<group>"; }; F4B6B8B11A9CCBBB00892426 /* GPBUnknownFieldSet_PackagePrivate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPBUnknownFieldSet_PackagePrivate.h; sourceTree = "<group>"; }; F4B6B8B31A9CD1C600892426 /* GPBExtensionInternals.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPBExtensionInternals.h; sourceTree = "<group>"; }; @@ -453,6 +455,7 @@ F4487C841AAF6AC500531423 /* GPBMessageTests+Merge.m */, F4487C761AADF84900531423 /* GPBMessageTests+Runtime.m */, F4487C801AAF62FC00531423 /* GPBMessageTests+Serialization.m */, + F4B51B1B1BBC5C7100744318 /* GPBObjectiveCPlusPlusTest.mm */, F41C175C1833D3310064ED4D /* GPBPerfTests.m */, 8BA9364418DA5F4B0056FA2A /* GPBStringTests.m */, 8B4248B31A8BD96E00BC1EC6 /* GPBSwiftTests.swift */, @@ -770,6 +773,7 @@ F4E675CE1B21D1610054530B /* Type.pbobjc.m in Sources */, F4353D1F1AB88243005A6198 /* GPBDescriptorTests.m in Sources */, F4E675CF1B21D1610054530B /* Wrappers.pbobjc.m in Sources */, + F4B51B1C1BBC5C7100744318 /* GPBObjectiveCPlusPlusTest.mm in Sources */, F4E675C81B21D1610054530B /* Any.pbobjc.m in Sources */, 8B4248B41A8BD96E00BC1EC6 /* GPBSwiftTests.swift in Sources */, 5102DABC1891A073002037B6 /* GPBConcurrencyTests.m in Sources */, diff --git a/objectivec/Tests/GPBDictionaryTests+Bool.m b/objectivec/Tests/GPBDictionaryTests+Bool.m index 43650f51..8b1900fe 100644 --- a/objectivec/Tests/GPBDictionaryTests+Bool.m +++ b/objectivec/Tests/GPBDictionaryTests+Bool.m @@ -167,10 +167,10 @@ // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 Fewer pairs; not equal @@ -468,10 +468,10 @@ // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 Fewer pairs; not equal @@ -769,10 +769,10 @@ // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 Fewer pairs; not equal @@ -1070,10 +1070,10 @@ // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 Fewer pairs; not equal @@ -1371,10 +1371,10 @@ // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 Fewer pairs; not equal @@ -1672,10 +1672,10 @@ // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 Fewer pairs; not equal @@ -1973,10 +1973,10 @@ // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 Fewer pairs; not equal @@ -2161,46 +2161,46 @@ GPBBoolObjectDictionary *dict = [[GPBBoolObjectDictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); - XCTAssertNil([dict valueForKey:YES]); - [dict enumerateKeysAndValuesUsingBlock:^(BOOL aKey, id aValue, BOOL *stop) { - #pragma unused(aKey, aValue, stop) + XCTAssertNil([dict objectForKey:YES]); + [dict enumerateKeysAndObjectsUsingBlock:^(BOOL aKey, id aObject, BOOL *stop) { + #pragma unused(aKey, aObject, stop) XCTFail(@"Shouldn't get here!"); }]; [dict release]; } - (void)testOne { - GPBBoolObjectDictionary *dict = [GPBBoolObjectDictionary dictionaryWithValue:@"abc" forKey:YES]; + GPBBoolObjectDictionary *dict = [GPBBoolObjectDictionary dictionaryWithObject:@"abc" forKey:YES]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); - XCTAssertEqualObjects([dict valueForKey:YES], @"abc"); - XCTAssertNil([dict valueForKey:NO]); - [dict enumerateKeysAndValuesUsingBlock:^(BOOL aKey, id aValue, BOOL *stop) { + XCTAssertEqualObjects([dict objectForKey:YES], @"abc"); + XCTAssertNil([dict objectForKey:NO]); + [dict enumerateKeysAndObjectsUsingBlock:^(BOOL aKey, id aObject, BOOL *stop) { XCTAssertEqual(aKey, YES); - XCTAssertEqualObjects(aValue, @"abc"); + XCTAssertEqualObjects(aObject, @"abc"); XCTAssertNotEqual(stop, NULL); }]; } - (void)testBasics { const BOOL kKeys[] = { YES, NO }; - const id kValues[] = { @"abc", @"def" }; + const id kObjects[] = { @"abc", @"def" }; GPBBoolObjectDictionary *dict = - [[GPBBoolObjectDictionary alloc] initWithValues:kValues - forKeys:kKeys - count:GPBARRAYSIZE(kValues)]; + [[GPBBoolObjectDictionary alloc] initWithObjects:kObjects + forKeys:kKeys + count:GPBARRAYSIZE(kObjects)]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 2U); - XCTAssertEqualObjects([dict valueForKey:YES], @"abc"); - XCTAssertEqualObjects([dict valueForKey:NO], @"def"); + XCTAssertEqualObjects([dict objectForKey:YES], @"abc"); + XCTAssertEqualObjects([dict objectForKey:NO], @"def"); __block NSUInteger idx = 0; BOOL *seenKeys = malloc(2 * sizeof(BOOL)); - id *seenValues = malloc(2 * sizeof(id)); - [dict enumerateKeysAndValuesUsingBlock:^(BOOL aKey, id aValue, BOOL *stop) { + id *seenObjects = malloc(2 * sizeof(id)); + [dict enumerateKeysAndObjectsUsingBlock:^(BOOL aKey, id aObject, BOOL *stop) { XCTAssertLessThan(idx, 2U); seenKeys[idx] = aKey; - seenValues[idx] = aValue; + seenObjects[idx] = aObject; XCTAssertNotEqual(stop, NULL); ++idx; }]; @@ -2209,18 +2209,18 @@ for (int j = 0; (j < 2) && !foundKey; ++j) { if (kKeys[i] == seenKeys[j]) { foundKey = YES; - XCTAssertEqualObjects(kValues[i], seenValues[j], @"i = %d, j = %d", i, j); + XCTAssertEqualObjects(kObjects[i], seenObjects[j], @"i = %d, j = %d", i, j); } } XCTAssertTrue(foundKey, @"i = %d", i); } free(seenKeys); - free(seenValues); + free(seenObjects); // Stopping the enumeration. idx = 0; - [dict enumerateKeysAndValuesUsingBlock:^(BOOL aKey, id aValue, BOOL *stop) { - #pragma unused(aKey, aValue) + [dict enumerateKeysAndObjectsUsingBlock:^(BOOL aKey, id aObject, BOOL *stop) { + #pragma unused(aKey, aObject) if (idx == 0) *stop = YES; XCTAssertNotEqual(idx, 2U); ++idx; @@ -2231,33 +2231,33 @@ - (void)testEquality { const BOOL kKeys1[] = { YES, NO }; const BOOL kKeys2[] = { NO, YES }; - const id kValues1[] = { @"abc", @"def" }; - const id kValues2[] = { @"def", @"abc" }; - const id kValues3[] = { @"def" }; + const id kObjects1[] = { @"abc", @"def" }; + const id kObjects2[] = { @"def", @"abc" }; + const id kObjects3[] = { @"def" }; GPBBoolObjectDictionary *dict1 = - [[GPBBoolObjectDictionary alloc] initWithValues:kValues1 - forKeys:kKeys1 - count:GPBARRAYSIZE(kValues1)]; + [[GPBBoolObjectDictionary alloc] initWithObjects:kObjects1 + forKeys:kKeys1 + count:GPBARRAYSIZE(kObjects1)]; XCTAssertNotNil(dict1); GPBBoolObjectDictionary *dict1prime = - [[GPBBoolObjectDictionary alloc] initWithValues:kValues1 - forKeys:kKeys1 - count:GPBARRAYSIZE(kValues1)]; + [[GPBBoolObjectDictionary alloc] initWithObjects:kObjects1 + forKeys:kKeys1 + count:GPBARRAYSIZE(kObjects1)]; XCTAssertNotNil(dict1prime); GPBBoolObjectDictionary *dict2 = - [[GPBBoolObjectDictionary alloc] initWithValues:kValues2 - forKeys:kKeys1 - count:GPBARRAYSIZE(kValues2)]; + [[GPBBoolObjectDictionary alloc] initWithObjects:kObjects2 + forKeys:kKeys1 + count:GPBARRAYSIZE(kObjects2)]; XCTAssertNotNil(dict2); GPBBoolObjectDictionary *dict3 = - [[GPBBoolObjectDictionary alloc] initWithValues:kValues1 - forKeys:kKeys2 - count:GPBARRAYSIZE(kValues1)]; + [[GPBBoolObjectDictionary alloc] initWithObjects:kObjects1 + forKeys:kKeys2 + count:GPBARRAYSIZE(kObjects1)]; XCTAssertNotNil(dict3); GPBBoolObjectDictionary *dict4 = - [[GPBBoolObjectDictionary alloc] initWithValues:kValues3 - forKeys:kKeys1 - count:GPBARRAYSIZE(kValues3)]; + [[GPBBoolObjectDictionary alloc] initWithObjects:kObjects3 + forKeys:kKeys1 + count:GPBARRAYSIZE(kObjects3)]; XCTAssertNotNil(dict4); // 1/1Prime should be different objects, but equal. @@ -2266,10 +2266,10 @@ // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different objects; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same objects; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 Fewer pairs; not equal @@ -2284,11 +2284,11 @@ - (void)testCopy { const BOOL kKeys[] = { YES, NO }; - const id kValues[] = { @"abc", @"def" }; + const id kObjects[] = { @"abc", @"def" }; GPBBoolObjectDictionary *dict = - [[GPBBoolObjectDictionary alloc] initWithValues:kValues - forKeys:kKeys - count:GPBARRAYSIZE(kValues)]; + [[GPBBoolObjectDictionary alloc] initWithObjects:kObjects + forKeys:kKeys + count:GPBARRAYSIZE(kObjects)]; XCTAssertNotNil(dict); GPBBoolObjectDictionary *dict2 = [dict copy]; @@ -2305,11 +2305,11 @@ - (void)testDictionaryFromDictionary { const BOOL kKeys[] = { YES, NO }; - const id kValues[] = { @"abc", @"def" }; + const id kObjects[] = { @"abc", @"def" }; GPBBoolObjectDictionary *dict = - [[GPBBoolObjectDictionary alloc] initWithValues:kValues - forKeys:kKeys - count:GPBARRAYSIZE(kValues)]; + [[GPBBoolObjectDictionary alloc] initWithObjects:kObjects + forKeys:kKeys + count:GPBARRAYSIZE(kObjects)]; XCTAssertNotNil(dict); GPBBoolObjectDictionary *dict2 = @@ -2327,85 +2327,85 @@ XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); - [dict setValue:@"abc" forKey:YES]; + [dict setObject:@"abc" forKey:YES]; XCTAssertEqual(dict.count, 1U); const BOOL kKeys[] = { NO }; - const id kValues[] = { @"def" }; + const id kObjects[] = { @"def" }; GPBBoolObjectDictionary *dict2 = - [[GPBBoolObjectDictionary alloc] initWithValues:kValues - forKeys:kKeys - count:GPBARRAYSIZE(kValues)]; + [[GPBBoolObjectDictionary alloc] initWithObjects:kObjects + forKeys:kKeys + count:GPBARRAYSIZE(kObjects)]; XCTAssertNotNil(dict2); [dict addEntriesFromDictionary:dict2]; XCTAssertEqual(dict.count, 2U); - XCTAssertEqualObjects([dict valueForKey:YES], @"abc"); - XCTAssertEqualObjects([dict valueForKey:NO], @"def"); + XCTAssertEqualObjects([dict objectForKey:YES], @"abc"); + XCTAssertEqualObjects([dict objectForKey:NO], @"def"); [dict2 release]; } - (void)testRemove { const BOOL kKeys[] = { YES, NO}; - const id kValues[] = { @"abc", @"def" }; + const id kObjects[] = { @"abc", @"def" }; GPBBoolObjectDictionary *dict = - [[GPBBoolObjectDictionary alloc] initWithValues:kValues - forKeys:kKeys - count:GPBARRAYSIZE(kValues)]; + [[GPBBoolObjectDictionary alloc] initWithObjects:kObjects + forKeys:kKeys + count:GPBARRAYSIZE(kObjects)]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 2U); - [dict removeValueForKey:NO]; + [dict removeObjectForKey:NO]; XCTAssertEqual(dict.count, 1U); - XCTAssertEqualObjects([dict valueForKey:YES], @"abc"); - XCTAssertNil([dict valueForKey:NO]); + XCTAssertEqualObjects([dict objectForKey:YES], @"abc"); + XCTAssertNil([dict objectForKey:NO]); // Remove again does nothing. - [dict removeValueForKey:NO]; + [dict removeObjectForKey:NO]; XCTAssertEqual(dict.count, 1U); - XCTAssertEqualObjects([dict valueForKey:YES], @"abc"); - XCTAssertNil([dict valueForKey:NO]); + XCTAssertEqualObjects([dict objectForKey:YES], @"abc"); + XCTAssertNil([dict objectForKey:NO]); [dict removeAll]; XCTAssertEqual(dict.count, 0U); - XCTAssertNil([dict valueForKey:YES]); - XCTAssertNil([dict valueForKey:NO]); + XCTAssertNil([dict objectForKey:YES]); + XCTAssertNil([dict objectForKey:NO]); [dict release]; } - (void)testInplaceMutation { const BOOL kKeys[] = { YES, NO }; - const id kValues[] = { @"abc", @"def" }; + const id kObjects[] = { @"abc", @"def" }; GPBBoolObjectDictionary *dict = - [[GPBBoolObjectDictionary alloc] initWithValues:kValues - forKeys:kKeys - count:GPBARRAYSIZE(kValues)]; + [[GPBBoolObjectDictionary alloc] initWithObjects:kObjects + forKeys:kKeys + count:GPBARRAYSIZE(kObjects)]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 2U); - XCTAssertEqualObjects([dict valueForKey:YES], @"abc"); - XCTAssertEqualObjects([dict valueForKey:NO], @"def"); + XCTAssertEqualObjects([dict objectForKey:YES], @"abc"); + XCTAssertEqualObjects([dict objectForKey:NO], @"def"); - [dict setValue:@"def" forKey:YES]; + [dict setObject:@"def" forKey:YES]; XCTAssertEqual(dict.count, 2U); - XCTAssertEqualObjects([dict valueForKey:YES], @"def"); - XCTAssertEqualObjects([dict valueForKey:NO], @"def"); + XCTAssertEqualObjects([dict objectForKey:YES], @"def"); + XCTAssertEqualObjects([dict objectForKey:NO], @"def"); - [dict setValue:@"abc" forKey:NO]; + [dict setObject:@"abc" forKey:NO]; XCTAssertEqual(dict.count, 2U); - XCTAssertEqualObjects([dict valueForKey:YES], @"def"); - XCTAssertEqualObjects([dict valueForKey:NO], @"abc"); + XCTAssertEqualObjects([dict objectForKey:YES], @"def"); + XCTAssertEqualObjects([dict objectForKey:NO], @"abc"); const BOOL kKeys2[] = { NO, YES }; - const id kValues2[] = { @"def", @"abc" }; + const id kObjects2[] = { @"def", @"abc" }; GPBBoolObjectDictionary *dict2 = - [[GPBBoolObjectDictionary alloc] initWithValues:kValues2 - forKeys:kKeys2 - count:GPBARRAYSIZE(kValues2)]; + [[GPBBoolObjectDictionary alloc] initWithObjects:kObjects2 + forKeys:kKeys2 + count:GPBARRAYSIZE(kObjects2)]; XCTAssertNotNil(dict2); [dict addEntriesFromDictionary:dict2]; XCTAssertEqual(dict.count, 2U); - XCTAssertEqualObjects([dict valueForKey:YES], @"abc"); - XCTAssertEqualObjects([dict valueForKey:NO], @"def"); + XCTAssertEqualObjects([dict objectForKey:YES], @"abc"); + XCTAssertEqualObjects([dict objectForKey:NO], @"def"); [dict2 release]; [dict release]; diff --git a/objectivec/Tests/GPBDictionaryTests+Int32.m b/objectivec/Tests/GPBDictionaryTests+Int32.m index 1ee099ee..21d3f07d 100644 --- a/objectivec/Tests/GPBDictionaryTests+Int32.m +++ b/objectivec/Tests/GPBDictionaryTests+Int32.m @@ -211,10 +211,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -568,10 +568,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -925,10 +925,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -1282,10 +1282,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -1639,10 +1639,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -1996,10 +1996,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -2353,10 +2353,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -2710,10 +2710,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -3071,10 +3071,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -3366,48 +3366,48 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { GPBInt32ObjectDictionary *dict = [[GPBInt32ObjectDictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); - XCTAssertNil([dict valueForKey:11]); - [dict enumerateKeysAndValuesUsingBlock:^(int32_t aKey, id aValue, BOOL *stop) { - #pragma unused(aKey, aValue, stop) + XCTAssertNil([dict objectForKey:11]); + [dict enumerateKeysAndObjectsUsingBlock:^(int32_t aKey, id aObject, BOOL *stop) { + #pragma unused(aKey, aObject, stop) XCTFail(@"Shouldn't get here!"); }]; [dict release]; } - (void)testOne { - GPBInt32ObjectDictionary *dict = [GPBInt32ObjectDictionary dictionaryWithValue:@"abc" forKey:11]; + GPBInt32ObjectDictionary *dict = [GPBInt32ObjectDictionary dictionaryWithObject:@"abc" forKey:11]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); - XCTAssertEqualObjects([dict valueForKey:11], @"abc"); - XCTAssertNil([dict valueForKey:12]); - [dict enumerateKeysAndValuesUsingBlock:^(int32_t aKey, id aValue, BOOL *stop) { + XCTAssertEqualObjects([dict objectForKey:11], @"abc"); + XCTAssertNil([dict objectForKey:12]); + [dict enumerateKeysAndObjectsUsingBlock:^(int32_t aKey, id aObject, BOOL *stop) { XCTAssertEqual(aKey, 11); - XCTAssertEqualObjects(aValue, @"abc"); + XCTAssertEqualObjects(aObject, @"abc"); XCTAssertNotEqual(stop, NULL); }]; } - (void)testBasics { const int32_t kKeys[] = { 11, 12, 13 }; - const id kValues[] = { @"abc", @"def", @"ghi" }; + const id kObjects[] = { @"abc", @"def", @"ghi" }; GPBInt32ObjectDictionary *dict = - [[GPBInt32ObjectDictionary alloc] initWithValues:kValues - forKeys:kKeys - count:GPBARRAYSIZE(kValues)]; + [[GPBInt32ObjectDictionary alloc] initWithObjects:kObjects + forKeys:kKeys + count:GPBARRAYSIZE(kObjects)]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 3U); - XCTAssertEqualObjects([dict valueForKey:11], @"abc"); - XCTAssertEqualObjects([dict valueForKey:12], @"def"); - XCTAssertEqualObjects([dict valueForKey:13], @"ghi"); - XCTAssertNil([dict valueForKey:14]); + XCTAssertEqualObjects([dict objectForKey:11], @"abc"); + XCTAssertEqualObjects([dict objectForKey:12], @"def"); + XCTAssertEqualObjects([dict objectForKey:13], @"ghi"); + XCTAssertNil([dict objectForKey:14]); __block NSUInteger idx = 0; int32_t *seenKeys = malloc(3 * sizeof(int32_t)); - id *seenValues = malloc(3 * sizeof(id)); - [dict enumerateKeysAndValuesUsingBlock:^(int32_t aKey, id aValue, BOOL *stop) { + id *seenObjects = malloc(3 * sizeof(id)); + [dict enumerateKeysAndObjectsUsingBlock:^(int32_t aKey, id aObject, BOOL *stop) { XCTAssertLessThan(idx, 3U); seenKeys[idx] = aKey; - seenValues[idx] = aValue; + seenObjects[idx] = aObject; XCTAssertNotEqual(stop, NULL); ++idx; }]; @@ -3416,18 +3416,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { for (int j = 0; (j < 3) && !foundKey; ++j) { if (kKeys[i] == seenKeys[j]) { foundKey = YES; - XCTAssertEqualObjects(kValues[i], seenValues[j], @"i = %d, j = %d", i, j); + XCTAssertEqualObjects(kObjects[i], seenObjects[j], @"i = %d, j = %d", i, j); } } XCTAssertTrue(foundKey, @"i = %d", i); } free(seenKeys); - free(seenValues); + free(seenObjects); // Stopping the enumeration. idx = 0; - [dict enumerateKeysAndValuesUsingBlock:^(int32_t aKey, id aValue, BOOL *stop) { - #pragma unused(aKey, aValue) + [dict enumerateKeysAndObjectsUsingBlock:^(int32_t aKey, id aObject, BOOL *stop) { + #pragma unused(aKey, aObject) if (idx == 1) *stop = YES; XCTAssertNotEqual(idx, 2U); ++idx; @@ -3438,33 +3438,33 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { - (void)testEquality { const int32_t kKeys1[] = { 11, 12, 13, 14 }; const int32_t kKeys2[] = { 12, 11, 14 }; - const id kValues1[] = { @"abc", @"def", @"ghi" }; - const id kValues2[] = { @"abc", @"jkl", @"ghi" }; - const id kValues3[] = { @"abc", @"def", @"ghi", @"jkl" }; + const id kObjects1[] = { @"abc", @"def", @"ghi" }; + const id kObjects2[] = { @"abc", @"jkl", @"ghi" }; + const id kObjects3[] = { @"abc", @"def", @"ghi", @"jkl" }; GPBInt32ObjectDictionary *dict1 = - [[GPBInt32ObjectDictionary alloc] initWithValues:kValues1 - forKeys:kKeys1 - count:GPBARRAYSIZE(kValues1)]; + [[GPBInt32ObjectDictionary alloc] initWithObjects:kObjects1 + forKeys:kKeys1 + count:GPBARRAYSIZE(kObjects1)]; XCTAssertNotNil(dict1); GPBInt32ObjectDictionary *dict1prime = - [[GPBInt32ObjectDictionary alloc] initWithValues:kValues1 - forKeys:kKeys1 - count:GPBARRAYSIZE(kValues1)]; + [[GPBInt32ObjectDictionary alloc] initWithObjects:kObjects1 + forKeys:kKeys1 + count:GPBARRAYSIZE(kObjects1)]; XCTAssertNotNil(dict1prime); GPBInt32ObjectDictionary *dict2 = - [[GPBInt32ObjectDictionary alloc] initWithValues:kValues2 - forKeys:kKeys1 - count:GPBARRAYSIZE(kValues2)]; + [[GPBInt32ObjectDictionary alloc] initWithObjects:kObjects2 + forKeys:kKeys1 + count:GPBARRAYSIZE(kObjects2)]; XCTAssertNotNil(dict2); GPBInt32ObjectDictionary *dict3 = - [[GPBInt32ObjectDictionary alloc] initWithValues:kValues1 - forKeys:kKeys2 - count:GPBARRAYSIZE(kValues1)]; + [[GPBInt32ObjectDictionary alloc] initWithObjects:kObjects1 + forKeys:kKeys2 + count:GPBARRAYSIZE(kObjects1)]; XCTAssertNotNil(dict3); GPBInt32ObjectDictionary *dict4 = - [[GPBInt32ObjectDictionary alloc] initWithValues:kValues3 - forKeys:kKeys1 - count:GPBARRAYSIZE(kValues3)]; + [[GPBInt32ObjectDictionary alloc] initWithObjects:kObjects3 + forKeys:kKeys1 + count:GPBARRAYSIZE(kObjects3)]; XCTAssertNotNil(dict4); // 1/1Prime should be different objects, but equal. @@ -3473,10 +3473,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different objects; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same objects; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -3491,11 +3491,11 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { - (void)testCopy { const int32_t kKeys[] = { 11, 12, 13, 14 }; - const id kValues[] = { @"abc", @"def", @"ghi", @"jkl" }; + const id kObjects[] = { @"abc", @"def", @"ghi", @"jkl" }; GPBInt32ObjectDictionary *dict = - [[GPBInt32ObjectDictionary alloc] initWithValues:kValues - forKeys:kKeys - count:GPBARRAYSIZE(kValues)]; + [[GPBInt32ObjectDictionary alloc] initWithObjects:kObjects + forKeys:kKeys + count:GPBARRAYSIZE(kObjects)]; XCTAssertNotNil(dict); GPBInt32ObjectDictionary *dict2 = [dict copy]; @@ -3512,11 +3512,11 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { - (void)testDictionaryFromDictionary { const int32_t kKeys[] = { 11, 12, 13, 14 }; - const id kValues[] = { @"abc", @"def", @"ghi", @"jkl" }; + const id kObjects[] = { @"abc", @"def", @"ghi", @"jkl" }; GPBInt32ObjectDictionary *dict = - [[GPBInt32ObjectDictionary alloc] initWithValues:kValues - forKeys:kKeys - count:GPBARRAYSIZE(kValues)]; + [[GPBInt32ObjectDictionary alloc] initWithObjects:kObjects + forKeys:kKeys + count:GPBARRAYSIZE(kObjects)]; XCTAssertNotNil(dict); GPBInt32ObjectDictionary *dict2 = @@ -3534,108 +3534,108 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); - [dict setValue:@"abc" forKey:11]; + [dict setObject:@"abc" forKey:11]; XCTAssertEqual(dict.count, 1U); const int32_t kKeys[] = { 12, 13, 14 }; - const id kValues[] = { @"def", @"ghi", @"jkl" }; + const id kObjects[] = { @"def", @"ghi", @"jkl" }; GPBInt32ObjectDictionary *dict2 = - [[GPBInt32ObjectDictionary alloc] initWithValues:kValues - forKeys:kKeys - count:GPBARRAYSIZE(kValues)]; + [[GPBInt32ObjectDictionary alloc] initWithObjects:kObjects + forKeys:kKeys + count:GPBARRAYSIZE(kObjects)]; XCTAssertNotNil(dict2); [dict addEntriesFromDictionary:dict2]; XCTAssertEqual(dict.count, 4U); - XCTAssertEqualObjects([dict valueForKey:11], @"abc"); - XCTAssertEqualObjects([dict valueForKey:12], @"def"); - XCTAssertEqualObjects([dict valueForKey:13], @"ghi"); - XCTAssertEqualObjects([dict valueForKey:14], @"jkl"); + XCTAssertEqualObjects([dict objectForKey:11], @"abc"); + XCTAssertEqualObjects([dict objectForKey:12], @"def"); + XCTAssertEqualObjects([dict objectForKey:13], @"ghi"); + XCTAssertEqualObjects([dict objectForKey:14], @"jkl"); [dict2 release]; } - (void)testRemove { const int32_t kKeys[] = { 11, 12, 13, 14 }; - const id kValues[] = { @"abc", @"def", @"ghi", @"jkl" }; + const id kObjects[] = { @"abc", @"def", @"ghi", @"jkl" }; GPBInt32ObjectDictionary *dict = - [[GPBInt32ObjectDictionary alloc] initWithValues:kValues - forKeys:kKeys - count:GPBARRAYSIZE(kValues)]; + [[GPBInt32ObjectDictionary alloc] initWithObjects:kObjects + forKeys:kKeys + count:GPBARRAYSIZE(kObjects)]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 4U); - [dict removeValueForKey:12]; + [dict removeObjectForKey:12]; XCTAssertEqual(dict.count, 3U); - XCTAssertEqualObjects([dict valueForKey:11], @"abc"); - XCTAssertNil([dict valueForKey:12]); - XCTAssertEqualObjects([dict valueForKey:13], @"ghi"); - XCTAssertEqualObjects([dict valueForKey:14], @"jkl"); + XCTAssertEqualObjects([dict objectForKey:11], @"abc"); + XCTAssertNil([dict objectForKey:12]); + XCTAssertEqualObjects([dict objectForKey:13], @"ghi"); + XCTAssertEqualObjects([dict objectForKey:14], @"jkl"); // Remove again does nothing. - [dict removeValueForKey:12]; + [dict removeObjectForKey:12]; XCTAssertEqual(dict.count, 3U); - XCTAssertEqualObjects([dict valueForKey:11], @"abc"); - XCTAssertNil([dict valueForKey:12]); - XCTAssertEqualObjects([dict valueForKey:13], @"ghi"); - XCTAssertEqualObjects([dict valueForKey:14], @"jkl"); + XCTAssertEqualObjects([dict objectForKey:11], @"abc"); + XCTAssertNil([dict objectForKey:12]); + XCTAssertEqualObjects([dict objectForKey:13], @"ghi"); + XCTAssertEqualObjects([dict objectForKey:14], @"jkl"); - [dict removeValueForKey:14]; + [dict removeObjectForKey:14]; XCTAssertEqual(dict.count, 2U); - XCTAssertEqualObjects([dict valueForKey:11], @"abc"); - XCTAssertNil([dict valueForKey:12]); - XCTAssertEqualObjects([dict valueForKey:13], @"ghi"); - XCTAssertNil([dict valueForKey:14]); + XCTAssertEqualObjects([dict objectForKey:11], @"abc"); + XCTAssertNil([dict objectForKey:12]); + XCTAssertEqualObjects([dict objectForKey:13], @"ghi"); + XCTAssertNil([dict objectForKey:14]); [dict removeAll]; XCTAssertEqual(dict.count, 0U); - XCTAssertNil([dict valueForKey:11]); - XCTAssertNil([dict valueForKey:12]); - XCTAssertNil([dict valueForKey:13]); - XCTAssertNil([dict valueForKey:14]); + XCTAssertNil([dict objectForKey:11]); + XCTAssertNil([dict objectForKey:12]); + XCTAssertNil([dict objectForKey:13]); + XCTAssertNil([dict objectForKey:14]); [dict release]; } - (void)testInplaceMutation { const int32_t kKeys[] = { 11, 12, 13, 14 }; - const id kValues[] = { @"abc", @"def", @"ghi", @"jkl" }; + const id kObjects[] = { @"abc", @"def", @"ghi", @"jkl" }; GPBInt32ObjectDictionary *dict = - [[GPBInt32ObjectDictionary alloc] initWithValues:kValues - forKeys:kKeys - count:GPBARRAYSIZE(kValues)]; + [[GPBInt32ObjectDictionary alloc] initWithObjects:kObjects + forKeys:kKeys + count:GPBARRAYSIZE(kObjects)]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 4U); - XCTAssertEqualObjects([dict valueForKey:11], @"abc"); - XCTAssertEqualObjects([dict valueForKey:12], @"def"); - XCTAssertEqualObjects([dict valueForKey:13], @"ghi"); - XCTAssertEqualObjects([dict valueForKey:14], @"jkl"); + XCTAssertEqualObjects([dict objectForKey:11], @"abc"); + XCTAssertEqualObjects([dict objectForKey:12], @"def"); + XCTAssertEqualObjects([dict objectForKey:13], @"ghi"); + XCTAssertEqualObjects([dict objectForKey:14], @"jkl"); - [dict setValue:@"jkl" forKey:11]; + [dict setObject:@"jkl" forKey:11]; XCTAssertEqual(dict.count, 4U); - XCTAssertEqualObjects([dict valueForKey:11], @"jkl"); - XCTAssertEqualObjects([dict valueForKey:12], @"def"); - XCTAssertEqualObjects([dict valueForKey:13], @"ghi"); - XCTAssertEqualObjects([dict valueForKey:14], @"jkl"); + XCTAssertEqualObjects([dict objectForKey:11], @"jkl"); + XCTAssertEqualObjects([dict objectForKey:12], @"def"); + XCTAssertEqualObjects([dict objectForKey:13], @"ghi"); + XCTAssertEqualObjects([dict objectForKey:14], @"jkl"); - [dict setValue:@"def" forKey:14]; + [dict setObject:@"def" forKey:14]; XCTAssertEqual(dict.count, 4U); - XCTAssertEqualObjects([dict valueForKey:11], @"jkl"); - XCTAssertEqualObjects([dict valueForKey:12], @"def"); - XCTAssertEqualObjects([dict valueForKey:13], @"ghi"); - XCTAssertEqualObjects([dict valueForKey:14], @"def"); + XCTAssertEqualObjects([dict objectForKey:11], @"jkl"); + XCTAssertEqualObjects([dict objectForKey:12], @"def"); + XCTAssertEqualObjects([dict objectForKey:13], @"ghi"); + XCTAssertEqualObjects([dict objectForKey:14], @"def"); const int32_t kKeys2[] = { 12, 13 }; - const id kValues2[] = { @"ghi", @"abc" }; + const id kObjects2[] = { @"ghi", @"abc" }; GPBInt32ObjectDictionary *dict2 = - [[GPBInt32ObjectDictionary alloc] initWithValues:kValues2 - forKeys:kKeys2 - count:GPBARRAYSIZE(kValues2)]; + [[GPBInt32ObjectDictionary alloc] initWithObjects:kObjects2 + forKeys:kKeys2 + count:GPBARRAYSIZE(kObjects2)]; XCTAssertNotNil(dict2); [dict addEntriesFromDictionary:dict2]; XCTAssertEqual(dict.count, 4U); - XCTAssertEqualObjects([dict valueForKey:11], @"jkl"); - XCTAssertEqualObjects([dict valueForKey:12], @"ghi"); - XCTAssertEqualObjects([dict valueForKey:13], @"abc"); - XCTAssertEqualObjects([dict valueForKey:14], @"def"); + XCTAssertEqualObjects([dict objectForKey:11], @"jkl"); + XCTAssertEqualObjects([dict objectForKey:12], @"ghi"); + XCTAssertEqualObjects([dict objectForKey:13], @"abc"); + XCTAssertEqualObjects([dict objectForKey:14], @"def"); [dict2 release]; [dict release]; diff --git a/objectivec/Tests/GPBDictionaryTests+Int64.m b/objectivec/Tests/GPBDictionaryTests+Int64.m index 4a94e033..27f77f28 100644 --- a/objectivec/Tests/GPBDictionaryTests+Int64.m +++ b/objectivec/Tests/GPBDictionaryTests+Int64.m @@ -211,10 +211,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -568,10 +568,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -925,10 +925,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -1282,10 +1282,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -1639,10 +1639,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -1996,10 +1996,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -2353,10 +2353,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -2710,10 +2710,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -3071,10 +3071,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -3366,48 +3366,48 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { GPBInt64ObjectDictionary *dict = [[GPBInt64ObjectDictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); - XCTAssertNil([dict valueForKey:21LL]); - [dict enumerateKeysAndValuesUsingBlock:^(int64_t aKey, id aValue, BOOL *stop) { - #pragma unused(aKey, aValue, stop) + XCTAssertNil([dict objectForKey:21LL]); + [dict enumerateKeysAndObjectsUsingBlock:^(int64_t aKey, id aObject, BOOL *stop) { + #pragma unused(aKey, aObject, stop) XCTFail(@"Shouldn't get here!"); }]; [dict release]; } - (void)testOne { - GPBInt64ObjectDictionary *dict = [GPBInt64ObjectDictionary dictionaryWithValue:@"abc" forKey:21LL]; + GPBInt64ObjectDictionary *dict = [GPBInt64ObjectDictionary dictionaryWithObject:@"abc" forKey:21LL]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); - XCTAssertEqualObjects([dict valueForKey:21LL], @"abc"); - XCTAssertNil([dict valueForKey:22LL]); - [dict enumerateKeysAndValuesUsingBlock:^(int64_t aKey, id aValue, BOOL *stop) { + XCTAssertEqualObjects([dict objectForKey:21LL], @"abc"); + XCTAssertNil([dict objectForKey:22LL]); + [dict enumerateKeysAndObjectsUsingBlock:^(int64_t aKey, id aObject, BOOL *stop) { XCTAssertEqual(aKey, 21LL); - XCTAssertEqualObjects(aValue, @"abc"); + XCTAssertEqualObjects(aObject, @"abc"); XCTAssertNotEqual(stop, NULL); }]; } - (void)testBasics { const int64_t kKeys[] = { 21LL, 22LL, 23LL }; - const id kValues[] = { @"abc", @"def", @"ghi" }; + const id kObjects[] = { @"abc", @"def", @"ghi" }; GPBInt64ObjectDictionary *dict = - [[GPBInt64ObjectDictionary alloc] initWithValues:kValues - forKeys:kKeys - count:GPBARRAYSIZE(kValues)]; + [[GPBInt64ObjectDictionary alloc] initWithObjects:kObjects + forKeys:kKeys + count:GPBARRAYSIZE(kObjects)]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 3U); - XCTAssertEqualObjects([dict valueForKey:21LL], @"abc"); - XCTAssertEqualObjects([dict valueForKey:22LL], @"def"); - XCTAssertEqualObjects([dict valueForKey:23LL], @"ghi"); - XCTAssertNil([dict valueForKey:24LL]); + XCTAssertEqualObjects([dict objectForKey:21LL], @"abc"); + XCTAssertEqualObjects([dict objectForKey:22LL], @"def"); + XCTAssertEqualObjects([dict objectForKey:23LL], @"ghi"); + XCTAssertNil([dict objectForKey:24LL]); __block NSUInteger idx = 0; int64_t *seenKeys = malloc(3 * sizeof(int64_t)); - id *seenValues = malloc(3 * sizeof(id)); - [dict enumerateKeysAndValuesUsingBlock:^(int64_t aKey, id aValue, BOOL *stop) { + id *seenObjects = malloc(3 * sizeof(id)); + [dict enumerateKeysAndObjectsUsingBlock:^(int64_t aKey, id aObject, BOOL *stop) { XCTAssertLessThan(idx, 3U); seenKeys[idx] = aKey; - seenValues[idx] = aValue; + seenObjects[idx] = aObject; XCTAssertNotEqual(stop, NULL); ++idx; }]; @@ -3416,18 +3416,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { for (int j = 0; (j < 3) && !foundKey; ++j) { if (kKeys[i] == seenKeys[j]) { foundKey = YES; - XCTAssertEqualObjects(kValues[i], seenValues[j], @"i = %d, j = %d", i, j); + XCTAssertEqualObjects(kObjects[i], seenObjects[j], @"i = %d, j = %d", i, j); } } XCTAssertTrue(foundKey, @"i = %d", i); } free(seenKeys); - free(seenValues); + free(seenObjects); // Stopping the enumeration. idx = 0; - [dict enumerateKeysAndValuesUsingBlock:^(int64_t aKey, id aValue, BOOL *stop) { - #pragma unused(aKey, aValue) + [dict enumerateKeysAndObjectsUsingBlock:^(int64_t aKey, id aObject, BOOL *stop) { + #pragma unused(aKey, aObject) if (idx == 1) *stop = YES; XCTAssertNotEqual(idx, 2U); ++idx; @@ -3438,33 +3438,33 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { - (void)testEquality { const int64_t kKeys1[] = { 21LL, 22LL, 23LL, 24LL }; const int64_t kKeys2[] = { 22LL, 21LL, 24LL }; - const id kValues1[] = { @"abc", @"def", @"ghi" }; - const id kValues2[] = { @"abc", @"jkl", @"ghi" }; - const id kValues3[] = { @"abc", @"def", @"ghi", @"jkl" }; + const id kObjects1[] = { @"abc", @"def", @"ghi" }; + const id kObjects2[] = { @"abc", @"jkl", @"ghi" }; + const id kObjects3[] = { @"abc", @"def", @"ghi", @"jkl" }; GPBInt64ObjectDictionary *dict1 = - [[GPBInt64ObjectDictionary alloc] initWithValues:kValues1 - forKeys:kKeys1 - count:GPBARRAYSIZE(kValues1)]; + [[GPBInt64ObjectDictionary alloc] initWithObjects:kObjects1 + forKeys:kKeys1 + count:GPBARRAYSIZE(kObjects1)]; XCTAssertNotNil(dict1); GPBInt64ObjectDictionary *dict1prime = - [[GPBInt64ObjectDictionary alloc] initWithValues:kValues1 - forKeys:kKeys1 - count:GPBARRAYSIZE(kValues1)]; + [[GPBInt64ObjectDictionary alloc] initWithObjects:kObjects1 + forKeys:kKeys1 + count:GPBARRAYSIZE(kObjects1)]; XCTAssertNotNil(dict1prime); GPBInt64ObjectDictionary *dict2 = - [[GPBInt64ObjectDictionary alloc] initWithValues:kValues2 - forKeys:kKeys1 - count:GPBARRAYSIZE(kValues2)]; + [[GPBInt64ObjectDictionary alloc] initWithObjects:kObjects2 + forKeys:kKeys1 + count:GPBARRAYSIZE(kObjects2)]; XCTAssertNotNil(dict2); GPBInt64ObjectDictionary *dict3 = - [[GPBInt64ObjectDictionary alloc] initWithValues:kValues1 - forKeys:kKeys2 - count:GPBARRAYSIZE(kValues1)]; + [[GPBInt64ObjectDictionary alloc] initWithObjects:kObjects1 + forKeys:kKeys2 + count:GPBARRAYSIZE(kObjects1)]; XCTAssertNotNil(dict3); GPBInt64ObjectDictionary *dict4 = - [[GPBInt64ObjectDictionary alloc] initWithValues:kValues3 - forKeys:kKeys1 - count:GPBARRAYSIZE(kValues3)]; + [[GPBInt64ObjectDictionary alloc] initWithObjects:kObjects3 + forKeys:kKeys1 + count:GPBARRAYSIZE(kObjects3)]; XCTAssertNotNil(dict4); // 1/1Prime should be different objects, but equal. @@ -3473,10 +3473,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different objects; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same objects; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -3491,11 +3491,11 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { - (void)testCopy { const int64_t kKeys[] = { 21LL, 22LL, 23LL, 24LL }; - const id kValues[] = { @"abc", @"def", @"ghi", @"jkl" }; + const id kObjects[] = { @"abc", @"def", @"ghi", @"jkl" }; GPBInt64ObjectDictionary *dict = - [[GPBInt64ObjectDictionary alloc] initWithValues:kValues - forKeys:kKeys - count:GPBARRAYSIZE(kValues)]; + [[GPBInt64ObjectDictionary alloc] initWithObjects:kObjects + forKeys:kKeys + count:GPBARRAYSIZE(kObjects)]; XCTAssertNotNil(dict); GPBInt64ObjectDictionary *dict2 = [dict copy]; @@ -3512,11 +3512,11 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { - (void)testDictionaryFromDictionary { const int64_t kKeys[] = { 21LL, 22LL, 23LL, 24LL }; - const id kValues[] = { @"abc", @"def", @"ghi", @"jkl" }; + const id kObjects[] = { @"abc", @"def", @"ghi", @"jkl" }; GPBInt64ObjectDictionary *dict = - [[GPBInt64ObjectDictionary alloc] initWithValues:kValues - forKeys:kKeys - count:GPBARRAYSIZE(kValues)]; + [[GPBInt64ObjectDictionary alloc] initWithObjects:kObjects + forKeys:kKeys + count:GPBARRAYSIZE(kObjects)]; XCTAssertNotNil(dict); GPBInt64ObjectDictionary *dict2 = @@ -3534,108 +3534,108 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); - [dict setValue:@"abc" forKey:21LL]; + [dict setObject:@"abc" forKey:21LL]; XCTAssertEqual(dict.count, 1U); const int64_t kKeys[] = { 22LL, 23LL, 24LL }; - const id kValues[] = { @"def", @"ghi", @"jkl" }; + const id kObjects[] = { @"def", @"ghi", @"jkl" }; GPBInt64ObjectDictionary *dict2 = - [[GPBInt64ObjectDictionary alloc] initWithValues:kValues - forKeys:kKeys - count:GPBARRAYSIZE(kValues)]; + [[GPBInt64ObjectDictionary alloc] initWithObjects:kObjects + forKeys:kKeys + count:GPBARRAYSIZE(kObjects)]; XCTAssertNotNil(dict2); [dict addEntriesFromDictionary:dict2]; XCTAssertEqual(dict.count, 4U); - XCTAssertEqualObjects([dict valueForKey:21LL], @"abc"); - XCTAssertEqualObjects([dict valueForKey:22LL], @"def"); - XCTAssertEqualObjects([dict valueForKey:23LL], @"ghi"); - XCTAssertEqualObjects([dict valueForKey:24LL], @"jkl"); + XCTAssertEqualObjects([dict objectForKey:21LL], @"abc"); + XCTAssertEqualObjects([dict objectForKey:22LL], @"def"); + XCTAssertEqualObjects([dict objectForKey:23LL], @"ghi"); + XCTAssertEqualObjects([dict objectForKey:24LL], @"jkl"); [dict2 release]; } - (void)testRemove { const int64_t kKeys[] = { 21LL, 22LL, 23LL, 24LL }; - const id kValues[] = { @"abc", @"def", @"ghi", @"jkl" }; + const id kObjects[] = { @"abc", @"def", @"ghi", @"jkl" }; GPBInt64ObjectDictionary *dict = - [[GPBInt64ObjectDictionary alloc] initWithValues:kValues - forKeys:kKeys - count:GPBARRAYSIZE(kValues)]; + [[GPBInt64ObjectDictionary alloc] initWithObjects:kObjects + forKeys:kKeys + count:GPBARRAYSIZE(kObjects)]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 4U); - [dict removeValueForKey:22LL]; + [dict removeObjectForKey:22LL]; XCTAssertEqual(dict.count, 3U); - XCTAssertEqualObjects([dict valueForKey:21LL], @"abc"); - XCTAssertNil([dict valueForKey:22LL]); - XCTAssertEqualObjects([dict valueForKey:23LL], @"ghi"); - XCTAssertEqualObjects([dict valueForKey:24LL], @"jkl"); + XCTAssertEqualObjects([dict objectForKey:21LL], @"abc"); + XCTAssertNil([dict objectForKey:22LL]); + XCTAssertEqualObjects([dict objectForKey:23LL], @"ghi"); + XCTAssertEqualObjects([dict objectForKey:24LL], @"jkl"); // Remove again does nothing. - [dict removeValueForKey:22LL]; + [dict removeObjectForKey:22LL]; XCTAssertEqual(dict.count, 3U); - XCTAssertEqualObjects([dict valueForKey:21LL], @"abc"); - XCTAssertNil([dict valueForKey:22LL]); - XCTAssertEqualObjects([dict valueForKey:23LL], @"ghi"); - XCTAssertEqualObjects([dict valueForKey:24LL], @"jkl"); + XCTAssertEqualObjects([dict objectForKey:21LL], @"abc"); + XCTAssertNil([dict objectForKey:22LL]); + XCTAssertEqualObjects([dict objectForKey:23LL], @"ghi"); + XCTAssertEqualObjects([dict objectForKey:24LL], @"jkl"); - [dict removeValueForKey:24LL]; + [dict removeObjectForKey:24LL]; XCTAssertEqual(dict.count, 2U); - XCTAssertEqualObjects([dict valueForKey:21LL], @"abc"); - XCTAssertNil([dict valueForKey:22LL]); - XCTAssertEqualObjects([dict valueForKey:23LL], @"ghi"); - XCTAssertNil([dict valueForKey:24LL]); + XCTAssertEqualObjects([dict objectForKey:21LL], @"abc"); + XCTAssertNil([dict objectForKey:22LL]); + XCTAssertEqualObjects([dict objectForKey:23LL], @"ghi"); + XCTAssertNil([dict objectForKey:24LL]); [dict removeAll]; XCTAssertEqual(dict.count, 0U); - XCTAssertNil([dict valueForKey:21LL]); - XCTAssertNil([dict valueForKey:22LL]); - XCTAssertNil([dict valueForKey:23LL]); - XCTAssertNil([dict valueForKey:24LL]); + XCTAssertNil([dict objectForKey:21LL]); + XCTAssertNil([dict objectForKey:22LL]); + XCTAssertNil([dict objectForKey:23LL]); + XCTAssertNil([dict objectForKey:24LL]); [dict release]; } - (void)testInplaceMutation { const int64_t kKeys[] = { 21LL, 22LL, 23LL, 24LL }; - const id kValues[] = { @"abc", @"def", @"ghi", @"jkl" }; + const id kObjects[] = { @"abc", @"def", @"ghi", @"jkl" }; GPBInt64ObjectDictionary *dict = - [[GPBInt64ObjectDictionary alloc] initWithValues:kValues - forKeys:kKeys - count:GPBARRAYSIZE(kValues)]; + [[GPBInt64ObjectDictionary alloc] initWithObjects:kObjects + forKeys:kKeys + count:GPBARRAYSIZE(kObjects)]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 4U); - XCTAssertEqualObjects([dict valueForKey:21LL], @"abc"); - XCTAssertEqualObjects([dict valueForKey:22LL], @"def"); - XCTAssertEqualObjects([dict valueForKey:23LL], @"ghi"); - XCTAssertEqualObjects([dict valueForKey:24LL], @"jkl"); + XCTAssertEqualObjects([dict objectForKey:21LL], @"abc"); + XCTAssertEqualObjects([dict objectForKey:22LL], @"def"); + XCTAssertEqualObjects([dict objectForKey:23LL], @"ghi"); + XCTAssertEqualObjects([dict objectForKey:24LL], @"jkl"); - [dict setValue:@"jkl" forKey:21LL]; + [dict setObject:@"jkl" forKey:21LL]; XCTAssertEqual(dict.count, 4U); - XCTAssertEqualObjects([dict valueForKey:21LL], @"jkl"); - XCTAssertEqualObjects([dict valueForKey:22LL], @"def"); - XCTAssertEqualObjects([dict valueForKey:23LL], @"ghi"); - XCTAssertEqualObjects([dict valueForKey:24LL], @"jkl"); + XCTAssertEqualObjects([dict objectForKey:21LL], @"jkl"); + XCTAssertEqualObjects([dict objectForKey:22LL], @"def"); + XCTAssertEqualObjects([dict objectForKey:23LL], @"ghi"); + XCTAssertEqualObjects([dict objectForKey:24LL], @"jkl"); - [dict setValue:@"def" forKey:24LL]; + [dict setObject:@"def" forKey:24LL]; XCTAssertEqual(dict.count, 4U); - XCTAssertEqualObjects([dict valueForKey:21LL], @"jkl"); - XCTAssertEqualObjects([dict valueForKey:22LL], @"def"); - XCTAssertEqualObjects([dict valueForKey:23LL], @"ghi"); - XCTAssertEqualObjects([dict valueForKey:24LL], @"def"); + XCTAssertEqualObjects([dict objectForKey:21LL], @"jkl"); + XCTAssertEqualObjects([dict objectForKey:22LL], @"def"); + XCTAssertEqualObjects([dict objectForKey:23LL], @"ghi"); + XCTAssertEqualObjects([dict objectForKey:24LL], @"def"); const int64_t kKeys2[] = { 22LL, 23LL }; - const id kValues2[] = { @"ghi", @"abc" }; + const id kObjects2[] = { @"ghi", @"abc" }; GPBInt64ObjectDictionary *dict2 = - [[GPBInt64ObjectDictionary alloc] initWithValues:kValues2 - forKeys:kKeys2 - count:GPBARRAYSIZE(kValues2)]; + [[GPBInt64ObjectDictionary alloc] initWithObjects:kObjects2 + forKeys:kKeys2 + count:GPBARRAYSIZE(kObjects2)]; XCTAssertNotNil(dict2); [dict addEntriesFromDictionary:dict2]; XCTAssertEqual(dict.count, 4U); - XCTAssertEqualObjects([dict valueForKey:21LL], @"jkl"); - XCTAssertEqualObjects([dict valueForKey:22LL], @"ghi"); - XCTAssertEqualObjects([dict valueForKey:23LL], @"abc"); - XCTAssertEqualObjects([dict valueForKey:24LL], @"def"); + XCTAssertEqualObjects([dict objectForKey:21LL], @"jkl"); + XCTAssertEqualObjects([dict objectForKey:22LL], @"ghi"); + XCTAssertEqualObjects([dict objectForKey:23LL], @"abc"); + XCTAssertEqualObjects([dict objectForKey:24LL], @"def"); [dict2 release]; [dict release]; diff --git a/objectivec/Tests/GPBDictionaryTests+String.m b/objectivec/Tests/GPBDictionaryTests+String.m index 09fbc608..bfa10b19 100644 --- a/objectivec/Tests/GPBDictionaryTests+String.m +++ b/objectivec/Tests/GPBDictionaryTests+String.m @@ -211,10 +211,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -568,10 +568,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -925,10 +925,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -1282,10 +1282,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -1639,10 +1639,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -1996,10 +1996,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -2353,10 +2353,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -2710,10 +2710,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -3071,10 +3071,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal diff --git a/objectivec/Tests/GPBDictionaryTests+UInt32.m b/objectivec/Tests/GPBDictionaryTests+UInt32.m index f8d280fa..c7c57652 100644 --- a/objectivec/Tests/GPBDictionaryTests+UInt32.m +++ b/objectivec/Tests/GPBDictionaryTests+UInt32.m @@ -211,10 +211,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -568,10 +568,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -925,10 +925,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -1282,10 +1282,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -1639,10 +1639,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -1996,10 +1996,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -2353,10 +2353,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -2710,10 +2710,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -3071,10 +3071,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -3366,48 +3366,48 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { GPBUInt32ObjectDictionary *dict = [[GPBUInt32ObjectDictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); - XCTAssertNil([dict valueForKey:1U]); - [dict enumerateKeysAndValuesUsingBlock:^(uint32_t aKey, id aValue, BOOL *stop) { - #pragma unused(aKey, aValue, stop) + XCTAssertNil([dict objectForKey:1U]); + [dict enumerateKeysAndObjectsUsingBlock:^(uint32_t aKey, id aObject, BOOL *stop) { + #pragma unused(aKey, aObject, stop) XCTFail(@"Shouldn't get here!"); }]; [dict release]; } - (void)testOne { - GPBUInt32ObjectDictionary *dict = [GPBUInt32ObjectDictionary dictionaryWithValue:@"abc" forKey:1U]; + GPBUInt32ObjectDictionary *dict = [GPBUInt32ObjectDictionary dictionaryWithObject:@"abc" forKey:1U]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); - XCTAssertEqualObjects([dict valueForKey:1U], @"abc"); - XCTAssertNil([dict valueForKey:2U]); - [dict enumerateKeysAndValuesUsingBlock:^(uint32_t aKey, id aValue, BOOL *stop) { + XCTAssertEqualObjects([dict objectForKey:1U], @"abc"); + XCTAssertNil([dict objectForKey:2U]); + [dict enumerateKeysAndObjectsUsingBlock:^(uint32_t aKey, id aObject, BOOL *stop) { XCTAssertEqual(aKey, 1U); - XCTAssertEqualObjects(aValue, @"abc"); + XCTAssertEqualObjects(aObject, @"abc"); XCTAssertNotEqual(stop, NULL); }]; } - (void)testBasics { const uint32_t kKeys[] = { 1U, 2U, 3U }; - const id kValues[] = { @"abc", @"def", @"ghi" }; + const id kObjects[] = { @"abc", @"def", @"ghi" }; GPBUInt32ObjectDictionary *dict = - [[GPBUInt32ObjectDictionary alloc] initWithValues:kValues - forKeys:kKeys - count:GPBARRAYSIZE(kValues)]; + [[GPBUInt32ObjectDictionary alloc] initWithObjects:kObjects + forKeys:kKeys + count:GPBARRAYSIZE(kObjects)]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 3U); - XCTAssertEqualObjects([dict valueForKey:1U], @"abc"); - XCTAssertEqualObjects([dict valueForKey:2U], @"def"); - XCTAssertEqualObjects([dict valueForKey:3U], @"ghi"); - XCTAssertNil([dict valueForKey:4U]); + XCTAssertEqualObjects([dict objectForKey:1U], @"abc"); + XCTAssertEqualObjects([dict objectForKey:2U], @"def"); + XCTAssertEqualObjects([dict objectForKey:3U], @"ghi"); + XCTAssertNil([dict objectForKey:4U]); __block NSUInteger idx = 0; uint32_t *seenKeys = malloc(3 * sizeof(uint32_t)); - id *seenValues = malloc(3 * sizeof(id)); - [dict enumerateKeysAndValuesUsingBlock:^(uint32_t aKey, id aValue, BOOL *stop) { + id *seenObjects = malloc(3 * sizeof(id)); + [dict enumerateKeysAndObjectsUsingBlock:^(uint32_t aKey, id aObject, BOOL *stop) { XCTAssertLessThan(idx, 3U); seenKeys[idx] = aKey; - seenValues[idx] = aValue; + seenObjects[idx] = aObject; XCTAssertNotEqual(stop, NULL); ++idx; }]; @@ -3416,18 +3416,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { for (int j = 0; (j < 3) && !foundKey; ++j) { if (kKeys[i] == seenKeys[j]) { foundKey = YES; - XCTAssertEqualObjects(kValues[i], seenValues[j], @"i = %d, j = %d", i, j); + XCTAssertEqualObjects(kObjects[i], seenObjects[j], @"i = %d, j = %d", i, j); } } XCTAssertTrue(foundKey, @"i = %d", i); } free(seenKeys); - free(seenValues); + free(seenObjects); // Stopping the enumeration. idx = 0; - [dict enumerateKeysAndValuesUsingBlock:^(uint32_t aKey, id aValue, BOOL *stop) { - #pragma unused(aKey, aValue) + [dict enumerateKeysAndObjectsUsingBlock:^(uint32_t aKey, id aObject, BOOL *stop) { + #pragma unused(aKey, aObject) if (idx == 1) *stop = YES; XCTAssertNotEqual(idx, 2U); ++idx; @@ -3438,33 +3438,33 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { - (void)testEquality { const uint32_t kKeys1[] = { 1U, 2U, 3U, 4U }; const uint32_t kKeys2[] = { 2U, 1U, 4U }; - const id kValues1[] = { @"abc", @"def", @"ghi" }; - const id kValues2[] = { @"abc", @"jkl", @"ghi" }; - const id kValues3[] = { @"abc", @"def", @"ghi", @"jkl" }; + const id kObjects1[] = { @"abc", @"def", @"ghi" }; + const id kObjects2[] = { @"abc", @"jkl", @"ghi" }; + const id kObjects3[] = { @"abc", @"def", @"ghi", @"jkl" }; GPBUInt32ObjectDictionary *dict1 = - [[GPBUInt32ObjectDictionary alloc] initWithValues:kValues1 - forKeys:kKeys1 - count:GPBARRAYSIZE(kValues1)]; + [[GPBUInt32ObjectDictionary alloc] initWithObjects:kObjects1 + forKeys:kKeys1 + count:GPBARRAYSIZE(kObjects1)]; XCTAssertNotNil(dict1); GPBUInt32ObjectDictionary *dict1prime = - [[GPBUInt32ObjectDictionary alloc] initWithValues:kValues1 - forKeys:kKeys1 - count:GPBARRAYSIZE(kValues1)]; + [[GPBUInt32ObjectDictionary alloc] initWithObjects:kObjects1 + forKeys:kKeys1 + count:GPBARRAYSIZE(kObjects1)]; XCTAssertNotNil(dict1prime); GPBUInt32ObjectDictionary *dict2 = - [[GPBUInt32ObjectDictionary alloc] initWithValues:kValues2 - forKeys:kKeys1 - count:GPBARRAYSIZE(kValues2)]; + [[GPBUInt32ObjectDictionary alloc] initWithObjects:kObjects2 + forKeys:kKeys1 + count:GPBARRAYSIZE(kObjects2)]; XCTAssertNotNil(dict2); GPBUInt32ObjectDictionary *dict3 = - [[GPBUInt32ObjectDictionary alloc] initWithValues:kValues1 - forKeys:kKeys2 - count:GPBARRAYSIZE(kValues1)]; + [[GPBUInt32ObjectDictionary alloc] initWithObjects:kObjects1 + forKeys:kKeys2 + count:GPBARRAYSIZE(kObjects1)]; XCTAssertNotNil(dict3); GPBUInt32ObjectDictionary *dict4 = - [[GPBUInt32ObjectDictionary alloc] initWithValues:kValues3 - forKeys:kKeys1 - count:GPBARRAYSIZE(kValues3)]; + [[GPBUInt32ObjectDictionary alloc] initWithObjects:kObjects3 + forKeys:kKeys1 + count:GPBARRAYSIZE(kObjects3)]; XCTAssertNotNil(dict4); // 1/1Prime should be different objects, but equal. @@ -3473,10 +3473,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different objects; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same objects; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -3491,11 +3491,11 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { - (void)testCopy { const uint32_t kKeys[] = { 1U, 2U, 3U, 4U }; - const id kValues[] = { @"abc", @"def", @"ghi", @"jkl" }; + const id kObjects[] = { @"abc", @"def", @"ghi", @"jkl" }; GPBUInt32ObjectDictionary *dict = - [[GPBUInt32ObjectDictionary alloc] initWithValues:kValues - forKeys:kKeys - count:GPBARRAYSIZE(kValues)]; + [[GPBUInt32ObjectDictionary alloc] initWithObjects:kObjects + forKeys:kKeys + count:GPBARRAYSIZE(kObjects)]; XCTAssertNotNil(dict); GPBUInt32ObjectDictionary *dict2 = [dict copy]; @@ -3512,11 +3512,11 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { - (void)testDictionaryFromDictionary { const uint32_t kKeys[] = { 1U, 2U, 3U, 4U }; - const id kValues[] = { @"abc", @"def", @"ghi", @"jkl" }; + const id kObjects[] = { @"abc", @"def", @"ghi", @"jkl" }; GPBUInt32ObjectDictionary *dict = - [[GPBUInt32ObjectDictionary alloc] initWithValues:kValues - forKeys:kKeys - count:GPBARRAYSIZE(kValues)]; + [[GPBUInt32ObjectDictionary alloc] initWithObjects:kObjects + forKeys:kKeys + count:GPBARRAYSIZE(kObjects)]; XCTAssertNotNil(dict); GPBUInt32ObjectDictionary *dict2 = @@ -3534,108 +3534,108 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); - [dict setValue:@"abc" forKey:1U]; + [dict setObject:@"abc" forKey:1U]; XCTAssertEqual(dict.count, 1U); const uint32_t kKeys[] = { 2U, 3U, 4U }; - const id kValues[] = { @"def", @"ghi", @"jkl" }; + const id kObjects[] = { @"def", @"ghi", @"jkl" }; GPBUInt32ObjectDictionary *dict2 = - [[GPBUInt32ObjectDictionary alloc] initWithValues:kValues - forKeys:kKeys - count:GPBARRAYSIZE(kValues)]; + [[GPBUInt32ObjectDictionary alloc] initWithObjects:kObjects + forKeys:kKeys + count:GPBARRAYSIZE(kObjects)]; XCTAssertNotNil(dict2); [dict addEntriesFromDictionary:dict2]; XCTAssertEqual(dict.count, 4U); - XCTAssertEqualObjects([dict valueForKey:1U], @"abc"); - XCTAssertEqualObjects([dict valueForKey:2U], @"def"); - XCTAssertEqualObjects([dict valueForKey:3U], @"ghi"); - XCTAssertEqualObjects([dict valueForKey:4U], @"jkl"); + XCTAssertEqualObjects([dict objectForKey:1U], @"abc"); + XCTAssertEqualObjects([dict objectForKey:2U], @"def"); + XCTAssertEqualObjects([dict objectForKey:3U], @"ghi"); + XCTAssertEqualObjects([dict objectForKey:4U], @"jkl"); [dict2 release]; } - (void)testRemove { const uint32_t kKeys[] = { 1U, 2U, 3U, 4U }; - const id kValues[] = { @"abc", @"def", @"ghi", @"jkl" }; + const id kObjects[] = { @"abc", @"def", @"ghi", @"jkl" }; GPBUInt32ObjectDictionary *dict = - [[GPBUInt32ObjectDictionary alloc] initWithValues:kValues - forKeys:kKeys - count:GPBARRAYSIZE(kValues)]; + [[GPBUInt32ObjectDictionary alloc] initWithObjects:kObjects + forKeys:kKeys + count:GPBARRAYSIZE(kObjects)]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 4U); - [dict removeValueForKey:2U]; + [dict removeObjectForKey:2U]; XCTAssertEqual(dict.count, 3U); - XCTAssertEqualObjects([dict valueForKey:1U], @"abc"); - XCTAssertNil([dict valueForKey:2U]); - XCTAssertEqualObjects([dict valueForKey:3U], @"ghi"); - XCTAssertEqualObjects([dict valueForKey:4U], @"jkl"); + XCTAssertEqualObjects([dict objectForKey:1U], @"abc"); + XCTAssertNil([dict objectForKey:2U]); + XCTAssertEqualObjects([dict objectForKey:3U], @"ghi"); + XCTAssertEqualObjects([dict objectForKey:4U], @"jkl"); // Remove again does nothing. - [dict removeValueForKey:2U]; + [dict removeObjectForKey:2U]; XCTAssertEqual(dict.count, 3U); - XCTAssertEqualObjects([dict valueForKey:1U], @"abc"); - XCTAssertNil([dict valueForKey:2U]); - XCTAssertEqualObjects([dict valueForKey:3U], @"ghi"); - XCTAssertEqualObjects([dict valueForKey:4U], @"jkl"); + XCTAssertEqualObjects([dict objectForKey:1U], @"abc"); + XCTAssertNil([dict objectForKey:2U]); + XCTAssertEqualObjects([dict objectForKey:3U], @"ghi"); + XCTAssertEqualObjects([dict objectForKey:4U], @"jkl"); - [dict removeValueForKey:4U]; + [dict removeObjectForKey:4U]; XCTAssertEqual(dict.count, 2U); - XCTAssertEqualObjects([dict valueForKey:1U], @"abc"); - XCTAssertNil([dict valueForKey:2U]); - XCTAssertEqualObjects([dict valueForKey:3U], @"ghi"); - XCTAssertNil([dict valueForKey:4U]); + XCTAssertEqualObjects([dict objectForKey:1U], @"abc"); + XCTAssertNil([dict objectForKey:2U]); + XCTAssertEqualObjects([dict objectForKey:3U], @"ghi"); + XCTAssertNil([dict objectForKey:4U]); [dict removeAll]; XCTAssertEqual(dict.count, 0U); - XCTAssertNil([dict valueForKey:1U]); - XCTAssertNil([dict valueForKey:2U]); - XCTAssertNil([dict valueForKey:3U]); - XCTAssertNil([dict valueForKey:4U]); + XCTAssertNil([dict objectForKey:1U]); + XCTAssertNil([dict objectForKey:2U]); + XCTAssertNil([dict objectForKey:3U]); + XCTAssertNil([dict objectForKey:4U]); [dict release]; } - (void)testInplaceMutation { const uint32_t kKeys[] = { 1U, 2U, 3U, 4U }; - const id kValues[] = { @"abc", @"def", @"ghi", @"jkl" }; + const id kObjects[] = { @"abc", @"def", @"ghi", @"jkl" }; GPBUInt32ObjectDictionary *dict = - [[GPBUInt32ObjectDictionary alloc] initWithValues:kValues - forKeys:kKeys - count:GPBARRAYSIZE(kValues)]; + [[GPBUInt32ObjectDictionary alloc] initWithObjects:kObjects + forKeys:kKeys + count:GPBARRAYSIZE(kObjects)]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 4U); - XCTAssertEqualObjects([dict valueForKey:1U], @"abc"); - XCTAssertEqualObjects([dict valueForKey:2U], @"def"); - XCTAssertEqualObjects([dict valueForKey:3U], @"ghi"); - XCTAssertEqualObjects([dict valueForKey:4U], @"jkl"); + XCTAssertEqualObjects([dict objectForKey:1U], @"abc"); + XCTAssertEqualObjects([dict objectForKey:2U], @"def"); + XCTAssertEqualObjects([dict objectForKey:3U], @"ghi"); + XCTAssertEqualObjects([dict objectForKey:4U], @"jkl"); - [dict setValue:@"jkl" forKey:1U]; + [dict setObject:@"jkl" forKey:1U]; XCTAssertEqual(dict.count, 4U); - XCTAssertEqualObjects([dict valueForKey:1U], @"jkl"); - XCTAssertEqualObjects([dict valueForKey:2U], @"def"); - XCTAssertEqualObjects([dict valueForKey:3U], @"ghi"); - XCTAssertEqualObjects([dict valueForKey:4U], @"jkl"); + XCTAssertEqualObjects([dict objectForKey:1U], @"jkl"); + XCTAssertEqualObjects([dict objectForKey:2U], @"def"); + XCTAssertEqualObjects([dict objectForKey:3U], @"ghi"); + XCTAssertEqualObjects([dict objectForKey:4U], @"jkl"); - [dict setValue:@"def" forKey:4U]; + [dict setObject:@"def" forKey:4U]; XCTAssertEqual(dict.count, 4U); - XCTAssertEqualObjects([dict valueForKey:1U], @"jkl"); - XCTAssertEqualObjects([dict valueForKey:2U], @"def"); - XCTAssertEqualObjects([dict valueForKey:3U], @"ghi"); - XCTAssertEqualObjects([dict valueForKey:4U], @"def"); + XCTAssertEqualObjects([dict objectForKey:1U], @"jkl"); + XCTAssertEqualObjects([dict objectForKey:2U], @"def"); + XCTAssertEqualObjects([dict objectForKey:3U], @"ghi"); + XCTAssertEqualObjects([dict objectForKey:4U], @"def"); const uint32_t kKeys2[] = { 2U, 3U }; - const id kValues2[] = { @"ghi", @"abc" }; + const id kObjects2[] = { @"ghi", @"abc" }; GPBUInt32ObjectDictionary *dict2 = - [[GPBUInt32ObjectDictionary alloc] initWithValues:kValues2 - forKeys:kKeys2 - count:GPBARRAYSIZE(kValues2)]; + [[GPBUInt32ObjectDictionary alloc] initWithObjects:kObjects2 + forKeys:kKeys2 + count:GPBARRAYSIZE(kObjects2)]; XCTAssertNotNil(dict2); [dict addEntriesFromDictionary:dict2]; XCTAssertEqual(dict.count, 4U); - XCTAssertEqualObjects([dict valueForKey:1U], @"jkl"); - XCTAssertEqualObjects([dict valueForKey:2U], @"ghi"); - XCTAssertEqualObjects([dict valueForKey:3U], @"abc"); - XCTAssertEqualObjects([dict valueForKey:4U], @"def"); + XCTAssertEqualObjects([dict objectForKey:1U], @"jkl"); + XCTAssertEqualObjects([dict objectForKey:2U], @"ghi"); + XCTAssertEqualObjects([dict objectForKey:3U], @"abc"); + XCTAssertEqualObjects([dict objectForKey:4U], @"def"); [dict2 release]; [dict release]; diff --git a/objectivec/Tests/GPBDictionaryTests+UInt64.m b/objectivec/Tests/GPBDictionaryTests+UInt64.m index cebd6df2..b64d3a96 100644 --- a/objectivec/Tests/GPBDictionaryTests+UInt64.m +++ b/objectivec/Tests/GPBDictionaryTests+UInt64.m @@ -211,10 +211,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -568,10 +568,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -925,10 +925,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -1282,10 +1282,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -1639,10 +1639,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -1996,10 +1996,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -2353,10 +2353,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -2710,10 +2710,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -3071,10 +3071,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different values; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same values; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -3366,48 +3366,48 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { GPBUInt64ObjectDictionary *dict = [[GPBUInt64ObjectDictionary alloc] init]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); - XCTAssertNil([dict valueForKey:31ULL]); - [dict enumerateKeysAndValuesUsingBlock:^(uint64_t aKey, id aValue, BOOL *stop) { - #pragma unused(aKey, aValue, stop) + XCTAssertNil([dict objectForKey:31ULL]); + [dict enumerateKeysAndObjectsUsingBlock:^(uint64_t aKey, id aObject, BOOL *stop) { + #pragma unused(aKey, aObject, stop) XCTFail(@"Shouldn't get here!"); }]; [dict release]; } - (void)testOne { - GPBUInt64ObjectDictionary *dict = [GPBUInt64ObjectDictionary dictionaryWithValue:@"abc" forKey:31ULL]; + GPBUInt64ObjectDictionary *dict = [GPBUInt64ObjectDictionary dictionaryWithObject:@"abc" forKey:31ULL]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 1U); - XCTAssertEqualObjects([dict valueForKey:31ULL], @"abc"); - XCTAssertNil([dict valueForKey:32ULL]); - [dict enumerateKeysAndValuesUsingBlock:^(uint64_t aKey, id aValue, BOOL *stop) { + XCTAssertEqualObjects([dict objectForKey:31ULL], @"abc"); + XCTAssertNil([dict objectForKey:32ULL]); + [dict enumerateKeysAndObjectsUsingBlock:^(uint64_t aKey, id aObject, BOOL *stop) { XCTAssertEqual(aKey, 31ULL); - XCTAssertEqualObjects(aValue, @"abc"); + XCTAssertEqualObjects(aObject, @"abc"); XCTAssertNotEqual(stop, NULL); }]; } - (void)testBasics { const uint64_t kKeys[] = { 31ULL, 32ULL, 33ULL }; - const id kValues[] = { @"abc", @"def", @"ghi" }; + const id kObjects[] = { @"abc", @"def", @"ghi" }; GPBUInt64ObjectDictionary *dict = - [[GPBUInt64ObjectDictionary alloc] initWithValues:kValues - forKeys:kKeys - count:GPBARRAYSIZE(kValues)]; + [[GPBUInt64ObjectDictionary alloc] initWithObjects:kObjects + forKeys:kKeys + count:GPBARRAYSIZE(kObjects)]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 3U); - XCTAssertEqualObjects([dict valueForKey:31ULL], @"abc"); - XCTAssertEqualObjects([dict valueForKey:32ULL], @"def"); - XCTAssertEqualObjects([dict valueForKey:33ULL], @"ghi"); - XCTAssertNil([dict valueForKey:34ULL]); + XCTAssertEqualObjects([dict objectForKey:31ULL], @"abc"); + XCTAssertEqualObjects([dict objectForKey:32ULL], @"def"); + XCTAssertEqualObjects([dict objectForKey:33ULL], @"ghi"); + XCTAssertNil([dict objectForKey:34ULL]); __block NSUInteger idx = 0; uint64_t *seenKeys = malloc(3 * sizeof(uint64_t)); - id *seenValues = malloc(3 * sizeof(id)); - [dict enumerateKeysAndValuesUsingBlock:^(uint64_t aKey, id aValue, BOOL *stop) { + id *seenObjects = malloc(3 * sizeof(id)); + [dict enumerateKeysAndObjectsUsingBlock:^(uint64_t aKey, id aObject, BOOL *stop) { XCTAssertLessThan(idx, 3U); seenKeys[idx] = aKey; - seenValues[idx] = aValue; + seenObjects[idx] = aObject; XCTAssertNotEqual(stop, NULL); ++idx; }]; @@ -3416,18 +3416,18 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { for (int j = 0; (j < 3) && !foundKey; ++j) { if (kKeys[i] == seenKeys[j]) { foundKey = YES; - XCTAssertEqualObjects(kValues[i], seenValues[j], @"i = %d, j = %d", i, j); + XCTAssertEqualObjects(kObjects[i], seenObjects[j], @"i = %d, j = %d", i, j); } } XCTAssertTrue(foundKey, @"i = %d", i); } free(seenKeys); - free(seenValues); + free(seenObjects); // Stopping the enumeration. idx = 0; - [dict enumerateKeysAndValuesUsingBlock:^(uint64_t aKey, id aValue, BOOL *stop) { - #pragma unused(aKey, aValue) + [dict enumerateKeysAndObjectsUsingBlock:^(uint64_t aKey, id aObject, BOOL *stop) { + #pragma unused(aKey, aObject) if (idx == 1) *stop = YES; XCTAssertNotEqual(idx, 2U); ++idx; @@ -3438,33 +3438,33 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { - (void)testEquality { const uint64_t kKeys1[] = { 31ULL, 32ULL, 33ULL, 34ULL }; const uint64_t kKeys2[] = { 32ULL, 31ULL, 34ULL }; - const id kValues1[] = { @"abc", @"def", @"ghi" }; - const id kValues2[] = { @"abc", @"jkl", @"ghi" }; - const id kValues3[] = { @"abc", @"def", @"ghi", @"jkl" }; + const id kObjects1[] = { @"abc", @"def", @"ghi" }; + const id kObjects2[] = { @"abc", @"jkl", @"ghi" }; + const id kObjects3[] = { @"abc", @"def", @"ghi", @"jkl" }; GPBUInt64ObjectDictionary *dict1 = - [[GPBUInt64ObjectDictionary alloc] initWithValues:kValues1 - forKeys:kKeys1 - count:GPBARRAYSIZE(kValues1)]; + [[GPBUInt64ObjectDictionary alloc] initWithObjects:kObjects1 + forKeys:kKeys1 + count:GPBARRAYSIZE(kObjects1)]; XCTAssertNotNil(dict1); GPBUInt64ObjectDictionary *dict1prime = - [[GPBUInt64ObjectDictionary alloc] initWithValues:kValues1 - forKeys:kKeys1 - count:GPBARRAYSIZE(kValues1)]; + [[GPBUInt64ObjectDictionary alloc] initWithObjects:kObjects1 + forKeys:kKeys1 + count:GPBARRAYSIZE(kObjects1)]; XCTAssertNotNil(dict1prime); GPBUInt64ObjectDictionary *dict2 = - [[GPBUInt64ObjectDictionary alloc] initWithValues:kValues2 - forKeys:kKeys1 - count:GPBARRAYSIZE(kValues2)]; + [[GPBUInt64ObjectDictionary alloc] initWithObjects:kObjects2 + forKeys:kKeys1 + count:GPBARRAYSIZE(kObjects2)]; XCTAssertNotNil(dict2); GPBUInt64ObjectDictionary *dict3 = - [[GPBUInt64ObjectDictionary alloc] initWithValues:kValues1 - forKeys:kKeys2 - count:GPBARRAYSIZE(kValues1)]; + [[GPBUInt64ObjectDictionary alloc] initWithObjects:kObjects1 + forKeys:kKeys2 + count:GPBARRAYSIZE(kObjects1)]; XCTAssertNotNil(dict3); GPBUInt64ObjectDictionary *dict4 = - [[GPBUInt64ObjectDictionary alloc] initWithValues:kValues3 - forKeys:kKeys1 - count:GPBARRAYSIZE(kValues3)]; + [[GPBUInt64ObjectDictionary alloc] initWithObjects:kObjects3 + forKeys:kKeys1 + count:GPBARRAYSIZE(kObjects3)]; XCTAssertNotNil(dict4); // 1/1Prime should be different objects, but equal. @@ -3473,10 +3473,10 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { // Equal, so they must have same hash. XCTAssertEqual([dict1 hash], [dict1prime hash]); - // 2 is save keys, different values; not equal. + // 2 is same keys, different objects; not equal. XCTAssertNotEqualObjects(dict1, dict2); - // 3 is different keys, samae values; not equal. + // 3 is different keys, same objects; not equal. XCTAssertNotEqualObjects(dict1, dict3); // 4 extra pair; not equal @@ -3491,11 +3491,11 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { - (void)testCopy { const uint64_t kKeys[] = { 31ULL, 32ULL, 33ULL, 34ULL }; - const id kValues[] = { @"abc", @"def", @"ghi", @"jkl" }; + const id kObjects[] = { @"abc", @"def", @"ghi", @"jkl" }; GPBUInt64ObjectDictionary *dict = - [[GPBUInt64ObjectDictionary alloc] initWithValues:kValues - forKeys:kKeys - count:GPBARRAYSIZE(kValues)]; + [[GPBUInt64ObjectDictionary alloc] initWithObjects:kObjects + forKeys:kKeys + count:GPBARRAYSIZE(kObjects)]; XCTAssertNotNil(dict); GPBUInt64ObjectDictionary *dict2 = [dict copy]; @@ -3512,11 +3512,11 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { - (void)testDictionaryFromDictionary { const uint64_t kKeys[] = { 31ULL, 32ULL, 33ULL, 34ULL }; - const id kValues[] = { @"abc", @"def", @"ghi", @"jkl" }; + const id kObjects[] = { @"abc", @"def", @"ghi", @"jkl" }; GPBUInt64ObjectDictionary *dict = - [[GPBUInt64ObjectDictionary alloc] initWithValues:kValues - forKeys:kKeys - count:GPBARRAYSIZE(kValues)]; + [[GPBUInt64ObjectDictionary alloc] initWithObjects:kObjects + forKeys:kKeys + count:GPBARRAYSIZE(kObjects)]; XCTAssertNotNil(dict); GPBUInt64ObjectDictionary *dict2 = @@ -3534,108 +3534,108 @@ static BOOL TestingEnum_IsValidValue(int32_t value) { XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 0U); - [dict setValue:@"abc" forKey:31ULL]; + [dict setObject:@"abc" forKey:31ULL]; XCTAssertEqual(dict.count, 1U); const uint64_t kKeys[] = { 32ULL, 33ULL, 34ULL }; - const id kValues[] = { @"def", @"ghi", @"jkl" }; + const id kObjects[] = { @"def", @"ghi", @"jkl" }; GPBUInt64ObjectDictionary *dict2 = - [[GPBUInt64ObjectDictionary alloc] initWithValues:kValues - forKeys:kKeys - count:GPBARRAYSIZE(kValues)]; + [[GPBUInt64ObjectDictionary alloc] initWithObjects:kObjects + forKeys:kKeys + count:GPBARRAYSIZE(kObjects)]; XCTAssertNotNil(dict2); [dict addEntriesFromDictionary:dict2]; XCTAssertEqual(dict.count, 4U); - XCTAssertEqualObjects([dict valueForKey:31ULL], @"abc"); - XCTAssertEqualObjects([dict valueForKey:32ULL], @"def"); - XCTAssertEqualObjects([dict valueForKey:33ULL], @"ghi"); - XCTAssertEqualObjects([dict valueForKey:34ULL], @"jkl"); + XCTAssertEqualObjects([dict objectForKey:31ULL], @"abc"); + XCTAssertEqualObjects([dict objectForKey:32ULL], @"def"); + XCTAssertEqualObjects([dict objectForKey:33ULL], @"ghi"); + XCTAssertEqualObjects([dict objectForKey:34ULL], @"jkl"); [dict2 release]; } - (void)testRemove { const uint64_t kKeys[] = { 31ULL, 32ULL, 33ULL, 34ULL }; - const id kValues[] = { @"abc", @"def", @"ghi", @"jkl" }; + const id kObjects[] = { @"abc", @"def", @"ghi", @"jkl" }; GPBUInt64ObjectDictionary *dict = - [[GPBUInt64ObjectDictionary alloc] initWithValues:kValues - forKeys:kKeys - count:GPBARRAYSIZE(kValues)]; + [[GPBUInt64ObjectDictionary alloc] initWithObjects:kObjects + forKeys:kKeys + count:GPBARRAYSIZE(kObjects)]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 4U); - [dict removeValueForKey:32ULL]; + [dict removeObjectForKey:32ULL]; XCTAssertEqual(dict.count, 3U); - XCTAssertEqualObjects([dict valueForKey:31ULL], @"abc"); - XCTAssertNil([dict valueForKey:32ULL]); - XCTAssertEqualObjects([dict valueForKey:33ULL], @"ghi"); - XCTAssertEqualObjects([dict valueForKey:34ULL], @"jkl"); + XCTAssertEqualObjects([dict objectForKey:31ULL], @"abc"); + XCTAssertNil([dict objectForKey:32ULL]); + XCTAssertEqualObjects([dict objectForKey:33ULL], @"ghi"); + XCTAssertEqualObjects([dict objectForKey:34ULL], @"jkl"); // Remove again does nothing. - [dict removeValueForKey:32ULL]; + [dict removeObjectForKey:32ULL]; XCTAssertEqual(dict.count, 3U); - XCTAssertEqualObjects([dict valueForKey:31ULL], @"abc"); - XCTAssertNil([dict valueForKey:32ULL]); - XCTAssertEqualObjects([dict valueForKey:33ULL], @"ghi"); - XCTAssertEqualObjects([dict valueForKey:34ULL], @"jkl"); + XCTAssertEqualObjects([dict objectForKey:31ULL], @"abc"); + XCTAssertNil([dict objectForKey:32ULL]); + XCTAssertEqualObjects([dict objectForKey:33ULL], @"ghi"); + XCTAssertEqualObjects([dict objectForKey:34ULL], @"jkl"); - [dict removeValueForKey:34ULL]; + [dict removeObjectForKey:34ULL]; XCTAssertEqual(dict.count, 2U); - XCTAssertEqualObjects([dict valueForKey:31ULL], @"abc"); - XCTAssertNil([dict valueForKey:32ULL]); - XCTAssertEqualObjects([dict valueForKey:33ULL], @"ghi"); - XCTAssertNil([dict valueForKey:34ULL]); + XCTAssertEqualObjects([dict objectForKey:31ULL], @"abc"); + XCTAssertNil([dict objectForKey:32ULL]); + XCTAssertEqualObjects([dict objectForKey:33ULL], @"ghi"); + XCTAssertNil([dict objectForKey:34ULL]); [dict removeAll]; XCTAssertEqual(dict.count, 0U); - XCTAssertNil([dict valueForKey:31ULL]); - XCTAssertNil([dict valueForKey:32ULL]); - XCTAssertNil([dict valueForKey:33ULL]); - XCTAssertNil([dict valueForKey:34ULL]); + XCTAssertNil([dict objectForKey:31ULL]); + XCTAssertNil([dict objectForKey:32ULL]); + XCTAssertNil([dict objectForKey:33ULL]); + XCTAssertNil([dict objectForKey:34ULL]); [dict release]; } - (void)testInplaceMutation { const uint64_t kKeys[] = { 31ULL, 32ULL, 33ULL, 34ULL }; - const id kValues[] = { @"abc", @"def", @"ghi", @"jkl" }; + const id kObjects[] = { @"abc", @"def", @"ghi", @"jkl" }; GPBUInt64ObjectDictionary *dict = - [[GPBUInt64ObjectDictionary alloc] initWithValues:kValues - forKeys:kKeys - count:GPBARRAYSIZE(kValues)]; + [[GPBUInt64ObjectDictionary alloc] initWithObjects:kObjects + forKeys:kKeys + count:GPBARRAYSIZE(kObjects)]; XCTAssertNotNil(dict); XCTAssertEqual(dict.count, 4U); - XCTAssertEqualObjects([dict valueForKey:31ULL], @"abc"); - XCTAssertEqualObjects([dict valueForKey:32ULL], @"def"); - XCTAssertEqualObjects([dict valueForKey:33ULL], @"ghi"); - XCTAssertEqualObjects([dict valueForKey:34ULL], @"jkl"); + XCTAssertEqualObjects([dict objectForKey:31ULL], @"abc"); + XCTAssertEqualObjects([dict objectForKey:32ULL], @"def"); + XCTAssertEqualObjects([dict objectForKey:33ULL], @"ghi"); + XCTAssertEqualObjects([dict objectForKey:34ULL], @"jkl"); - [dict setValue:@"jkl" forKey:31ULL]; + [dict setObject:@"jkl" forKey:31ULL]; XCTAssertEqual(dict.count, 4U); - XCTAssertEqualObjects([dict valueForKey:31ULL], @"jkl"); - XCTAssertEqualObjects([dict valueForKey:32ULL], @"def"); - XCTAssertEqualObjects([dict valueForKey:33ULL], @"ghi"); - XCTAssertEqualObjects([dict valueForKey:34ULL], @"jkl"); + XCTAssertEqualObjects([dict objectForKey:31ULL], @"jkl"); + XCTAssertEqualObjects([dict objectForKey:32ULL], @"def"); + XCTAssertEqualObjects([dict objectForKey:33ULL], @"ghi"); + XCTAssertEqualObjects([dict objectForKey:34ULL], @"jkl"); - [dict setValue:@"def" forKey:34ULL]; + [dict setObject:@"def" forKey:34ULL]; XCTAssertEqual(dict.count, 4U); - XCTAssertEqualObjects([dict valueForKey:31ULL], @"jkl"); - XCTAssertEqualObjects([dict valueForKey:32ULL], @"def"); - XCTAssertEqualObjects([dict valueForKey:33ULL], @"ghi"); - XCTAssertEqualObjects([dict valueForKey:34ULL], @"def"); + XCTAssertEqualObjects([dict objectForKey:31ULL], @"jkl"); + XCTAssertEqualObjects([dict objectForKey:32ULL], @"def"); + XCTAssertEqualObjects([dict objectForKey:33ULL], @"ghi"); + XCTAssertEqualObjects([dict objectForKey:34ULL], @"def"); const uint64_t kKeys2[] = { 32ULL, 33ULL }; - const id kValues2[] = { @"ghi", @"abc" }; + const id kObjects2[] = { @"ghi", @"abc" }; GPBUInt64ObjectDictionary *dict2 = - [[GPBUInt64ObjectDictionary alloc] initWithValues:kValues2 - forKeys:kKeys2 - count:GPBARRAYSIZE(kValues2)]; + [[GPBUInt64ObjectDictionary alloc] initWithObjects:kObjects2 + forKeys:kKeys2 + count:GPBARRAYSIZE(kObjects2)]; XCTAssertNotNil(dict2); [dict addEntriesFromDictionary:dict2]; XCTAssertEqual(dict.count, 4U); - XCTAssertEqualObjects([dict valueForKey:31ULL], @"jkl"); - XCTAssertEqualObjects([dict valueForKey:32ULL], @"ghi"); - XCTAssertEqualObjects([dict valueForKey:33ULL], @"abc"); - XCTAssertEqualObjects([dict valueForKey:34ULL], @"def"); + XCTAssertEqualObjects([dict objectForKey:31ULL], @"jkl"); + XCTAssertEqualObjects([dict objectForKey:32ULL], @"ghi"); + XCTAssertEqualObjects([dict objectForKey:33ULL], @"abc"); + XCTAssertEqualObjects([dict objectForKey:34ULL], @"def"); [dict2 release]; [dict release]; diff --git a/objectivec/Tests/GPBDictionaryTests.pddm b/objectivec/Tests/GPBDictionaryTests.pddm index ee26fac8..ada93c64 100644 --- a/objectivec/Tests/GPBDictionaryTests.pddm +++ b/objectivec/Tests/GPBDictionaryTests.pddm @@ -45,12 +45,12 @@ //%TESTS_FOR_ENUM_VALUE_RAW_ADDITIONS(KEY_NAME, KEY_TYPE, KisP, KSUFFIX, KEY1, KEY2, KEY3, KEY4) //%PDDM-DEFINE TESTS_FOR_POD_VALUE(KEY_NAME, KEY_TYPE, KisP, KSUFFIX, KEY1, KEY2, KEY3, KEY4, VALUE_NAME, VALUE_TYPE, VACCESSOR, VAL1, VAL2, VAL3, VAL4) -//%TESTS_COMMON(KEY_NAME, KEY_TYPE, KisP, KSUFFIX, KEY1, KEY2, KEY3, KEY4, VALUE_NAME, VALUE_TYPE, , POD, VACCESSOR, VAL1, VAL2, VAL3, VAL4) +//%TESTS_COMMON(KEY_NAME, KEY_TYPE, KisP, KSUFFIX, KEY1, KEY2, KEY3, KEY4, VALUE_NAME, VALUE_TYPE, , value, POD, VACCESSOR, VAL1, VAL2, VAL3, VAL4) //%PDDM-DEFINE TESTS_FOR_POD_KEY_OBJECT_VALUE(KEY_NAME, KEY_TYPE, KEY1, KEY2, KEY3, KEY4, VALUE_NAME, VALUE_TYPE, VAL1, VAL2, VAL3, VAL4) -//%TESTS_COMMON(KEY_NAME, KEY_TYPE, , , KEY1, KEY2, KEY3, KEY4, VALUE_NAME, VALUE_TYPE, Objects, OBJECT, , VAL1, VAL2, VAL3, VAL4) +//%TESTS_COMMON(KEY_NAME, KEY_TYPE, , , KEY1, KEY2, KEY3, KEY4, VALUE_NAME, VALUE_TYPE, Objects, object, OBJECT, , VAL1, VAL2, VAL3, VAL4) -//%PDDM-DEFINE TESTS_COMMON(KEY_NAME, KEY_TYPE, KisP, KSUFFIX, KEY1, KEY2, KEY3, KEY4, VALUE_NAME, VALUE_TYPE, VSUFFIX, VHELPER, VACCESSOR, VAL1, VAL2, VAL3, VAL4) +//%PDDM-DEFINE TESTS_COMMON(KEY_NAME, KEY_TYPE, KisP, KSUFFIX, KEY1, KEY2, KEY3, KEY4, VALUE_NAME, VALUE_TYPE, VSUFFIX, VNAME, VHELPER, VACCESSOR, VAL1, VAL2, VAL3, VAL4) //%#pragma mark - KEY_NAME -> VALUE_NAME //% //%@interface GPB##KEY_NAME##VALUE_NAME##DictionaryTests : XCTestCase @@ -63,47 +63,47 @@ //% XCTAssertNotNil(dict); //% XCTAssertEqual(dict.count, 0U); //%VALUE_NOT_FOUND##VHELPER(dict, KEY1) -//% [dict enumerateKeysAndValuesUsingBlock:^(KEY_TYPE KisP##aKey, VALUE_TYPE aValue, BOOL *stop) { -//% #pragma unused(aKey, aValue, stop) +//% [dict enumerateKeysAnd##VNAME$u##sUsingBlock:^(KEY_TYPE KisP##aKey, VALUE_TYPE a##VNAME$u, BOOL *stop) { +//% #pragma unused(aKey, a##VNAME$u, stop) //% XCTFail(@"Shouldn't get here!"); //% }]; //% [dict release]; //%} //% //%- (void)testOne { -//% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict = [GPB##KEY_NAME##VALUE_NAME##Dictionary dictionaryWithValue:VAL1 forKey:KEY1]; +//% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict = [GPB##KEY_NAME##VALUE_NAME##Dictionary dictionaryWith##VNAME$u##:VAL1 forKey:KEY1]; //% XCTAssertNotNil(dict); //% XCTAssertEqual(dict.count, 1U); -//%DECLARE_VALUE_STORAGE##VHELPER(VALUE_TYPE, value)TEST_VALUE##VHELPER(dict, value, KEY1, VAL1) +//%DECLARE_VALUE_STORAGE##VHELPER(VALUE_TYPE, VNAME)TEST_VALUE##VHELPER(dict, VNAME, KEY1, VAL1) //%VALUE_NOT_FOUND##VHELPER(dict, KEY2) -//% [dict enumerateKeysAndValuesUsingBlock:^(KEY_TYPE KisP##aKey, VALUE_TYPE aValue, BOOL *stop) { +//% [dict enumerateKeysAnd##VNAME$u##sUsingBlock:^(KEY_TYPE KisP##aKey, VALUE_TYPE a##VNAME$u, BOOL *stop) { //% XCTAssertEqual##KSUFFIX(aKey, KEY1); -//% XCTAssertEqual##VSUFFIX(aValue, VAL1); +//% XCTAssertEqual##VSUFFIX(a##VNAME$u, VAL1); //% XCTAssertNotEqual(stop, NULL); //% }]; //%} //% //%- (void)testBasics { //% const KEY_TYPE KisP##kKeys[] = { KEY1, KEY2, KEY3 }; -//% const VALUE_TYPE kValues[] = { VAL1, VAL2, VAL3 }; +//% const VALUE_TYPE k##VNAME$u##s[] = { VAL1, VAL2, VAL3 }; //% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict = -//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues -//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys -//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues)]; +//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s)]; //% XCTAssertNotNil(dict); //% XCTAssertEqual(dict.count, 3U); -//%DECLARE_VALUE_STORAGE##VHELPER(VALUE_TYPE, value)TEST_VALUE##VHELPER(dict, value, KEY1, VAL1) -//%TEST_VALUE##VHELPER(dict, value, KEY2, VAL2) -//%TEST_VALUE##VHELPER(dict, value, KEY3, VAL3) +//%DECLARE_VALUE_STORAGE##VHELPER(VALUE_TYPE, VNAME)TEST_VALUE##VHELPER(dict, VNAME, KEY1, VAL1) +//%TEST_VALUE##VHELPER(dict, VNAME, KEY2, VAL2) +//%TEST_VALUE##VHELPER(dict, VNAME, KEY3, VAL3) //%VALUE_NOT_FOUND##VHELPER(dict, KEY4) //% //% __block NSUInteger idx = 0; //% KEY_TYPE KisP##*seenKeys = malloc(3 * sizeof(KEY_TYPE##KisP)); -//% VALUE_TYPE *seenValues = malloc(3 * sizeof(VALUE_TYPE)); -//% [dict enumerateKeysAndValuesUsingBlock:^(KEY_TYPE KisP##aKey, VALUE_TYPE aValue, BOOL *stop) { +//% VALUE_TYPE *seen##VNAME$u##s = malloc(3 * sizeof(VALUE_TYPE)); +//% [dict enumerateKeysAnd##VNAME$u##sUsingBlock:^(KEY_TYPE KisP##aKey, VALUE_TYPE a##VNAME$u, BOOL *stop) { //% XCTAssertLessThan(idx, 3U); //% seenKeys[idx] = aKey; -//% seenValues[idx] = aValue; +//% seen##VNAME$u##s[idx] = a##VNAME$u##; //% XCTAssertNotEqual(stop, NULL); //% ++idx; //% }]; @@ -112,18 +112,18 @@ //% for (int j = 0; (j < 3) && !foundKey; ++j) { //% if (COMPARE_KEYS##KSUFFIX(kKeys[i], seenKeys[j])) { //% foundKey = YES; -//% XCTAssertEqual##VSUFFIX(kValues[i], seenValues[j], @"i = %d, j = %d", i, j); +//% XCTAssertEqual##VSUFFIX(k##VNAME$u##s[i], seen##VNAME$u##s[j], @"i = %d, j = %d", i, j); //% } //% } //% XCTAssertTrue(foundKey, @"i = %d", i); //% } //% free(seenKeys); -//% free(seenValues); +//% free(seen##VNAME$u##s); //% //% // Stopping the enumeration. //% idx = 0; -//% [dict enumerateKeysAndValuesUsingBlock:^(KEY_TYPE KisP##aKey, VALUE_TYPE aValue, BOOL *stop) { -//% #pragma unused(aKey, aValue) +//% [dict enumerateKeysAnd##VNAME$u##sUsingBlock:^(KEY_TYPE KisP##aKey, VALUE_TYPE a##VNAME$u, BOOL *stop) { +//% #pragma unused(aKey, a##VNAME$u) //% if (idx == 1) *stop = YES; //% XCTAssertNotEqual(idx, 2U); //% ++idx; @@ -134,33 +134,33 @@ //%- (void)testEquality { //% const KEY_TYPE KisP##kKeys1[] = { KEY1, KEY2, KEY3, KEY4 }; //% const KEY_TYPE KisP##kKeys2[] = { KEY2, KEY1, KEY4 }; -//% const VALUE_TYPE kValues1[] = { VAL1, VAL2, VAL3 }; -//% const VALUE_TYPE kValues2[] = { VAL1, VAL4, VAL3 }; -//% const VALUE_TYPE kValues3[] = { VAL1, VAL2, VAL3, VAL4 }; +//% const VALUE_TYPE k##VNAME$u##s1[] = { VAL1, VAL2, VAL3 }; +//% const VALUE_TYPE k##VNAME$u##s2[] = { VAL1, VAL4, VAL3 }; +//% const VALUE_TYPE k##VNAME$u##s3[] = { VAL1, VAL2, VAL3, VAL4 }; //% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict1 = -//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues1 -//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys1 -//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues1)]; +//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s1 +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys1 +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s1)]; //% XCTAssertNotNil(dict1); //% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict1prime = -//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues1 -//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys1 -//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues1)]; +//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s1 +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys1 +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s1)]; //% XCTAssertNotNil(dict1prime); //% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict2 = -//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues2 -//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys1 -//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues2)]; +//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s2 +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys1 +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s2)]; //% XCTAssertNotNil(dict2); //% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict3 = -//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues1 -//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys2 -//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues1)]; +//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s1 +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys2 +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s1)]; //% XCTAssertNotNil(dict3); //% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict4 = -//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues3 -//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys1 -//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues3)]; +//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s3 +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys1 +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s3)]; //% XCTAssertNotNil(dict4); //% //% // 1/1Prime should be different objects, but equal. @@ -169,10 +169,10 @@ //% // Equal, so they must have same hash. //% XCTAssertEqual([dict1 hash], [dict1prime hash]); //% -//% // 2 is save keys, different values; not equal. +//% // 2 is same keys, different ##VNAME##s; not equal. //% XCTAssertNotEqualObjects(dict1, dict2); //% -//% // 3 is different keys, samae values; not equal. +//% // 3 is different keys, same ##VNAME##s; not equal. //% XCTAssertNotEqualObjects(dict1, dict3); //% //% // 4 extra pair; not equal @@ -187,11 +187,11 @@ //% //%- (void)testCopy { //% const KEY_TYPE KisP##kKeys[] = { KEY1, KEY2, KEY3, KEY4 }; -//% const VALUE_TYPE kValues[] = { VAL1, VAL2, VAL3, VAL4 }; +//% const VALUE_TYPE k##VNAME$u##s[] = { VAL1, VAL2, VAL3, VAL4 }; //% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict = -//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues -//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys -//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues)]; +//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s)]; //% XCTAssertNotNil(dict); //% //% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict2 = [dict copy]; @@ -208,11 +208,11 @@ //% //%- (void)testDictionaryFromDictionary { //% const KEY_TYPE KisP##kKeys[] = { KEY1, KEY2, KEY3, KEY4 }; -//% const VALUE_TYPE kValues[] = { VAL1, VAL2, VAL3, VAL4 }; +//% const VALUE_TYPE k##VNAME$u##s[] = { VAL1, VAL2, VAL3, VAL4 }; //% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict = -//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues -//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys -//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues)]; +//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s)]; //% XCTAssertNotNil(dict); //% //% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict2 = @@ -230,56 +230,56 @@ //% XCTAssertNotNil(dict); //% //% XCTAssertEqual(dict.count, 0U); -//% [dict setValue:VAL1 forKey:KEY1]; +//% [dict set##VNAME$u##:VAL1 forKey:KEY1]; //% XCTAssertEqual(dict.count, 1U); //% //% const KEY_TYPE KisP##kKeys[] = { KEY2, KEY3, KEY4 }; -//% const VALUE_TYPE kValues[] = { VAL2, VAL3, VAL4 }; +//% const VALUE_TYPE k##VNAME$u##s[] = { VAL2, VAL3, VAL4 }; //% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict2 = -//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues -//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys -//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues)]; +//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s)]; //% XCTAssertNotNil(dict2); //% [dict add##VACCESSOR##EntriesFromDictionary:dict2]; //% XCTAssertEqual(dict.count, 4U); //% -//%DECLARE_VALUE_STORAGE##VHELPER(VALUE_TYPE, value)TEST_VALUE##VHELPER(dict, value, KEY1, VAL1) -//%TEST_VALUE##VHELPER(dict, value, KEY2, VAL2) -//%TEST_VALUE##VHELPER(dict, value, KEY3, VAL3) -//%TEST_VALUE##VHELPER(dict, value, KEY4, VAL4) +//%DECLARE_VALUE_STORAGE##VHELPER(VALUE_TYPE, VNAME)TEST_VALUE##VHELPER(dict, VNAME, KEY1, VAL1) +//%TEST_VALUE##VHELPER(dict, VNAME, KEY2, VAL2) +//%TEST_VALUE##VHELPER(dict, VNAME, KEY3, VAL3) +//%TEST_VALUE##VHELPER(dict, VNAME, KEY4, VAL4) //% [dict2 release]; //%} //% //%- (void)testRemove { //% const KEY_TYPE KisP##kKeys[] = { KEY1, KEY2, KEY3, KEY4 }; -//% const VALUE_TYPE kValues[] = { VAL1, VAL2, VAL3, VAL4 }; +//% const VALUE_TYPE k##VNAME$u##s[] = { VAL1, VAL2, VAL3, VAL4 }; //% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict = -//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues -//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys -//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues)]; +//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s)]; //% XCTAssertNotNil(dict); //% XCTAssertEqual(dict.count, 4U); //% -//% [dict removeValueForKey:KEY2]; +//% [dict remove##VNAME$u##ForKey:KEY2]; //% XCTAssertEqual(dict.count, 3U); -//%DECLARE_VALUE_STORAGE##VHELPER(VALUE_TYPE, value)TEST_VALUE##VHELPER(dict, value, KEY1, VAL1) +//%DECLARE_VALUE_STORAGE##VHELPER(VALUE_TYPE, VNAME)TEST_VALUE##VHELPER(dict, VNAME, KEY1, VAL1) //%VALUE_NOT_FOUND##VHELPER(dict, KEY2) -//%TEST_VALUE##VHELPER(dict, value, KEY3, VAL3) -//%TEST_VALUE##VHELPER(dict, value, KEY4, VAL4) +//%TEST_VALUE##VHELPER(dict, VNAME, KEY3, VAL3) +//%TEST_VALUE##VHELPER(dict, VNAME, KEY4, VAL4) //% //% // Remove again does nothing. -//% [dict removeValueForKey:KEY2]; +//% [dict remove##VNAME$u##ForKey:KEY2]; //% XCTAssertEqual(dict.count, 3U); -//%TEST_VALUE##VHELPER(dict, value, KEY1, VAL1) +//%TEST_VALUE##VHELPER(dict, VNAME, KEY1, VAL1) //%VALUE_NOT_FOUND##VHELPER(dict, KEY2) -//%TEST_VALUE##VHELPER(dict, value, KEY3, VAL3) -//%TEST_VALUE##VHELPER(dict, value, KEY4, VAL4) +//%TEST_VALUE##VHELPER(dict, VNAME, KEY3, VAL3) +//%TEST_VALUE##VHELPER(dict, VNAME, KEY4, VAL4) //% -//% [dict removeValueForKey:KEY4]; +//% [dict remove##VNAME$u##ForKey:KEY4]; //% XCTAssertEqual(dict.count, 2U); -//%TEST_VALUE##VHELPER(dict, value, KEY1, VAL1) +//%TEST_VALUE##VHELPER(dict, VNAME, KEY1, VAL1) //%VALUE_NOT_FOUND##VHELPER(dict, KEY2) -//%TEST_VALUE##VHELPER(dict, value, KEY3, VAL3) +//%TEST_VALUE##VHELPER(dict, VNAME, KEY3, VAL3) //%VALUE_NOT_FOUND##VHELPER(dict, KEY4) //% //% [dict removeAll]; @@ -293,45 +293,45 @@ //% //%- (void)testInplaceMutation { //% const KEY_TYPE KisP##kKeys[] = { KEY1, KEY2, KEY3, KEY4 }; -//% const VALUE_TYPE kValues[] = { VAL1, VAL2, VAL3, VAL4 }; +//% const VALUE_TYPE k##VNAME$u##s[] = { VAL1, VAL2, VAL3, VAL4 }; //% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict = -//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues -//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys -//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues)]; +//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s)]; //% XCTAssertNotNil(dict); //% XCTAssertEqual(dict.count, 4U); -//%DECLARE_VALUE_STORAGE##VHELPER(VALUE_TYPE, value)TEST_VALUE##VHELPER(dict, value, KEY1, VAL1) -//%TEST_VALUE##VHELPER(dict, value, KEY2, VAL2) -//%TEST_VALUE##VHELPER(dict, value, KEY3, VAL3) -//%TEST_VALUE##VHELPER(dict, value, KEY4, VAL4) +//%DECLARE_VALUE_STORAGE##VHELPER(VALUE_TYPE, VNAME)TEST_VALUE##VHELPER(dict, VNAME, KEY1, VAL1) +//%TEST_VALUE##VHELPER(dict, VNAME, KEY2, VAL2) +//%TEST_VALUE##VHELPER(dict, VNAME, KEY3, VAL3) +//%TEST_VALUE##VHELPER(dict, VNAME, KEY4, VAL4) //% -//% [dict setValue:VAL4 forKey:KEY1]; +//% [dict set##VNAME$u##:VAL4 forKey:KEY1]; //% XCTAssertEqual(dict.count, 4U); -//%TEST_VALUE##VHELPER(dict, value, KEY1, VAL4) -//%TEST_VALUE##VHELPER(dict, value, KEY2, VAL2) -//%TEST_VALUE##VHELPER(dict, value, KEY3, VAL3) -//%TEST_VALUE##VHELPER(dict, value, KEY4, VAL4) +//%TEST_VALUE##VHELPER(dict, VNAME, KEY1, VAL4) +//%TEST_VALUE##VHELPER(dict, VNAME, KEY2, VAL2) +//%TEST_VALUE##VHELPER(dict, VNAME, KEY3, VAL3) +//%TEST_VALUE##VHELPER(dict, VNAME, KEY4, VAL4) //% -//% [dict setValue:VAL2 forKey:KEY4]; +//% [dict set##VNAME$u##:VAL2 forKey:KEY4]; //% XCTAssertEqual(dict.count, 4U); -//%TEST_VALUE##VHELPER(dict, value, KEY1, VAL4) -//%TEST_VALUE##VHELPER(dict, value, KEY2, VAL2) -//%TEST_VALUE##VHELPER(dict, value, KEY3, VAL3) -//%TEST_VALUE##VHELPER(dict, value, KEY4, VAL2) +//%TEST_VALUE##VHELPER(dict, VNAME, KEY1, VAL4) +//%TEST_VALUE##VHELPER(dict, VNAME, KEY2, VAL2) +//%TEST_VALUE##VHELPER(dict, VNAME, KEY3, VAL3) +//%TEST_VALUE##VHELPER(dict, VNAME, KEY4, VAL2) //% //% const KEY_TYPE KisP##kKeys2[] = { KEY2, KEY3 }; -//% const VALUE_TYPE kValues2[] = { VAL3, VAL1 }; +//% const VALUE_TYPE k##VNAME$u##s2[] = { VAL3, VAL1 }; //% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict2 = -//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues2 -//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys2 -//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues2)]; +//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s2 +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys2 +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s2)]; //% XCTAssertNotNil(dict2); //% [dict add##VACCESSOR##EntriesFromDictionary:dict2]; //% XCTAssertEqual(dict.count, 4U); -//%TEST_VALUE##VHELPER(dict, value, KEY1, VAL4) -//%TEST_VALUE##VHELPER(dict, value, KEY2, VAL3) -//%TEST_VALUE##VHELPER(dict, value, KEY3, VAL1) -//%TEST_VALUE##VHELPER(dict, value, KEY4, VAL2) +//%TEST_VALUE##VHELPER(dict, VNAME, KEY1, VAL4) +//%TEST_VALUE##VHELPER(dict, VNAME, KEY2, VAL3) +//%TEST_VALUE##VHELPER(dict, VNAME, KEY3, VAL1) +//%TEST_VALUE##VHELPER(dict, VNAME, KEY4, VAL2) //% //% [dict2 release]; //% [dict release]; @@ -466,10 +466,10 @@ //% // Equal, so they must have same hash. //% XCTAssertEqual([dict1 hash], [dict1prime hash]); //% -//% // 2 is save keys, different values; not equal. +//% // 2 is same keys, different values; not equal. //% XCTAssertNotEqualObjects(dict1, dict2); //% -//% // 3 is different keys, samae values; not equal. +//% // 3 is different keys, same values; not equal. //% XCTAssertNotEqualObjects(dict1, dict3); //% //% // 4 extra pair; not equal @@ -709,9 +709,9 @@ //%PDDM-DEFINE DECLARE_VALUE_STORAGEOBJECT(VALUE_TYPE, NAME) // Empty //%PDDM-DEFINE VALUE_NOT_FOUNDOBJECT(DICT, KEY) -//% XCTAssertNil([DICT valueForKey:KEY]); +//% XCTAssertNil([DICT objectForKey:KEY]); //%PDDM-DEFINE TEST_VALUEOBJECT(DICT, STORAGE, KEY, VALUE) -//% XCTAssertEqualObjects([DICT valueForKey:KEY], VALUE); +//% XCTAssertEqualObjects([DICT objectForKey:KEY], VALUE); //%PDDM-DEFINE COMPARE_KEYSObjects(KEY1, KEY2) //%[KEY1 isEqual:KEY2] @@ -768,12 +768,12 @@ //TODO(thomasvl): enum tests //%PDDM-DEFINE BOOL_TESTS_FOR_POD_VALUE(VALUE_NAME, VALUE_TYPE, VAL1, VAL2) -//%BOOL_TESTS_COMMON(Bool, BOOL, , , YES, NO, VALUE_NAME, VALUE_TYPE, , POD, VAL1, VAL2) +//%BOOL_TESTS_COMMON(Bool, BOOL, , , YES, NO, VALUE_NAME, VALUE_TYPE, , value, POD, VAL1, VAL2) //%PDDM-DEFINE TESTS_FOR_BOOL_KEY_OBJECT_VALUE(VALUE_NAME, VALUE_TYPE, VAL1, VAL2) -//%BOOL_TESTS_COMMON(Bool, BOOL, , , YES, NO, VALUE_NAME, VALUE_TYPE, Objects, OBJECT, VAL1, VAL2) +//%BOOL_TESTS_COMMON(Bool, BOOL, , , YES, NO, VALUE_NAME, VALUE_TYPE, Objects, object, OBJECT, VAL1, VAL2) -//%PDDM-DEFINE BOOL_TESTS_COMMON(KEY_NAME, KEY_TYPE, KisP, KSUFFIX, KEY1, KEY2, VALUE_NAME, VALUE_TYPE, VSUFFIX, VHELPER, VAL1, VAL2) +//%PDDM-DEFINE BOOL_TESTS_COMMON(KEY_NAME, KEY_TYPE, KisP, KSUFFIX, KEY1, KEY2, VALUE_NAME, VALUE_TYPE, VSUFFIX, VNAME, VHELPER, VAL1, VAL2) //%#pragma mark - KEY_NAME -> VALUE_NAME //% //%@interface GPB##KEY_NAME##VALUE_NAME##DictionaryTests : XCTestCase @@ -786,45 +786,45 @@ //% XCTAssertNotNil(dict); //% XCTAssertEqual(dict.count, 0U); //%VALUE_NOT_FOUND##VHELPER(dict, KEY1) -//% [dict enumerateKeysAndValuesUsingBlock:^(KEY_TYPE KisP##aKey, VALUE_TYPE aValue, BOOL *stop) { -//% #pragma unused(aKey, aValue, stop) +//% [dict enumerateKeysAnd##VNAME$u##sUsingBlock:^(KEY_TYPE KisP##aKey, VALUE_TYPE a##VNAME$u##, BOOL *stop) { +//% #pragma unused(aKey, a##VNAME$u##, stop) //% XCTFail(@"Shouldn't get here!"); //% }]; //% [dict release]; //%} //% //%- (void)testOne { -//% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict = [GPB##KEY_NAME##VALUE_NAME##Dictionary dictionaryWithValue:VAL1 forKey:KEY1]; +//% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict = [GPB##KEY_NAME##VALUE_NAME##Dictionary dictionaryWith##VNAME$u##:VAL1 forKey:KEY1]; //% XCTAssertNotNil(dict); //% XCTAssertEqual(dict.count, 1U); -//%DECLARE_VALUE_STORAGE##VHELPER(VALUE_TYPE, value)TEST_VALUE##VHELPER(dict, value, KEY1, VAL1) +//%DECLARE_VALUE_STORAGE##VHELPER(VALUE_TYPE, VNAME)TEST_VALUE##VHELPER(dict, VNAME, KEY1, VAL1) //%VALUE_NOT_FOUND##VHELPER(dict, KEY2) -//% [dict enumerateKeysAndValuesUsingBlock:^(KEY_TYPE KisP##aKey, VALUE_TYPE aValue, BOOL *stop) { +//% [dict enumerateKeysAnd##VNAME$u##sUsingBlock:^(KEY_TYPE KisP##aKey, VALUE_TYPE a##VNAME$u, BOOL *stop) { //% XCTAssertEqual##KSUFFIX(aKey, KEY1); -//% XCTAssertEqual##VSUFFIX(aValue, VAL1); +//% XCTAssertEqual##VSUFFIX(a##VNAME$u, VAL1); //% XCTAssertNotEqual(stop, NULL); //% }]; //%} //% //%- (void)testBasics { //% const KEY_TYPE KisP##kKeys[] = { KEY1, KEY2 }; -//% const VALUE_TYPE kValues[] = { VAL1, VAL2 }; +//% const VALUE_TYPE k##VNAME$u##s[] = { VAL1, VAL2 }; //% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict = -//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues -//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys -//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues)]; +//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s)]; //% XCTAssertNotNil(dict); //% XCTAssertEqual(dict.count, 2U); -//%DECLARE_VALUE_STORAGE##VHELPER(VALUE_TYPE, value)TEST_VALUE##VHELPER(dict, value, KEY1, VAL1) -//%TEST_VALUE##VHELPER(dict, value, KEY2, VAL2) +//%DECLARE_VALUE_STORAGE##VHELPER(VALUE_TYPE, VNAME)TEST_VALUE##VHELPER(dict, VNAME, KEY1, VAL1) +//%TEST_VALUE##VHELPER(dict, VNAME, KEY2, VAL2) //% //% __block NSUInteger idx = 0; //% KEY_TYPE KisP##*seenKeys = malloc(2 * sizeof(KEY_TYPE##KisP)); -//% VALUE_TYPE *seenValues = malloc(2 * sizeof(VALUE_TYPE)); -//% [dict enumerateKeysAndValuesUsingBlock:^(KEY_TYPE KisP##aKey, VALUE_TYPE aValue, BOOL *stop) { +//% VALUE_TYPE *seen##VNAME$u##s = malloc(2 * sizeof(VALUE_TYPE)); +//% [dict enumerateKeysAnd##VNAME$u##sUsingBlock:^(KEY_TYPE KisP##aKey, VALUE_TYPE a##VNAME$u##, BOOL *stop) { //% XCTAssertLessThan(idx, 2U); //% seenKeys[idx] = aKey; -//% seenValues[idx] = aValue; +//% seen##VNAME$u##s[idx] = a##VNAME$u; //% XCTAssertNotEqual(stop, NULL); //% ++idx; //% }]; @@ -833,18 +833,18 @@ //% for (int j = 0; (j < 2) && !foundKey; ++j) { //% if (COMPARE_KEYS##KSUFFIX(kKeys[i], seenKeys[j])) { //% foundKey = YES; -//% XCTAssertEqual##VSUFFIX(kValues[i], seenValues[j], @"i = %d, j = %d", i, j); +//% XCTAssertEqual##VSUFFIX(k##VNAME$u##s[i], seen##VNAME$u##s[j], @"i = %d, j = %d", i, j); //% } //% } //% XCTAssertTrue(foundKey, @"i = %d", i); //% } //% free(seenKeys); -//% free(seenValues); +//% free(seen##VNAME$u##s); //% //% // Stopping the enumeration. //% idx = 0; -//% [dict enumerateKeysAndValuesUsingBlock:^(KEY_TYPE KisP##aKey, VALUE_TYPE aValue, BOOL *stop) { -//% #pragma unused(aKey, aValue) +//% [dict enumerateKeysAnd##VNAME$u##sUsingBlock:^(KEY_TYPE KisP##aKey, VALUE_TYPE a##VNAME$u##, BOOL *stop) { +//% #pragma unused(aKey, a##VNAME$u) //% if (idx == 0) *stop = YES; //% XCTAssertNotEqual(idx, 2U); //% ++idx; @@ -855,33 +855,33 @@ //%- (void)testEquality { //% const KEY_TYPE KisP##kKeys1[] = { KEY1, KEY2 }; //% const KEY_TYPE KisP##kKeys2[] = { KEY2, KEY1 }; -//% const VALUE_TYPE kValues1[] = { VAL1, VAL2 }; -//% const VALUE_TYPE kValues2[] = { VAL2, VAL1 }; -//% const VALUE_TYPE kValues3[] = { VAL2 }; +//% const VALUE_TYPE k##VNAME$u##s1[] = { VAL1, VAL2 }; +//% const VALUE_TYPE k##VNAME$u##s2[] = { VAL2, VAL1 }; +//% const VALUE_TYPE k##VNAME$u##s3[] = { VAL2 }; //% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict1 = -//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues1 -//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys1 -//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues1)]; +//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s1 +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys1 +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s1)]; //% XCTAssertNotNil(dict1); //% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict1prime = -//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues1 -//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys1 -//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues1)]; +//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s1 +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys1 +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s1)]; //% XCTAssertNotNil(dict1prime); //% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict2 = -//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues2 -//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys1 -//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues2)]; +//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s2 +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys1 +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s2)]; //% XCTAssertNotNil(dict2); //% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict3 = -//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues1 -//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys2 -//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues1)]; +//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s1 +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys2 +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s1)]; //% XCTAssertNotNil(dict3); //% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict4 = -//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues3 -//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys1 -//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues3)]; +//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s3 +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys1 +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s3)]; //% XCTAssertNotNil(dict4); //% //% // 1/1Prime should be different objects, but equal. @@ -890,10 +890,10 @@ //% // Equal, so they must have same hash. //% XCTAssertEqual([dict1 hash], [dict1prime hash]); //% -//% // 2 is save keys, different values; not equal. +//% // 2 is same keys, different ##VNAME##s; not equal. //% XCTAssertNotEqualObjects(dict1, dict2); //% -//% // 3 is different keys, samae values; not equal. +//% // 3 is different keys, same ##VNAME##s; not equal. //% XCTAssertNotEqualObjects(dict1, dict3); //% //% // 4 Fewer pairs; not equal @@ -908,11 +908,11 @@ //% //%- (void)testCopy { //% const KEY_TYPE KisP##kKeys[] = { KEY1, KEY2 }; -//% const VALUE_TYPE kValues[] = { VAL1, VAL2 }; +//% const VALUE_TYPE k##VNAME$u##s[] = { VAL1, VAL2 }; //% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict = -//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues -//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys -//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues)]; +//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s)]; //% XCTAssertNotNil(dict); //% //% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict2 = [dict copy]; @@ -929,11 +929,11 @@ //% //%- (void)testDictionaryFromDictionary { //% const KEY_TYPE KisP##kKeys[] = { KEY1, KEY2 }; -//% const VALUE_TYPE kValues[] = { VAL1, VAL2 }; +//% const VALUE_TYPE k##VNAME$u##s[] = { VAL1, VAL2 }; //% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict = -//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues -//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys -//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues)]; +//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s)]; //% XCTAssertNotNil(dict); //% //% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict2 = @@ -951,43 +951,43 @@ //% XCTAssertNotNil(dict); //% //% XCTAssertEqual(dict.count, 0U); -//% [dict setValue:VAL1 forKey:KEY1]; +//% [dict set##VNAME$u:VAL1 forKey:KEY1]; //% XCTAssertEqual(dict.count, 1U); //% //% const KEY_TYPE KisP##kKeys[] = { KEY2 }; -//% const VALUE_TYPE kValues[] = { VAL2 }; +//% const VALUE_TYPE k##VNAME$u##s[] = { VAL2 }; //% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict2 = -//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues -//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys -//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues)]; +//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s)]; //% XCTAssertNotNil(dict2); //% [dict addEntriesFromDictionary:dict2]; //% XCTAssertEqual(dict.count, 2U); //% -//%DECLARE_VALUE_STORAGE##VHELPER(VALUE_TYPE, value)TEST_VALUE##VHELPER(dict, value, KEY1, VAL1) -//%TEST_VALUE##VHELPER(dict, value, KEY2, VAL2) +//%DECLARE_VALUE_STORAGE##VHELPER(VALUE_TYPE, VNAME)TEST_VALUE##VHELPER(dict, VNAME, KEY1, VAL1) +//%TEST_VALUE##VHELPER(dict, VNAME, KEY2, VAL2) //% [dict2 release]; //%} //% //%- (void)testRemove { //% const KEY_TYPE KisP##kKeys[] = { KEY1, KEY2}; -//% const VALUE_TYPE kValues[] = { VAL1, VAL2 }; +//% const VALUE_TYPE k##VNAME$u##s[] = { VAL1, VAL2 }; //% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict = -//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues -//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys -//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues)]; +//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s)]; //% XCTAssertNotNil(dict); //% XCTAssertEqual(dict.count, 2U); //% -//% [dict removeValueForKey:KEY2]; +//% [dict remove##VNAME$u##ForKey:KEY2]; //% XCTAssertEqual(dict.count, 1U); -//%DECLARE_VALUE_STORAGE##VHELPER(VALUE_TYPE, value)TEST_VALUE##VHELPER(dict, value, KEY1, VAL1) +//%DECLARE_VALUE_STORAGE##VHELPER(VALUE_TYPE, VNAME)TEST_VALUE##VHELPER(dict, VNAME, KEY1, VAL1) //%VALUE_NOT_FOUND##VHELPER(dict, KEY2) //% //% // Remove again does nothing. -//% [dict removeValueForKey:KEY2]; +//% [dict remove##VNAME$u##ForKey:KEY2]; //% XCTAssertEqual(dict.count, 1U); -//%TEST_VALUE##VHELPER(dict, value, KEY1, VAL1) +//%TEST_VALUE##VHELPER(dict, VNAME, KEY1, VAL1) //%VALUE_NOT_FOUND##VHELPER(dict, KEY2) //% //% [dict removeAll]; @@ -999,37 +999,37 @@ //% //%- (void)testInplaceMutation { //% const KEY_TYPE KisP##kKeys[] = { KEY1, KEY2 }; -//% const VALUE_TYPE kValues[] = { VAL1, VAL2 }; +//% const VALUE_TYPE k##VNAME$u##s[] = { VAL1, VAL2 }; //% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict = -//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues -//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys -//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues)]; +//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s)]; //% XCTAssertNotNil(dict); //% XCTAssertEqual(dict.count, 2U); -//%DECLARE_VALUE_STORAGE##VHELPER(VALUE_TYPE, value)TEST_VALUE##VHELPER(dict, value, KEY1, VAL1) -//%TEST_VALUE##VHELPER(dict, value, KEY2, VAL2) +//%DECLARE_VALUE_STORAGE##VHELPER(VALUE_TYPE, VNAME)TEST_VALUE##VHELPER(dict, VNAME, KEY1, VAL1) +//%TEST_VALUE##VHELPER(dict, VNAME, KEY2, VAL2) //% -//% [dict setValue:VAL2 forKey:KEY1]; +//% [dict set##VNAME$u##:VAL2 forKey:KEY1]; //% XCTAssertEqual(dict.count, 2U); -//%TEST_VALUE##VHELPER(dict, value, KEY1, VAL2) -//%TEST_VALUE##VHELPER(dict, value, KEY2, VAL2) +//%TEST_VALUE##VHELPER(dict, VNAME, KEY1, VAL2) +//%TEST_VALUE##VHELPER(dict, VNAME, KEY2, VAL2) //% -//% [dict setValue:VAL1 forKey:KEY2]; +//% [dict set##VNAME$u##:VAL1 forKey:KEY2]; //% XCTAssertEqual(dict.count, 2U); -//%TEST_VALUE##VHELPER(dict, value, KEY1, VAL2) -//%TEST_VALUE##VHELPER(dict, value, KEY2, VAL1) +//%TEST_VALUE##VHELPER(dict, VNAME, KEY1, VAL2) +//%TEST_VALUE##VHELPER(dict, VNAME, KEY2, VAL1) //% //% const KEY_TYPE KisP##kKeys2[] = { KEY2, KEY1 }; -//% const VALUE_TYPE kValues2[] = { VAL2, VAL1 }; +//% const VALUE_TYPE k##VNAME$u##s2[] = { VAL2, VAL1 }; //% GPB##KEY_NAME##VALUE_NAME##Dictionary *dict2 = -//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWithValues:kValues2 -//% KEY_NAME$S VALUE_NAME$S forKeys:kKeys2 -//% KEY_NAME$S VALUE_NAME$S count:GPBARRAYSIZE(kValues2)]; +//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] initWith##VNAME$u##s:k##VNAME$u##s2 +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:kKeys2 +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:GPBARRAYSIZE(k##VNAME$u##s2)]; //% XCTAssertNotNil(dict2); //% [dict addEntriesFromDictionary:dict2]; //% XCTAssertEqual(dict.count, 2U); -//%TEST_VALUE##VHELPER(dict, value, KEY1, VAL1) -//%TEST_VALUE##VHELPER(dict, value, KEY2, VAL2) +//%TEST_VALUE##VHELPER(dict, VNAME, KEY1, VAL1) +//%TEST_VALUE##VHELPER(dict, VNAME, KEY2, VAL2) //% //% [dict2 release]; //% [dict release]; diff --git a/objectivec/Tests/GPBMessageTests+Merge.m b/objectivec/Tests/GPBMessageTests+Merge.m index 3b6fdbd4..a3908aab 100644 --- a/objectivec/Tests/GPBMessageTests+Merge.m +++ b/objectivec/Tests/GPBMessageTests+Merge.m @@ -676,20 +676,21 @@ TestAllTypes *subMsg = [TestAllTypes message]; subMsg.repeatedInt32Array = [GPBInt32Array arrayWithValue:100]; msg1.mapInt32Message = [GPBInt32ObjectDictionary dictionary]; - [msg1.mapInt32Message setValue:subMsg forKey:0]; + [msg1.mapInt32Message setObject:subMsg forKey:0]; subMsg = nil; subMsg = [TestAllTypes message]; subMsg.repeatedInt32Array = [GPBInt32Array arrayWithValue:101]; msg2.mapInt32Message = [GPBInt32ObjectDictionary dictionary]; - [msg2.mapInt32Message setValue:subMsg forKey:0]; + + [msg2.mapInt32Message setObject:subMsg forKey:0]; subMsg = nil; [msg1 mergeFrom:msg2]; // Checks repeated field is overwritten. XCTAssertEqual(msg1.mapInt32Message.count, 1U); - subMsg = [msg1.mapInt32Message valueForKey:0]; + subMsg = [msg1.mapInt32Message objectForKey:0]; XCTAssertNotNil(subMsg); XCTAssertEqual(subMsg.repeatedInt32Array.count, 1U); XCTAssertEqual([subMsg.repeatedInt32Array valueAtIndex:0], 101); diff --git a/objectivec/Tests/GPBMessageTests+Runtime.m b/objectivec/Tests/GPBMessageTests+Runtime.m index 8942a843..e536bfec 100644 --- a/objectivec/Tests/GPBMessageTests+Runtime.m +++ b/objectivec/Tests/GPBMessageTests+Runtime.m @@ -2059,9 +2059,9 @@ // Ensure the messages are unique per map. [msg1.mapInt32ForeignMessage - enumerateKeysAndValuesUsingBlock:^(int32_t key, id value, BOOL *stop) { + enumerateKeysAndObjectsUsingBlock:^(int32_t key, id value, BOOL *stop) { #pragma unused(stop) - ForeignMessage *subMsg2 = [msg2.mapInt32ForeignMessage valueForKey:key]; + ForeignMessage *subMsg2 = [msg2.mapInt32ForeignMessage objectForKey:key]; XCTAssertNotEqual(value, subMsg2); // Ptr compare, new object. }]; } @@ -2075,7 +2075,7 @@ // Add an uninitialized message. TestRequired *subMsg = [[TestRequired alloc] init]; msg.mapField = [GPBInt32ObjectDictionary dictionary]; - [msg.mapField setValue:subMsg forKey:0]; + [msg.mapField setObject:subMsg forKey:0]; XCTAssertFalse(msg.initialized); // Initialize uninitialized message diff --git a/objectivec/Tests/GPBMessageTests+Serialization.m b/objectivec/Tests/GPBMessageTests+Serialization.m index ae4be9e5..4dcca7a3 100644 --- a/objectivec/Tests/GPBMessageTests+Serialization.m +++ b/objectivec/Tests/GPBMessageTests+Serialization.m @@ -994,16 +994,16 @@ static NSData *DataFromCStr(const char *str) { val2.optionalInt32 = 129; [msg.mapStringMessage setValue:val1 forKey:@"228"]; [msg.mapStringMessage setValue:val2 forKey:@"2029"]; - [msg.mapInt32Bytes setValue:DataFromCStr("1030 bytes") forKey:230]; - [msg.mapInt32Bytes setValue:DataFromCStr("131") forKey:2031]; + [msg.mapInt32Bytes setObject:DataFromCStr("1030 bytes") forKey:230]; + [msg.mapInt32Bytes setObject:DataFromCStr("131") forKey:2031]; [msg.mapInt32Enum setValue:Message2_Enum_Bar forKey:232]; [msg.mapInt32Enum setValue:Message2_Enum_Baz forKey:2033]; Message2 *val3 = [[Message2 alloc] init]; val3.optionalInt32 = 1034; Message2 *val4 = [[Message2 alloc] init]; val4.optionalInt32 = 135; - [msg.mapInt32Message setValue:val3 forKey:234]; - [msg.mapInt32Message setValue:val4 forKey:2035]; + [msg.mapInt32Message setObject:val3 forKey:234]; + [msg.mapInt32Message setObject:val4 forKey:2035]; NSData *data = [msg data]; Message2 *msg2 = [[Message2 alloc] initWithData:data error:NULL]; diff --git a/objectivec/Tests/GPBObjectiveCPlusPlusTest.mm b/objectivec/Tests/GPBObjectiveCPlusPlusTest.mm new file mode 100644 index 00000000..9ba8fd0b --- /dev/null +++ b/objectivec/Tests/GPBObjectiveCPlusPlusTest.mm @@ -0,0 +1,69 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2013 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +#import "GPBTestUtilities.h" + + +// +// This is just a compile test (here to make sure things never regress). +// +// Objective C++ can run into issues with how the NS_ENUM/CF_ENUM declartion +// works because of the C++ spec being used for that compilation unit. So +// the fact that these imports all work without errors/warning means things +// are still good. +// +// The "well know types" should have cross file enums needing imports. +#import "GPBProtocolBuffers.h" +// Some of the tests explicitly use cross file enums also. +#import "google/protobuf/Unittest.pbobjc.h" +#import "google/protobuf/UnittestImport.pbobjc.h" + +// Sanity check the conditions of the test within the Xcode project. +#if !__cplusplus + #error This isn't compiled as Objective C++? +#elif __cplusplus >= 201103L + // If this trips, it means the Xcode default might have change (or someone + // edited the testing project) and it might be time to revisit the GPB_ENUM + // define in GPBBootstrap.h. + #warning Did the Xcode default for C++ spec change? +#endif + + +// Dummy XCTest. +@interface GPBObjectiveCPlusPlusTests : GPBTestCase +@end + +@implementation GPBObjectiveCPlusPlusTests +- (void)testCPlusPlus { + // Nothing, This was a compile test. + XCTAssertTrue(YES); +} +@end diff --git a/objectivec/Tests/GPBTestUtilities.m b/objectivec/Tests/GPBTestUtilities.m index 3d85c744..726761a7 100644 --- a/objectivec/Tests/GPBTestUtilities.m +++ b/objectivec/Tests/GPBTestUtilities.m @@ -1110,7 +1110,7 @@ const uint32_t kGPBDefaultRepeatCount = 2; [dataStr release]; NSData *data = [[NSData alloc] initWithUint32_gpbtu:i + 1]; - [message.mapInt32Bytes setValue:data forKey:113 + i * 100]; + [message.mapInt32Bytes setObject:data forKey:113 + i * 100]; [data release]; [message.mapInt32Enum @@ -1119,7 +1119,7 @@ const uint32_t kGPBDefaultRepeatCount = 2; ForeignMessage *subMsg = [[ForeignMessage alloc] init]; subMsg.c = i + 1; - [message.mapInt32ForeignMessage setValue:subMsg forKey:115 + i * 100]; + [message.mapInt32ForeignMessage setObject:subMsg forKey:115 + i * 100]; [subMsg release]; } } diff --git a/objectivec/Tests/GPBWireFormatTests.m b/objectivec/Tests/GPBWireFormatTests.m index c1244212..3fab20b7 100644 --- a/objectivec/Tests/GPBWireFormatTests.m +++ b/objectivec/Tests/GPBWireFormatTests.m @@ -167,12 +167,12 @@ const int kUnknownTypeId = 1550055; XCTAssertEqual([raw.itemArray[2] typeId], kUnknownTypeId); TestMessageSetExtension1* message1 = - [TestMessageSetExtension1 parseFromData:[raw.itemArray[0] message] + [TestMessageSetExtension1 parseFromData:[((RawMessageSet_Item*)raw.itemArray[0]) message] error:NULL]; XCTAssertEqual(message1.i, 123); TestMessageSetExtension2* message2 = - [TestMessageSetExtension2 parseFromData:[raw.itemArray[1] message] + [TestMessageSetExtension2 parseFromData:[((RawMessageSet_Item*)raw.itemArray[1]) message] error:NULL]; XCTAssertEqualObjects(message2.str, @"foo"); diff --git a/objectivec/google/protobuf/Descriptor.pbobjc.h b/objectivec/google/protobuf/Descriptor.pbobjc.h index 2a86a7e1..70cb7447 100644 --- a/objectivec/google/protobuf/Descriptor.pbobjc.h +++ b/objectivec/google/protobuf/Descriptor.pbobjc.h @@ -344,6 +344,7 @@ typedef GPB_ENUM(GPBFieldDescriptorProto_FieldNumber) { GPBFieldDescriptorProto_FieldNumber_DefaultValue = 7, GPBFieldDescriptorProto_FieldNumber_Options = 8, GPBFieldDescriptorProto_FieldNumber_OneofIndex = 9, + GPBFieldDescriptorProto_FieldNumber_JsonName = 10, }; // Describes a field within a message. @@ -389,6 +390,13 @@ typedef GPB_ENUM(GPBFieldDescriptorProto_FieldNumber) { @property(nonatomic, readwrite) BOOL hasOneofIndex; @property(nonatomic, readwrite) int32_t oneofIndex; +// JSON name of this field. The value is set by protocol compiler. If the +// user has set a "json_name" option on this field, that option's value +// will be used. Otherwise, it's deduced from the field's name by converting +// it to camelCase. +@property(nonatomic, readwrite) BOOL hasJsonName; +@property(nonatomic, readwrite, copy, null_resettable) NSString *jsonName; + @property(nonatomic, readwrite) BOOL hasOptions; @property(nonatomic, readwrite, strong, null_resettable) GPBFieldOptions *options; diff --git a/objectivec/google/protobuf/Descriptor.pbobjc.m b/objectivec/google/protobuf/Descriptor.pbobjc.m index 8d69867b..e3e44c48 100644 --- a/objectivec/google/protobuf/Descriptor.pbobjc.m +++ b/objectivec/google/protobuf/Descriptor.pbobjc.m @@ -578,6 +578,7 @@ typedef struct GPBDescriptorProto_ReservedRange__storage_ { @dynamic hasExtendee, extendee; @dynamic hasDefaultValue, defaultValue; @dynamic hasOneofIndex, oneofIndex; +@dynamic hasJsonName, jsonName; @dynamic hasOptions, options; typedef struct GPBFieldDescriptorProto__storage_ { @@ -591,6 +592,7 @@ typedef struct GPBFieldDescriptorProto__storage_ { NSString *typeName; NSString *defaultValue; GPBFieldOptions *options; + NSString *jsonName; } GPBFieldDescriptorProto__storage_; // This method is threadsafe because it is initially called @@ -679,7 +681,7 @@ typedef struct GPBFieldDescriptorProto__storage_ { { .name = "options", .number = GPBFieldDescriptorProto_FieldNumber_Options, - .hasIndex = 8, + .hasIndex = 9, .flags = GPBFieldOptional, .dataType = GPBDataTypeMessage, .offset = offsetof(GPBFieldDescriptorProto__storage_, options), @@ -698,6 +700,17 @@ typedef struct GPBFieldDescriptorProto__storage_ { .dataTypeSpecific.className = NULL, .fieldOptions = NULL, }, + { + .name = "jsonName", + .number = GPBFieldDescriptorProto_FieldNumber_JsonName, + .hasIndex = 8, + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + .offset = offsetof(GPBFieldDescriptorProto__storage_, jsonName), + .defaultValue.valueString = nil, + .dataTypeSpecific.className = NULL, + .fieldOptions = NULL, + }, }; static GPBMessageEnumDescription enums[] = { { .enumDescriptorFunc = GPBFieldDescriptorProto_Type_EnumDescriptor }, diff --git a/python/google/protobuf/pyext/message.cc b/python/google/protobuf/pyext/message.cc index 63d53136..9318c834 100644 --- a/python/google/protobuf/pyext/message.cc +++ b/python/google/protobuf/pyext/message.cc @@ -2893,6 +2893,14 @@ bool InitProto2MessageModule(PyObject *m) { } Py_INCREF(mutable_mapping); +#if PY_MAJOR_VERSION >= 3 + PyObject* bases = PyTuple_New(1); + PyTuple_SET_ITEM(bases, 0, mutable_mapping.get()); + + ScalarMapContainer_Type = + PyType_FromSpecWithBases(&ScalarMapContainer_Type_spec, bases); + PyModule_AddObject(m, "ScalarMapContainer", ScalarMapContainer_Type); +#else ScalarMapContainer_Type.tp_base = reinterpret_cast<PyTypeObject*>(mutable_mapping.get()); @@ -2902,6 +2910,7 @@ bool InitProto2MessageModule(PyObject *m) { PyModule_AddObject(m, "ScalarMapContainer", reinterpret_cast<PyObject*>(&ScalarMapContainer_Type)); +#endif if (PyType_Ready(&ScalarMapIterator_Type) < 0) { return false; @@ -2910,6 +2919,12 @@ bool InitProto2MessageModule(PyObject *m) { PyModule_AddObject(m, "ScalarMapIterator", reinterpret_cast<PyObject*>(&ScalarMapIterator_Type)); + +#if PY_MAJOR_VERSION >= 3 + MessageMapContainer_Type = + PyType_FromSpecWithBases(&MessageMapContainer_Type_spec, bases); + PyModule_AddObject(m, "MessageMapContainer", MessageMapContainer_Type); +#else Py_INCREF(mutable_mapping); MessageMapContainer_Type.tp_base = reinterpret_cast<PyTypeObject*>(mutable_mapping.get()); @@ -2920,6 +2935,7 @@ bool InitProto2MessageModule(PyObject *m) { PyModule_AddObject(m, "MessageMapContainer", reinterpret_cast<PyObject*>(&MessageMapContainer_Type)); +#endif if (PyType_Ready(&MessageMapIterator_Type) < 0) { return false; diff --git a/python/google/protobuf/pyext/message_map_container.cc b/python/google/protobuf/pyext/message_map_container.cc index a4a7fbfe..f54d2015 100644 --- a/python/google/protobuf/pyext/message_map_container.cc +++ b/python/google/protobuf/pyext/message_map_container.cc @@ -84,7 +84,12 @@ PyObject* NewContainer(CMessage* parent, return NULL; } +#if PY_MAJOR_VERSION >= 3 + PyObject* obj = PyType_GenericAlloc( + reinterpret_cast<PyTypeObject *>(MessageMapContainer_Type), 0); +#else PyObject* obj = PyType_GenericAlloc(&MessageMapContainer_Type, 0); +#endif if (obj == NULL) { return PyErr_Format(PyExc_RuntimeError, "Could not allocate new container."); @@ -458,44 +463,67 @@ PyObject* IterNext(PyObject* _self) { } // namespace message_map_iterator -PyTypeObject MessageMapContainer_Type = { - PyVarObject_HEAD_INIT(&PyType_Type, 0) - FULL_MODULE_NAME ".MessageMapContainer", // tp_name - sizeof(MessageMapContainer), // tp_basicsize - 0, // tp_itemsize - message_map_container::Dealloc, // tp_dealloc - 0, // tp_print - 0, // tp_getattr - 0, // tp_setattr - 0, // tp_compare - 0, // tp_repr - 0, // tp_as_number - 0, // tp_as_sequence - &message_map_container::MpMethods, // tp_as_mapping - 0, // tp_hash - 0, // tp_call - 0, // tp_str - 0, // tp_getattro - 0, // tp_setattro - 0, // tp_as_buffer - Py_TPFLAGS_DEFAULT, // tp_flags - "A map container for message", // tp_doc - 0, // tp_traverse - 0, // tp_clear - 0, // tp_richcompare - 0, // tp_weaklistoffset - message_map_container::GetIterator, // tp_iter - 0, // tp_iternext - message_map_container::Methods, // tp_methods - 0, // tp_members - 0, // tp_getset - 0, // tp_base - 0, // tp_dict - 0, // tp_descr_get - 0, // tp_descr_set - 0, // tp_dictoffset - 0, // tp_init -}; +#if PY_MAJOR_VERSION >= 3 + static PyType_Slot MessageMapContainer_Type_slots[] = { + {Py_tp_dealloc, (void *)message_map_container::Dealloc}, + {Py_mp_length, (void *)message_map_container::Length}, + {Py_mp_subscript, (void *)message_map_container::GetItem}, + {Py_mp_ass_subscript, (void *)message_map_container::SetItem}, + {Py_tp_methods, (void *)message_map_container::Methods}, + {Py_tp_iter, (void *)message_map_container::GetIterator}, + {0, 0} + }; + + PyType_Spec MessageMapContainer_Type_spec = { + FULL_MODULE_NAME ".MessageMapContainer", + sizeof(MessageMapContainer), + 0, + Py_TPFLAGS_DEFAULT, + MessageMapContainer_Type_slots + }; + + PyObject *MessageMapContainer_Type; + +#else + PyTypeObject MessageMapContainer_Type = { + PyVarObject_HEAD_INIT(&PyType_Type, 0) + FULL_MODULE_NAME ".MessageMapContainer", // tp_name + sizeof(MessageMapContainer), // tp_basicsize + 0, // tp_itemsize + message_map_container::Dealloc, // tp_dealloc + 0, // tp_print + 0, // tp_getattr + 0, // tp_setattr + 0, // tp_compare + 0, // tp_repr + 0, // tp_as_number + 0, // tp_as_sequence + &message_map_container::MpMethods, // tp_as_mapping + 0, // tp_hash + 0, // tp_call + 0, // tp_str + 0, // tp_getattro + 0, // tp_setattro + 0, // tp_as_buffer + Py_TPFLAGS_DEFAULT, // tp_flags + "A map container for message", // tp_doc + 0, // tp_traverse + 0, // tp_clear + 0, // tp_richcompare + 0, // tp_weaklistoffset + message_map_container::GetIterator, // tp_iter + 0, // tp_iternext + message_map_container::Methods, // tp_methods + 0, // tp_members + 0, // tp_getset + 0, // tp_base + 0, // tp_dict + 0, // tp_descr_get + 0, // tp_descr_set + 0, // tp_dictoffset + 0, // tp_init + }; +#endif PyTypeObject MessageMapIterator_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) diff --git a/python/google/protobuf/pyext/message_map_container.h b/python/google/protobuf/pyext/message_map_container.h index 4ca0aecc..8286ba8a 100644 --- a/python/google/protobuf/pyext/message_map_container.h +++ b/python/google/protobuf/pyext/message_map_container.h @@ -89,7 +89,12 @@ struct MessageMapContainer { uint64 version; }; -extern PyTypeObject MessageMapContainer_Type; +#if PY_MAJOR_VERSION >= 3 + extern PyObject *MessageMapContainer_Type; + extern PyType_Spec MessageMapContainer_Type_spec; +#else + extern PyTypeObject MessageMapContainer_Type; +#endif extern PyTypeObject MessageMapIterator_Type; namespace message_map_container { diff --git a/python/google/protobuf/pyext/scalar_map_container.cc b/python/google/protobuf/pyext/scalar_map_container.cc index 80d29425..a355edb2 100644 --- a/python/google/protobuf/pyext/scalar_map_container.cc +++ b/python/google/protobuf/pyext/scalar_map_container.cc @@ -83,7 +83,12 @@ PyObject *NewContainer( return NULL; } +#if PY_MAJOR_VERSION >= 3 + ScopedPyObjectPtr obj(PyType_GenericAlloc( + reinterpret_cast<PyTypeObject *>(ScalarMapContainer_Type), 0)); +#else ScopedPyObjectPtr obj(PyType_GenericAlloc(&ScalarMapContainer_Type, 0)); +#endif if (obj.get() == NULL) { return PyErr_Format(PyExc_RuntimeError, "Could not allocate new container."); @@ -432,44 +437,66 @@ PyObject* IterNext(PyObject* _self) { } // namespace scalar_map_iterator -PyTypeObject ScalarMapContainer_Type = { - PyVarObject_HEAD_INIT(&PyType_Type, 0) - FULL_MODULE_NAME ".ScalarMapContainer", // tp_name - sizeof(ScalarMapContainer), // tp_basicsize - 0, // tp_itemsize - scalar_map_container::Dealloc, // tp_dealloc - 0, // tp_print - 0, // tp_getattr - 0, // tp_setattr - 0, // tp_compare - 0, // tp_repr - 0, // tp_as_number - 0, // tp_as_sequence - &scalar_map_container::MpMethods, // tp_as_mapping - 0, // tp_hash - 0, // tp_call - 0, // tp_str - 0, // tp_getattro - 0, // tp_setattro - 0, // tp_as_buffer - Py_TPFLAGS_DEFAULT, // tp_flags - "A scalar map container", // tp_doc - 0, // tp_traverse - 0, // tp_clear - 0, // tp_richcompare - 0, // tp_weaklistoffset - scalar_map_container::GetIterator, // tp_iter - 0, // tp_iternext - scalar_map_container::Methods, // tp_methods - 0, // tp_members - 0, // tp_getset - 0, // tp_base - 0, // tp_dict - 0, // tp_descr_get - 0, // tp_descr_set - 0, // tp_dictoffset - 0, // tp_init -}; + +#if PY_MAJOR_VERSION >= 3 + static PyType_Slot ScalarMapContainer_Type_slots[] = { + {Py_tp_dealloc, (void *)scalar_map_container::Dealloc}, + {Py_mp_length, (void *)scalar_map_container::Length}, + {Py_mp_subscript, (void *)scalar_map_container::GetItem}, + {Py_mp_ass_subscript, (void *)scalar_map_container::SetItem}, + {Py_tp_methods, (void *)scalar_map_container::Methods}, + {Py_tp_iter, (void *)scalar_map_container::GetIterator}, + {0, 0}, + }; + + PyType_Spec ScalarMapContainer_Type_spec = { + FULL_MODULE_NAME ".ScalarMapContainer", + sizeof(ScalarMapContainer), + 0, + Py_TPFLAGS_DEFAULT, + ScalarMapContainer_Type_slots + }; + PyObject *ScalarMapContainer_Type; +#else + PyTypeObject ScalarMapContainer_Type = { + PyVarObject_HEAD_INIT(&PyType_Type, 0) + FULL_MODULE_NAME ".ScalarMapContainer", // tp_name + sizeof(ScalarMapContainer), // tp_basicsize + 0, // tp_itemsize + scalar_map_container::Dealloc, // tp_dealloc + 0, // tp_print + 0, // tp_getattr + 0, // tp_setattr + 0, // tp_compare + 0, // tp_repr + 0, // tp_as_number + 0, // tp_as_sequence + &scalar_map_container::MpMethods, // tp_as_mapping + 0, // tp_hash + 0, // tp_call + 0, // tp_str + 0, // tp_getattro + 0, // tp_setattro + 0, // tp_as_buffer + Py_TPFLAGS_DEFAULT, // tp_flags + "A scalar map container", // tp_doc + 0, // tp_traverse + 0, // tp_clear + 0, // tp_richcompare + 0, // tp_weaklistoffset + scalar_map_container::GetIterator, // tp_iter + 0, // tp_iternext + scalar_map_container::Methods, // tp_methods + 0, // tp_members + 0, // tp_getset + 0, // tp_base + 0, // tp_dict + 0, // tp_descr_get + 0, // tp_descr_set + 0, // tp_dictoffset + 0, // tp_init + }; +#endif PyTypeObject ScalarMapIterator_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) diff --git a/python/google/protobuf/pyext/scalar_map_container.h b/python/google/protobuf/pyext/scalar_map_container.h index 254e6e98..aded8d49 100644 --- a/python/google/protobuf/pyext/scalar_map_container.h +++ b/python/google/protobuf/pyext/scalar_map_container.h @@ -83,7 +83,12 @@ struct ScalarMapContainer { uint64 version; }; -extern PyTypeObject ScalarMapContainer_Type; +#if PY_MAJOR_VERSION >= 3 + extern PyObject *ScalarMapContainer_Type; + extern PyType_Spec ScalarMapContainer_Type_spec; +#else + extern PyTypeObject ScalarMapContainer_Type; +#endif extern PyTypeObject ScalarMapIterator_Type; namespace scalar_map_container { diff --git a/python/tox.ini b/python/tox.ini index d0100758..a6352ef4 100644 --- a/python/tox.ini +++ b/python/tox.ini @@ -2,8 +2,7 @@ envlist = # cpp implementation on py34 is currently broken due to # changes introduced by http://bugs.python.org/issue22079. - #py{26,27,33,34}-{cpp,python} - py{26,27,33}-{cpp,python}, py34-{python} + py{26,27,33,34}-{cpp,python} [testenv] usedevelop=true diff --git a/ruby/Gemfile.lock b/ruby/Gemfile.lock index 91e1666f..8599da75 100644 --- a/ruby/Gemfile.lock +++ b/ruby/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - google-protobuf (3.0.0.alpha.4) + google-protobuf (3.0.0.alpha.4.0) GEM remote: https://rubygems.org/ @@ -23,3 +23,6 @@ DEPENDENCIES rake-compiler rubygems-tasks test-unit + +BUNDLED WITH + 1.10.6 diff --git a/ruby/ext/google/protobuf_c/encode_decode.c b/ruby/ext/google/protobuf_c/encode_decode.c index df4feac2..1c48281f 100644 --- a/ruby/ext/google/protobuf_c/encode_decode.c +++ b/ruby/ext/google/protobuf_c/encode_decode.c @@ -35,11 +35,13 @@ // For more information, see: // https://bugs.ruby-lang.org/issues/11328 VALUE noleak_rb_str_cat(VALUE rb_str, const char *str, long len) { + char *p; size_t oldlen = RSTRING_LEN(rb_str); rb_str_modify_expand(rb_str, len); - char *p = RSTRING_PTR(rb_str); + p = RSTRING_PTR(rb_str); memcpy(p + oldlen, str, len); rb_str_set_len(rb_str, oldlen + len); + return rb_str; } // ----------------------------------------------------------------------------- diff --git a/src/Makefile.am b/src/Makefile.am index caae2933..2985b5d8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -434,6 +434,8 @@ libprotoc_la_SOURCES = \ google/protobuf/compiler/objectivec/objectivec_primitive_field.h \ google/protobuf/compiler/python/python_generator.cc \ google/protobuf/compiler/ruby/ruby_generator.cc \ + google/protobuf/compiler/csharp/csharp_doc_comment.cc \ + google/protobuf/compiler/csharp/csharp_doc_comment.h \ google/protobuf/compiler/csharp/csharp_enum.cc \ google/protobuf/compiler/csharp/csharp_enum.h \ google/protobuf/compiler/csharp/csharp_enum_field.cc \ diff --git a/src/google/protobuf/arena.cc b/src/google/protobuf/arena.cc index 74b09655..cd0b21a7 100755 --- a/src/google/protobuf/arena.cc +++ b/src/google/protobuf/arena.cc @@ -61,6 +61,9 @@ void Arena::Init() { cleanup_list_ = 0; if (options_.initial_block != NULL && options_.initial_block_size > 0) { + GOOGLE_CHECK_GE(options_.initial_block_size, sizeof(Block)) + << ": Initial block size too small for header."; + // Add first unowned block to list. Block* first_block = reinterpret_cast<Block*>(options_.initial_block); first_block->size = options_.initial_block_size; diff --git a/src/google/protobuf/compiler/cpp/cpp_file.cc b/src/google/protobuf/compiler/cpp/cpp_file.cc index 5dae4cdd..8e8bd8b7 100644 --- a/src/google/protobuf/compiler/cpp/cpp_file.cc +++ b/src/google/protobuf/compiler/cpp/cpp_file.cc @@ -598,8 +598,13 @@ void FileGenerator::GenerateBuildDescriptors(io::Printer* printer) { // bytes in length". Declare a static array of characters rather than use a // string literal. if (breakdown_large_file && file_data.size() > 65535) { + // This has to be explicitly marked as a signed char because the generated + // code puts negative values in the array, and sometimes plain char is + // unsigned. That implicit narrowing conversion is not allowed in C++11. + // <http://stackoverflow.com/questions/4434140/narrowing-conversions-in-c0x-is-it-just-me-or-does-this-sound-like-a-breakin> + // has details on why. printer->Print( - "static const char descriptor[] = {\n"); + "static const signed char descriptor[] = {\n"); printer->Indent(); // Only write 25 bytes per line. diff --git a/src/google/protobuf/compiler/csharp/csharp_doc_comment.cc b/src/google/protobuf/compiler/csharp/csharp_doc_comment.cc new file mode 100644 index 00000000..9ad2cbb5 --- /dev/null +++ b/src/google/protobuf/compiler/csharp/csharp_doc_comment.cc @@ -0,0 +1,98 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: kenton@google.com (Kenton Varda) +// Based on original Protocol Buffers design by +// Sanjay Ghemawat, Jeff Dean, and others. +#include <google/protobuf/compiler/csharp/csharp_doc_comment.h> +#include <google/protobuf/descriptor.h> +#include <google/protobuf/io/printer.h> +#include <google/protobuf/stubs/strutil.h> + +namespace google { +namespace protobuf { +namespace compiler { +namespace csharp { + +// Functions to create C# XML documentation comments. +// Currently this only includes documentation comments containing text specified as comments +// in the .proto file; documentation comments generated just from field/message/enum/proto names +// is inlined in the relevant code. If more control is required, that code can be moved here. + +void WriteDocCommentBodyImpl(io::Printer* printer, SourceLocation location) { + string comments = location.leading_comments.empty() ? + location.trailing_comments : location.leading_comments; + if (comments.empty()) { + return; + } + // XML escaping... no need for apostrophes etc as the whole text is going to be a child + // node of a summary element, not part of an attribute. + comments = StringReplace(comments, "&", "&", true); + comments = StringReplace(comments, "<", "<", true); + vector<string> lines = Split(comments, "\n"); + printer->Print("/// <summary>\n"); + for (std::vector<string>::iterator it = lines.begin(); it != lines.end(); ++it) { + printer->Print("/// $line$\n", "line", *it); + } + printer->Print("/// </summary>\n"); +} + +template <typename DescriptorType> +static void WriteDocCommentBody( + io::Printer* printer, const DescriptorType* descriptor) { + SourceLocation location; + if (descriptor->GetSourceLocation(&location)) { + WriteDocCommentBodyImpl(printer, location); + } +} + +void WriteMessageDocComment(io::Printer* printer, const Descriptor* message) { + WriteDocCommentBody(printer, message); +} + +void WritePropertyDocComment(io::Printer* printer, const FieldDescriptor* field) { + WriteDocCommentBody(printer, field); +} + +void WriteEnumDocComment(io::Printer* printer, const EnumDescriptor* enumDescriptor) { + WriteDocCommentBody(printer, enumDescriptor); +} +void WriteEnumValueDocComment(io::Printer* printer, const EnumValueDescriptor* value) { + WriteDocCommentBody(printer, value); +} + +void WriteMethodDocComment(io::Printer* printer, const MethodDescriptor* method) { + WriteDocCommentBody(printer, method); +} + +} // namespace csharp +} // namespace compiler +} // namespace protobuf +} // namespace google diff --git a/src/google/protobuf/compiler/csharp/csharp_doc_comment.h b/src/google/protobuf/compiler/csharp/csharp_doc_comment.h new file mode 100644 index 00000000..75eb0ea0 --- /dev/null +++ b/src/google/protobuf/compiler/csharp/csharp_doc_comment.h @@ -0,0 +1,51 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +#ifndef GOOGLE_PROTOBUF_COMPILER_CSHARP_DOC_COMMENT_H__ +#define GOOGLE_PROTOBUF_COMPILER_CSHARP_DOC_COMMENT_H__ + +#include <google/protobuf/io/printer.h> +#include <google/protobuf/descriptor.h> + +namespace google { +namespace protobuf { +namespace compiler { +namespace csharp { + void WriteMessageDocComment(io::Printer* printer, const Descriptor* message); + void WritePropertyDocComment(io::Printer* printer, const FieldDescriptor* field); + void WriteEnumDocComment(io::Printer* printer, const EnumDescriptor* enumDescriptor); + void WriteEnumValueDocComment(io::Printer* printer, const EnumValueDescriptor* value); + void WriteMethodDocComment(io::Printer* printer, const MethodDescriptor* method); +} // namespace csharp +} // namespace compiler +} // namespace protobuf +} // namespace google +#endif // GOOGLE_PROTOBUF_COMPILER_CSHARP_DOC_COMMENT_H__ diff --git a/src/google/protobuf/compiler/csharp/csharp_enum.cc b/src/google/protobuf/compiler/csharp/csharp_enum.cc index 0e8f9836..56681989 100644 --- a/src/google/protobuf/compiler/csharp/csharp_enum.cc +++ b/src/google/protobuf/compiler/csharp/csharp_enum.cc @@ -38,6 +38,7 @@ #include <google/protobuf/io/zero_copy_stream.h> #include <google/protobuf/stubs/strutil.h> +#include <google/protobuf/compiler/csharp/csharp_doc_comment.h> #include <google/protobuf/compiler/csharp/csharp_enum.h> #include <google/protobuf/compiler/csharp/csharp_helpers.h> @@ -57,13 +58,15 @@ EnumGenerator::~EnumGenerator() { } void EnumGenerator::Generate(io::Printer* printer) { + WriteEnumDocComment(printer, descriptor_); WriteGeneratedCodeAttributes(printer); printer->Print("$access_level$ enum $name$ {\n", "access_level", class_access_level(), "name", descriptor_->name()); printer->Indent(); for (int i = 0; i < descriptor_->value_count(); i++) { - printer->Print("$name$ = $number$,\n", + WriteEnumValueDocComment(printer, descriptor_->value(i)); + printer->Print("$name$ = $number$,\n", "name", descriptor_->value(i)->name(), "number", SimpleItoa(descriptor_->value(i)->number())); } diff --git a/src/google/protobuf/compiler/csharp/csharp_generator.cc b/src/google/protobuf/compiler/csharp/csharp_generator.cc index e0a6c83a..95ff48ae 100644 --- a/src/google/protobuf/compiler/csharp/csharp_generator.cc +++ b/src/google/protobuf/compiler/csharp/csharp_generator.cc @@ -36,10 +36,12 @@ #include <google/protobuf/descriptor.pb.h> #include <google/protobuf/io/printer.h> #include <google/protobuf/io/zero_copy_stream.h> +#include <google/protobuf/stubs/strutil.h> #include <google/protobuf/compiler/csharp/csharp_generator.h> -#include <google/protobuf/compiler/csharp/csharp_umbrella_class.h> #include <google/protobuf/compiler/csharp/csharp_helpers.h> +#include <google/protobuf/compiler/csharp/csharp_names.h> +#include <google/protobuf/compiler/csharp/csharp_umbrella_class.h> using google::protobuf::internal::scoped_ptr; @@ -48,9 +50,39 @@ namespace protobuf { namespace compiler { namespace csharp { -std::string GetOutputFile(const google::protobuf::FileDescriptor* file, const std::string file_extension) -{ - return GetUmbrellaClassUnqualifiedName(file) + file_extension; +std::string GetOutputFile( + const google::protobuf::FileDescriptor* file, + const std::string file_extension, + const bool generate_directories, + const std::string base_namespace, + string* error) { + string relative_filename = GetUmbrellaClassUnqualifiedName(file) + file_extension; + if (!generate_directories) { + return relative_filename; + } + string ns = GetFileNamespace(file); + string namespace_suffix = ns; + if (!base_namespace.empty()) { + // Check that the base_namespace is either equal to or a leading part of + // the file namespace. This isn't just a simple prefix; "Foo.B" shouldn't + // be regarded as a prefix of "Foo.Bar". The simplest option is to add "." + // to both. + string extended_ns = ns + "."; + if (extended_ns.find(base_namespace + ".") != 0) { + *error = "Namespace " + ns + " is not a prefix namespace of base namespace " + base_namespace; + return ""; // This will be ignored, because we've set an error. + } + namespace_suffix = ns.substr(base_namespace.length()); + if (namespace_suffix.find(".") == 0) { + namespace_suffix = namespace_suffix.substr(1); + } + } + + string namespace_dir = StringReplace(namespace_suffix, ".", "/", true); + if (!namespace_dir.empty()) { + namespace_dir += "/"; + } + return namespace_dir + relative_filename; } void GenerateFile(const google::protobuf::FileDescriptor* file, @@ -75,16 +107,26 @@ bool Generator::Generate( } std::string file_extension = ".cs"; + std::string base_namespace = ""; + bool generate_directories = false; for (int i = 0; i < options.size(); i++) { if (options[i].first == "file_extension") { file_extension = options[i].second; + } else if (options[i].first == "base_namespace") { + base_namespace = options[i].second; + generate_directories = true; } else { *error = "Unknown generator option: " + options[i].first; return false; } } - std::string filename = GetOutputFile(file, file_extension); + string filename_error = ""; + std::string filename = GetOutputFile(file, file_extension, generate_directories, base_namespace, &filename_error); + if (!filename_error.empty()) { + *error = filename_error; + return false; + } scoped_ptr<io::ZeroCopyOutputStream> output( generator_context->Open(filename)); io::Printer printer(output.get(), '$'); diff --git a/src/google/protobuf/compiler/csharp/csharp_helpers.h b/src/google/protobuf/compiler/csharp/csharp_helpers.h index 4ed17a84..e293faca 100644 --- a/src/google/protobuf/compiler/csharp/csharp_helpers.h +++ b/src/google/protobuf/compiler/csharp/csharp_helpers.h @@ -101,8 +101,6 @@ std::string StringToBase64(const std::string& input); std::string FileDescriptorToBase64(const FileDescriptor* descriptor); -uint FixedMakeTag(const FieldDescriptor* descriptor); - FieldGeneratorBase* CreateFieldGenerator(const FieldDescriptor* descriptor, int fieldOrdinal); // Determines whether the given message is a map entry message, i.e. one implicitly created diff --git a/src/google/protobuf/compiler/csharp/csharp_map_field.cc b/src/google/protobuf/compiler/csharp/csharp_map_field.cc index f84ad6f7..b493495d 100644 --- a/src/google/protobuf/compiler/csharp/csharp_map_field.cc +++ b/src/google/protobuf/compiler/csharp/csharp_map_field.cc @@ -38,6 +38,7 @@ #include <google/protobuf/io/zero_copy_stream.h> #include <google/protobuf/stubs/strutil.h> +#include <google/protobuf/compiler/csharp/csharp_doc_comment.h> #include <google/protobuf/compiler/csharp/csharp_helpers.h> #include <google/protobuf/compiler/csharp/csharp_map_field.h> @@ -76,6 +77,7 @@ void MapFieldGenerator::GenerateMembers(io::Printer* printer) { variables_, ", $tag$);\n" "private readonly pbc::MapField<$key_type_name$, $value_type_name$> $name$_ = new pbc::MapField<$key_type_name$, $value_type_name$>($true_for_wrappers$);\n"); + WritePropertyDocComment(printer, descriptor_); AddDeprecatedFlag(printer); printer->Print( variables_, diff --git a/src/google/protobuf/compiler/csharp/csharp_message.cc b/src/google/protobuf/compiler/csharp/csharp_message.cc index a71a7909..21fbf7e3 100644 --- a/src/google/protobuf/compiler/csharp/csharp_message.cc +++ b/src/google/protobuf/compiler/csharp/csharp_message.cc @@ -42,6 +42,7 @@ #include <google/protobuf/wire_format.h> #include <google/protobuf/wire_format_lite.h> +#include <google/protobuf/compiler/csharp/csharp_doc_comment.h> #include <google/protobuf/compiler/csharp/csharp_enum.h> #include <google/protobuf/compiler/csharp/csharp_field_base.h> #include <google/protobuf/compiler/csharp/csharp_helpers.h> @@ -101,6 +102,7 @@ void MessageGenerator::Generate(io::Printer* printer) { vars["class_name"] = class_name(); vars["access_level"] = class_access_level(); + WriteMessageDocComment(printer, descriptor_); printer->Print( "[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n"); WriteGeneratedCodeAttributes(printer); @@ -152,7 +154,9 @@ void MessageGenerator::Generate(io::Printer* printer) { // Rats: we lose the debug comment here :( printer->Print( + "/// <summary>Field number for the \"$field_name$\" field.</summary>\n" "public const int $field_constant_name$ = $index$;\n", + "field_name", fieldDescriptor->name(), "field_constant_name", GetFieldConstantName(fieldDescriptor), "index", SimpleItoa(fieldDescriptor->number())); scoped_ptr<FieldGeneratorBase> generator( @@ -169,6 +173,7 @@ void MessageGenerator::Generate(io::Printer* printer) { printer->Print( vars, "private object $name$_;\n" + "/// <summary>Enum of possible cases for the \"$original_name$\" oneof.</summary>\n" "public enum $property_name$OneofCase {\n"); printer->Indent(); printer->Print("None = 0,\n"); @@ -180,6 +185,7 @@ void MessageGenerator::Generate(io::Printer* printer) { } printer->Outdent(); printer->Print("}\n"); + // TODO: Should we put the oneof .proto comments here? It's unclear exactly where they should go. printer->Print( vars, "private $property_name$OneofCase $name$Case_ = $property_name$OneofCase.None;\n" @@ -199,8 +205,11 @@ void MessageGenerator::Generate(io::Printer* printer) { // Nested messages and enums if (HasNestedGeneratedTypes()) { - printer->Print("#region Nested types\n" - "[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n"); + printer->Print( + vars, + "#region Nested types\n" + "/// <summary>Container for nested types declared in the $class_name$ message type.</summary>\n" + "[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n"); WriteGeneratedCodeAttributes(printer); printer->Print("public static partial class Types {\n"); printer->Indent(); diff --git a/src/google/protobuf/compiler/csharp/csharp_message_field.cc b/src/google/protobuf/compiler/csharp/csharp_message_field.cc index 4f576cd1..f81f769b 100644 --- a/src/google/protobuf/compiler/csharp/csharp_message_field.cc +++ b/src/google/protobuf/compiler/csharp/csharp_message_field.cc @@ -38,6 +38,7 @@ #include <google/protobuf/io/zero_copy_stream.h> #include <google/protobuf/stubs/strutil.h> +#include <google/protobuf/compiler/csharp/csharp_doc_comment.h> #include <google/protobuf/compiler/csharp/csharp_helpers.h> #include <google/protobuf/compiler/csharp/csharp_message_field.h> @@ -61,6 +62,7 @@ void MessageFieldGenerator::GenerateMembers(io::Printer* printer) { printer->Print( variables_, "private $type_name$ $name$_;\n"); + WritePropertyDocComment(printer, descriptor_); AddDeprecatedFlag(printer); printer->Print( variables_, @@ -152,6 +154,7 @@ MessageOneofFieldGenerator::~MessageOneofFieldGenerator() { } void MessageOneofFieldGenerator::GenerateMembers(io::Printer* printer) { + WritePropertyDocComment(printer, descriptor_); AddDeprecatedFlag(printer); printer->Print( variables_, diff --git a/src/google/protobuf/compiler/csharp/csharp_primitive_field.cc b/src/google/protobuf/compiler/csharp/csharp_primitive_field.cc index fc043ec0..76d5b247 100644 --- a/src/google/protobuf/compiler/csharp/csharp_primitive_field.cc +++ b/src/google/protobuf/compiler/csharp/csharp_primitive_field.cc @@ -38,6 +38,7 @@ #include <google/protobuf/io/zero_copy_stream.h> #include <google/protobuf/stubs/strutil.h> +#include <google/protobuf/compiler/csharp/csharp_doc_comment.h> #include <google/protobuf/compiler/csharp/csharp_helpers.h> #include <google/protobuf/compiler/csharp/csharp_primitive_field.h> @@ -68,6 +69,7 @@ void PrimitiveFieldGenerator::GenerateMembers(io::Printer* printer) { printer->Print( variables_, "private $type_name$ $name_def_message$;\n"); + WritePropertyDocComment(printer, descriptor_); AddDeprecatedFlag(printer); printer->Print( variables_, @@ -170,6 +172,7 @@ PrimitiveOneofFieldGenerator::~PrimitiveOneofFieldGenerator() { } void PrimitiveOneofFieldGenerator::GenerateMembers(io::Printer* printer) { + WritePropertyDocComment(printer, descriptor_); AddDeprecatedFlag(printer); printer->Print( variables_, diff --git a/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc b/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc index 625631df..3a11b75d 100644 --- a/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc +++ b/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc @@ -38,6 +38,7 @@ #include <google/protobuf/io/zero_copy_stream.h> #include <google/protobuf/wire_format.h> +#include <google/protobuf/compiler/csharp/csharp_doc_comment.h> #include <google/protobuf/compiler/csharp/csharp_helpers.h> #include <google/protobuf/compiler/csharp/csharp_repeated_enum_field.h> @@ -62,6 +63,7 @@ void RepeatedEnumFieldGenerator::GenerateMembers(io::Printer* printer) { " = pb::FieldCodec.ForEnum($tag$, x => (int) x, x => ($type_name$) x);\n"); printer->Print(variables_, "private readonly pbc::RepeatedField<$type_name$> $name$_ = new pbc::RepeatedField<$type_name$>();\n"); + WritePropertyDocComment(printer, descriptor_); AddDeprecatedFlag(printer); printer->Print( variables_, diff --git a/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc b/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc index 7fbab681..fc12faed 100644 --- a/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc +++ b/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc @@ -37,6 +37,7 @@ #include <google/protobuf/io/printer.h> #include <google/protobuf/io/zero_copy_stream.h> +#include <google/protobuf/compiler/csharp/csharp_doc_comment.h> #include <google/protobuf/compiler/csharp/csharp_helpers.h> #include <google/protobuf/compiler/csharp/csharp_repeated_message_field.h> #include <google/protobuf/compiler/csharp/csharp_message_field.h> @@ -75,6 +76,7 @@ void RepeatedMessageFieldGenerator::GenerateMembers(io::Printer* printer) { printer->Print( variables_, "private readonly pbc::RepeatedField<$type_name$> $name$_ = new pbc::RepeatedField<$type_name$>();\n"); + WritePropertyDocComment(printer, descriptor_); AddDeprecatedFlag(printer); printer->Print( variables_, diff --git a/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc b/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc index 1163ce73..5fe0b203 100644 --- a/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc +++ b/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc @@ -38,6 +38,7 @@ #include <google/protobuf/io/zero_copy_stream.h> #include <google/protobuf/wire_format.h> +#include <google/protobuf/compiler/csharp/csharp_doc_comment.h> #include <google/protobuf/compiler/csharp/csharp_helpers.h> #include <google/protobuf/compiler/csharp/csharp_repeated_primitive_field.h> @@ -62,6 +63,7 @@ void RepeatedPrimitiveFieldGenerator::GenerateMembers(io::Printer* printer) { " = pb::FieldCodec.For$capitalized_type_name$($tag$);\n"); printer->Print(variables_, "private readonly pbc::RepeatedField<$type_name$> $name$_ = new pbc::RepeatedField<$type_name$>();\n"); + WritePropertyDocComment(printer, descriptor_); AddDeprecatedFlag(printer); printer->Print( variables_, diff --git a/src/google/protobuf/compiler/csharp/csharp_umbrella_class.cc b/src/google/protobuf/compiler/csharp/csharp_umbrella_class.cc index 399c64e1..7cf101b0 100644 --- a/src/google/protobuf/compiler/csharp/csharp_umbrella_class.cc +++ b/src/google/protobuf/compiler/csharp/csharp_umbrella_class.cc @@ -135,7 +135,9 @@ void UmbrellaClassGenerator::WriteIntroduction(io::Printer* printer) { } printer->Print( - "[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n"); + "/// <summary>Holder for reflection information generated from $file_name$</summary>\n" + "[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n", + "file_name", file_->name()); WriteGeneratedCodeAttributes(printer); printer->Print( "$access_level$ static partial class $umbrella_class_name$ {\n" @@ -148,12 +150,14 @@ void UmbrellaClassGenerator::WriteIntroduction(io::Printer* printer) { void UmbrellaClassGenerator::WriteDescriptor(io::Printer* printer) { printer->Print( "#region Descriptor\n" + "/// <summary>File descriptor for $file_name$</summary>\n" "public static pbr::FileDescriptor Descriptor {\n" " get { return descriptor; }\n" "}\n" "private static pbr::FileDescriptor descriptor;\n" "\n" "static $umbrella_class_name$() {\n", + "file_name", file_->name(), "umbrella_class_name", umbrellaClassname_); printer->Indent(); printer->Print( @@ -166,7 +170,7 @@ void UmbrellaClassGenerator::WriteDescriptor(io::Printer* printer) { // TODO(jonskeet): Consider a C#-escaping format here instead of just Base64. std::string base64 = FileDescriptorToBase64(file_); while (base64.size() > 60) { - printer->Print("\"$base64$\", \n", "base64", base64.substr(0, 60)); + printer->Print("\"$base64$\",\n", "base64", base64.substr(0, 60)); base64 = base64.substr(60); } printer->Print("\"$base64$\"));\n", "base64", base64); diff --git a/src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc b/src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc index 44f832bf..6a3750e0 100644 --- a/src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc +++ b/src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc @@ -37,6 +37,7 @@ #include <google/protobuf/io/printer.h> #include <google/protobuf/io/zero_copy_stream.h> +#include <google/protobuf/compiler/csharp/csharp_doc_comment.h> #include <google/protobuf/compiler/csharp/csharp_helpers.h> #include <google/protobuf/compiler/csharp/csharp_wrapper_field.h> @@ -70,6 +71,7 @@ void WrapperFieldGenerator::GenerateMembers(io::Printer* printer) { variables_, ";\n" "private $type_name$ $name$_;\n"); + WritePropertyDocComment(printer, descriptor_); AddDeprecatedFlag(printer); printer->Print( variables_, @@ -165,6 +167,7 @@ void WrapperOneofFieldGenerator::GenerateMembers(io::Printer* printer) { "private static readonly pb::FieldCodec<$type_name$> _oneof_$name$_codec = "); GenerateCodecCode(printer); printer->Print(";\n"); + WritePropertyDocComment(printer, descriptor_); AddDeprecatedFlag(printer); printer->Print( variables_, diff --git a/src/google/protobuf/compiler/main.cc b/src/google/protobuf/compiler/main.cc index 4815a726..584e5a40 100644 --- a/src/google/protobuf/compiler/main.cc +++ b/src/google/protobuf/compiler/main.cc @@ -72,7 +72,7 @@ int main(int argc, char* argv[]) { // CSharp google::protobuf::compiler::csharp::Generator csharp_generator; - cli.RegisterGenerator("--csharp_out", &csharp_generator, + cli.RegisterGenerator("--csharp_out", "--csharp_opt", &csharp_generator, "Generate C# source file."); // Objective C diff --git a/src/google/protobuf/descriptor.pb.cc b/src/google/protobuf/descriptor.pb.cc index 921d2cd0..9c817122 100644 --- a/src/google/protobuf/descriptor.pb.cc +++ b/src/google/protobuf/descriptor.pb.cc @@ -757,8 +757,9 @@ void protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto() { "path\030\001 \003(\005B\002\020\001\022\020\n\004span\030\002 \003(\005B\002\020\001\022\030\n\020lead" "ing_comments\030\003 \001(\t\022\031\n\021trailing_comments\030" "\004 \001(\t\022!\n\031leading_detached_comments\030\006 \003(\t" - "B;\n\023com.google.protobufB\020DescriptorProto" - "sH\001Z\ndescriptor\242\002\003GPB", 4981); + "BX\n\023com.google.protobufB\020DescriptorProto" + "sH\001Z\ndescriptor\242\002\003GPB\252\002\032Google.Protobuf." + "Reflection", 5010); ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( "google/protobuf/descriptor.proto", &protobuf_RegisterTypes); FileDescriptorSet::default_instance_ = new FileDescriptorSet(); diff --git a/src/google/protobuf/descriptor.proto b/src/google/protobuf/descriptor.proto index 801d85e4..c59a6022 100644 --- a/src/google/protobuf/descriptor.proto +++ b/src/google/protobuf/descriptor.proto @@ -43,8 +43,7 @@ package google.protobuf; option go_package = "descriptor"; option java_package = "com.google.protobuf"; option java_outer_classname = "DescriptorProtos"; -// Re-enable this once the tools have picked up the csharp_namespace option. -// option csharp_namespace = "Google.ProtocolBuffers.DescriptorProtos"; +option csharp_namespace = "Google.Protobuf.Reflection"; option objc_class_prefix = "GPB"; // descriptor.proto must be optimized for speed because reflection-based diff --git a/src/google/protobuf/map_type_handler.h b/src/google/protobuf/map_type_handler.h index 5040e605..f8ad7584 100644 --- a/src/google/protobuf/map_type_handler.h +++ b/src/google/protobuf/map_type_handler.h @@ -272,24 +272,24 @@ MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::ByteSize( return WireFormatLite::MessageSizeNoVirtual(value); } -#define BYTE_SIZE(FieldType, DeclaredType) \ +#define GOOGLE_PROTOBUF_BYTE_SIZE(FieldType, DeclaredType) \ template <typename Type> \ inline int MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::ByteSize( \ const MapEntryAccessorType& value) { \ return WireFormatLite::DeclaredType##Size(value); \ } -BYTE_SIZE(STRING, String) -BYTE_SIZE(BYTES , Bytes) -BYTE_SIZE(INT64 , Int64) -BYTE_SIZE(UINT64, UInt64) -BYTE_SIZE(INT32 , Int32) -BYTE_SIZE(UINT32, UInt32) -BYTE_SIZE(SINT64, SInt64) -BYTE_SIZE(SINT32, SInt32) -BYTE_SIZE(ENUM , Enum) - -#undef BYTE_SIZE +GOOGLE_PROTOBUF_BYTE_SIZE(STRING, String) +GOOGLE_PROTOBUF_BYTE_SIZE(BYTES , Bytes) +GOOGLE_PROTOBUF_BYTE_SIZE(INT64 , Int64) +GOOGLE_PROTOBUF_BYTE_SIZE(UINT64, UInt64) +GOOGLE_PROTOBUF_BYTE_SIZE(INT32 , Int32) +GOOGLE_PROTOBUF_BYTE_SIZE(UINT32, UInt32) +GOOGLE_PROTOBUF_BYTE_SIZE(SINT64, SInt64) +GOOGLE_PROTOBUF_BYTE_SIZE(SINT32, SInt32) +GOOGLE_PROTOBUF_BYTE_SIZE(ENUM , Enum) + +#undef GOOGLE_PROTOBUF_BYTE_SIZE #define FIXED_BYTE_SIZE(FieldType, DeclaredType) \ template <typename Type> \ diff --git a/src/google/protobuf/message.cc b/src/google/protobuf/message.cc index d9c200c6..032748bd 100644 --- a/src/google/protobuf/message.cc +++ b/src/google/protobuf/message.cc @@ -494,11 +494,19 @@ Message* GenericTypeHandler<Message>::NewFromPrototype( return prototype->New(arena); } template<> +#if defined(_MSC_VER) && (_MSC_VER >= 1900) +// Note: force noinline to workaround MSVC 2015 compiler bug, issue #240 +GOOGLE_ATTRIBUTE_NOINLINE +#endif google::protobuf::Arena* GenericTypeHandler<Message>::GetArena( Message* value) { return value->GetArena(); } template<> +#if defined(_MSC_VER) && (_MSC_VER >= 1900) +// Note: force noinline to workaround MSVC 2015 compiler bug, issue #240 +GOOGLE_ATTRIBUTE_NOINLINE +#endif void* GenericTypeHandler<Message>::GetMaybeArenaPointer( Message* value) { return value->GetMaybeArenaPointer(); diff --git a/src/google/protobuf/metadata.h b/src/google/protobuf/metadata.h index fdee150b..219645d3 100644 --- a/src/google/protobuf/metadata.h +++ b/src/google/protobuf/metadata.h @@ -56,7 +56,7 @@ namespace internal { // The tagged pointer uses the LSB to disambiguate cases, and uses bit 0 == 0 to // indicate an arena pointer and bit 0 == 1 to indicate a UFS+Arena-container // pointer. -class LIBPROTOBUF_EXPORT InternalMetadataWithArena { +class InternalMetadataWithArena { public: InternalMetadataWithArena() : ptr_(NULL) {} explicit InternalMetadataWithArena(Arena* arena) diff --git a/src/google/protobuf/stubs/hash.h b/src/google/protobuf/stubs/hash.h index c6f210f0..e7b3771f 100755 --- a/src/google/protobuf/stubs/hash.h +++ b/src/google/protobuf/stubs/hash.h @@ -41,10 +41,10 @@ #define GOOGLE_PROTOBUF_HAVE_HASH_MAP 1 #define GOOGLE_PROTOBUF_HAVE_HASH_SET 1 -// Use C++11 unordered_{map|set} if available. Otherwise, libc++ always support -// unordered_{map|set} -#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X) || \ - defined(_LIBCPP_VERSION) +// Use C++11 unordered_{map|set} if available. +#if ((_LIBCPP_STD_VER >= 11) || \ + (((__cplusplus >= 201103L) || defined(__GXX_EXPERIMENTAL_CXX0X)) && \ + (__GLIBCXX__ > 20090421))) # define GOOGLE_PROTOBUF_HAS_CXX11_HASH // For XCode >= 4.6: the compiler is clang with libc++. diff --git a/src/google/protobuf/testing/googletest.cc b/src/google/protobuf/testing/googletest.cc index b8bd790b..2b9cddef 100644 --- a/src/google/protobuf/testing/googletest.cc +++ b/src/google/protobuf/testing/googletest.cc @@ -94,6 +94,13 @@ string TestSourceDir() { namespace { string GetTemporaryDirectoryName() { + // Tests run under Bazel "should not" use /tmp. Bazel sets this environment + // variable for tests to use instead. + char *from_environment = getenv("TEST_TMPDIR"); + if (from_environment != NULL && from_environment[0] != '\0') { + return string(from_environment) + "/protobuf_tmpdir"; + } + // tmpnam() is generally not considered safe but we're only using it for // testing. We cannot use tmpfile() or mkstemp() since we're creating a // directory. @@ -113,12 +113,14 @@ build_javanano_oracle7() { internal_install_python_deps() { sudo pip install tox - # Only install Python2.6 on Linux. + # Only install Python2.6/3.x on Linux. if [ $(uname -s) == "Linux" ]; then sudo apt-get install -y python-software-properties # for apt-add-repository sudo apt-add-repository -y ppa:fkrull/deadsnakes sudo apt-get update -qq sudo apt-get install -y python2.6 python2.6-dev + sudo apt-get install -y python3.3 python3.3-dev + sudo apt-get install -y python3.4 python3.4-dev fi } @@ -127,9 +129,9 @@ build_python() { internal_build_cpp internal_install_python_deps cd python - # Only test Python 2.6 on Linux + # Only test Python 2.6/3.x on Linux if [ $(uname -s) == "Linux" ]; then - envlist=py26-python,py27-python + envlist=py\{26,27,33,34\}-python else envlist=py27-python fi @@ -143,9 +145,9 @@ build_python_cpp() { export LD_LIBRARY_PATH=../src/.libs # for Linux export DYLD_LIBRARY_PATH=../src/.libs # for OS X cd python - # Only test Python 2.6 on Linux + # Only test Python 2.6/3.x on Linux if [ $(uname -s) == "Linux" ]; then - envlist=py26-cpp,py27-cpp + envlist=py\{26,27,33,34\}-cpp else envlist=py27-cpp fi |