Commit 5350822b authored by Jon Skeet's avatar Jon Skeet

Regenerated code due to previous commit.

Note that now we need a proto3 version of addressbook.proto. This may affect other platforms, and could do with an overhaul to follow proto3 conventions anyway (e.g. repeated field names). Will need to think about that carefully before merging into master. Raised issue #565 for this.
parent 493e3db9
...@@ -26,15 +26,15 @@ namespace Google.Protobuf.Examples.AddressBook { ...@@ -26,15 +26,15 @@ namespace Google.Protobuf.Examples.AddressBook {
static Addressbook() { static Addressbook() {
byte[] descriptorData = global::System.Convert.FromBase64String( byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat( string.Concat(
"ChFhZGRyZXNzYm9vay5wcm90bxIIdHV0b3JpYWwi2gEKBlBlcnNvbhIMCgRu", "ChFhZGRyZXNzYm9vay5wcm90bxIIdHV0b3JpYWwi1AEKBlBlcnNvbhIMCgRu",
"YW1lGAEgAigJEgoKAmlkGAIgAigFEg0KBWVtYWlsGAMgASgJEisKBXBob25l", "YW1lGAEgASgJEgoKAmlkGAIgASgFEg0KBWVtYWlsGAMgASgJEisKBXBob25l",
"GAQgAygLMhwudHV0b3JpYWwuUGVyc29uLlBob25lTnVtYmVyGk0KC1Bob25l", "GAQgAygLMhwudHV0b3JpYWwuUGVyc29uLlBob25lTnVtYmVyGkcKC1Bob25l",
"TnVtYmVyEg4KBm51bWJlchgBIAIoCRIuCgR0eXBlGAIgASgOMhoudHV0b3Jp", "TnVtYmVyEg4KBm51bWJlchgBIAEoCRIoCgR0eXBlGAIgASgOMhoudHV0b3Jp",
"YWwuUGVyc29uLlBob25lVHlwZToESE9NRSIrCglQaG9uZVR5cGUSCgoGTU9C", "YWwuUGVyc29uLlBob25lVHlwZSIrCglQaG9uZVR5cGUSCgoGTU9CSUxFEAAS",
"SUxFEAASCAoESE9NRRABEggKBFdPUksQAiIvCgtBZGRyZXNzQm9vaxIgCgZw", "CAoESE9NRRABEggKBFdPUksQAiIvCgtBZGRyZXNzQm9vaxIgCgZwZXJzb24Y",
"ZXJzb24YASADKAsyEC50dXRvcmlhbC5QZXJzb25CUAoUY29tLmV4YW1wbGUu", "ASADKAsyEC50dXRvcmlhbC5QZXJzb25CUAoUY29tLmV4YW1wbGUudHV0b3Jp",
"dHV0b3JpYWxCEUFkZHJlc3NCb29rUHJvdG9zqgIkR29vZ2xlLlByb3RvYnVm", "YWxCEUFkZHJlc3NCb29rUHJvdG9zqgIkR29vZ2xlLlByb3RvYnVmLkV4YW1w",
"LkV4YW1wbGVzLkFkZHJlc3NCb29r")); "bGVzLkFkZHJlc3NCb29rYgZwcm90bzM="));
descriptor = pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, descriptor = pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
new pbd::FileDescriptor[] { new pbd::FileDescriptor[] {
}); });
...@@ -70,9 +70,13 @@ namespace Google.Protobuf.Examples.AddressBook { ...@@ -70,9 +70,13 @@ namespace Google.Protobuf.Examples.AddressBook {
private bool _frozen = false; private bool _frozen = false;
public bool IsFrozen { get { return _frozen; } } public bool IsFrozen { get { return _frozen; } }
public Person() { } public Person() {
OnConstruction();
}
partial void OnConstruction();
public Person(Person other) { public Person(Person other) : this() {
name_ = other.name_; name_ = other.name_;
id_ = other.id_; id_ = other.id_;
email_ = other.email_; email_ = other.email_;
...@@ -261,9 +265,13 @@ namespace Google.Protobuf.Examples.AddressBook { ...@@ -261,9 +265,13 @@ namespace Google.Protobuf.Examples.AddressBook {
private bool _frozen = false; private bool _frozen = false;
public bool IsFrozen { get { return _frozen; } } public bool IsFrozen { get { return _frozen; } }
public PhoneNumber() { } public PhoneNumber() {
OnConstruction();
}
partial void OnConstruction();
public PhoneNumber(PhoneNumber other) { public PhoneNumber(PhoneNumber other) : this() {
number_ = other.number_; number_ = other.number_;
type_ = other.type_; type_ = other.type_;
} }
...@@ -290,7 +298,7 @@ namespace Google.Protobuf.Examples.AddressBook { ...@@ -290,7 +298,7 @@ namespace Google.Protobuf.Examples.AddressBook {
} }
public const int TypeFieldNumber = 2; public const int TypeFieldNumber = 2;
private global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType type_ = global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.HOME; 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 { public global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType Type {
get { return type_; } get { return type_; }
set { set {
...@@ -318,7 +326,7 @@ namespace Google.Protobuf.Examples.AddressBook { ...@@ -318,7 +326,7 @@ namespace Google.Protobuf.Examples.AddressBook {
public override int GetHashCode() { public override int GetHashCode() {
int hash = 1; int hash = 1;
if (Number.Length != 0) hash ^= Number.GetHashCode(); if (Number.Length != 0) hash ^= Number.GetHashCode();
if (Type != global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.HOME) hash ^= Type.GetHashCode(); if (Type != global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.MOBILE) hash ^= Type.GetHashCode();
return hash; return hash;
} }
...@@ -327,7 +335,7 @@ namespace Google.Protobuf.Examples.AddressBook { ...@@ -327,7 +335,7 @@ namespace Google.Protobuf.Examples.AddressBook {
output.WriteRawTag(10); output.WriteRawTag(10);
output.WriteString(Number); output.WriteString(Number);
} }
if (Type != global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.HOME) { if (Type != global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.MOBILE) {
output.WriteRawTag(16); output.WriteRawTag(16);
output.WriteEnum((int) Type); output.WriteEnum((int) Type);
} }
...@@ -338,7 +346,7 @@ namespace Google.Protobuf.Examples.AddressBook { ...@@ -338,7 +346,7 @@ namespace Google.Protobuf.Examples.AddressBook {
if (Number.Length != 0) { if (Number.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Number); size += 1 + pb::CodedOutputStream.ComputeStringSize(Number);
} }
if (Type != global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.HOME) { if (Type != global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.MOBILE) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Type); size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Type);
} }
return size; return size;
...@@ -351,7 +359,7 @@ namespace Google.Protobuf.Examples.AddressBook { ...@@ -351,7 +359,7 @@ namespace Google.Protobuf.Examples.AddressBook {
if (other.Number.Length != 0) { if (other.Number.Length != 0) {
Number = other.Number; Number = other.Number;
} }
if (other.Type != global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.HOME) { if (other.Type != global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.MOBILE) {
Type = other.Type; Type = other.Type;
} }
} }
...@@ -404,9 +412,13 @@ namespace Google.Protobuf.Examples.AddressBook { ...@@ -404,9 +412,13 @@ namespace Google.Protobuf.Examples.AddressBook {
private bool _frozen = false; private bool _frozen = false;
public bool IsFrozen { get { return _frozen; } } public bool IsFrozen { get { return _frozen; } }
public AddressBook() { } public AddressBook() {
OnConstruction();
}
partial void OnConstruction();
public AddressBook(AddressBook other) { public AddressBook(AddressBook other) : this() {
person_ = other.person_.Clone(); person_ = other.person_.Clone();
} }
......
...@@ -72,9 +72,13 @@ namespace Google.Protobuf.TestProtos { ...@@ -72,9 +72,13 @@ namespace Google.Protobuf.TestProtos {
private bool _frozen = false; private bool _frozen = false;
public bool IsFrozen { get { return _frozen; } } public bool IsFrozen { get { return _frozen; } }
public ImportMessage() { } public ImportMessage() {
OnConstruction();
}
partial void OnConstruction();
public ImportMessage(ImportMessage other) { public ImportMessage(ImportMessage other) : this() {
d_ = other.d_; d_ = other.d_;
} }
......
...@@ -57,9 +57,13 @@ namespace Google.Protobuf.TestProtos { ...@@ -57,9 +57,13 @@ namespace Google.Protobuf.TestProtos {
private bool _frozen = false; private bool _frozen = false;
public bool IsFrozen { get { return _frozen; } } public bool IsFrozen { get { return _frozen; } }
public PublicImportMessage() { } public PublicImportMessage() {
OnConstruction();
}
partial void OnConstruction();
public PublicImportMessage(PublicImportMessage other) { public PublicImportMessage(PublicImportMessage other) : this() {
e_ = other.e_; e_ = other.e_;
} }
......
...@@ -109,9 +109,13 @@ namespace UnitTest.Issues.TestProtos { ...@@ -109,9 +109,13 @@ namespace UnitTest.Issues.TestProtos {
private bool _frozen = false; private bool _frozen = false;
public bool IsFrozen { get { return _frozen; } } public bool IsFrozen { get { return _frozen; } }
public Issue307() { } public Issue307() {
OnConstruction();
}
partial void OnConstruction();
public Issue307(Issue307 other) { public Issue307(Issue307 other) : this() {
} }
public Issue307 Clone() { public Issue307 Clone() {
...@@ -194,9 +198,13 @@ namespace UnitTest.Issues.TestProtos { ...@@ -194,9 +198,13 @@ namespace UnitTest.Issues.TestProtos {
private bool _frozen = false; private bool _frozen = false;
public bool IsFrozen { get { return _frozen; } } public bool IsFrozen { get { return _frozen; } }
public NestedOnce() { } public NestedOnce() {
OnConstruction();
}
partial void OnConstruction();
public NestedOnce(NestedOnce other) { public NestedOnce(NestedOnce other) : this() {
} }
public NestedOnce Clone() { public NestedOnce Clone() {
...@@ -279,9 +287,13 @@ namespace UnitTest.Issues.TestProtos { ...@@ -279,9 +287,13 @@ namespace UnitTest.Issues.TestProtos {
private bool _frozen = false; private bool _frozen = false;
public bool IsFrozen { get { return _frozen; } } public bool IsFrozen { get { return _frozen; } }
public NestedTwice() { } public NestedTwice() {
OnConstruction();
}
partial void OnConstruction();
public NestedTwice(NestedTwice other) { public NestedTwice(NestedTwice other) : this() {
} }
public NestedTwice Clone() { public NestedTwice Clone() {
...@@ -373,9 +385,13 @@ namespace UnitTest.Issues.TestProtos { ...@@ -373,9 +385,13 @@ namespace UnitTest.Issues.TestProtos {
private bool _frozen = false; private bool _frozen = false;
public bool IsFrozen { get { return _frozen; } } public bool IsFrozen { get { return _frozen; } }
public NegativeEnumMessage() { } public NegativeEnumMessage() {
OnConstruction();
}
partial void OnConstruction();
public NegativeEnumMessage(NegativeEnumMessage other) { public NegativeEnumMessage(NegativeEnumMessage other) : this() {
value_ = other.value_; value_ = other.value_;
values_ = other.values_.Clone(); values_ = other.values_.Clone();
packedValues_ = other.packedValues_.Clone(); packedValues_ = other.packedValues_.Clone();
...@@ -522,9 +538,13 @@ namespace UnitTest.Issues.TestProtos { ...@@ -522,9 +538,13 @@ namespace UnitTest.Issues.TestProtos {
private bool _frozen = false; private bool _frozen = false;
public bool IsFrozen { get { return _frozen; } } public bool IsFrozen { get { return _frozen; } }
public DeprecatedChild() { } public DeprecatedChild() {
OnConstruction();
}
partial void OnConstruction();
public DeprecatedChild(DeprecatedChild other) { public DeprecatedChild(DeprecatedChild other) : this() {
} }
public DeprecatedChild Clone() { public DeprecatedChild Clone() {
...@@ -606,9 +626,13 @@ namespace UnitTest.Issues.TestProtos { ...@@ -606,9 +626,13 @@ namespace UnitTest.Issues.TestProtos {
private bool _frozen = false; private bool _frozen = false;
public bool IsFrozen { get { return _frozen; } } public bool IsFrozen { get { return _frozen; } }
public DeprecatedFieldsMessage() { } public DeprecatedFieldsMessage() {
OnConstruction();
}
public DeprecatedFieldsMessage(DeprecatedFieldsMessage other) { partial void OnConstruction();
public DeprecatedFieldsMessage(DeprecatedFieldsMessage other) : this() {
primitiveValue_ = other.primitiveValue_; primitiveValue_ = other.primitiveValue_;
primitiveArray_ = other.primitiveArray_.Clone(); primitiveArray_ = other.primitiveArray_.Clone();
MessageValue = other.messageValue_ != null ? other.MessageValue.Clone() : null; MessageValue = other.messageValue_ != null ? other.MessageValue.Clone() : null;
...@@ -842,9 +866,13 @@ namespace UnitTest.Issues.TestProtos { ...@@ -842,9 +866,13 @@ namespace UnitTest.Issues.TestProtos {
private bool _frozen = false; private bool _frozen = false;
public bool IsFrozen { get { return _frozen; } } public bool IsFrozen { get { return _frozen; } }
public ItemField() { } public ItemField() {
OnConstruction();
}
partial void OnConstruction();
public ItemField(ItemField other) { public ItemField(ItemField other) : this() {
item_ = other.item_; item_ = other.item_;
} }
......
// See README.txt for information and build instructions. // See README.txt for information and build instructions.
syntax = "proto2"; syntax = "proto3";
package tutorial; package tutorial;
...@@ -9,9 +9,9 @@ option java_outer_classname = "AddressBookProtos"; ...@@ -9,9 +9,9 @@ option java_outer_classname = "AddressBookProtos";
option csharp_namespace = "Google.Protobuf.Examples.AddressBook"; option csharp_namespace = "Google.Protobuf.Examples.AddressBook";
message Person { message Person {
required string name = 1; string name = 1;
required int32 id = 2; // Unique ID number for this person. int32 id = 2; // Unique ID number for this person.
optional string email = 3; string email = 3;
enum PhoneType { enum PhoneType {
MOBILE = 0; MOBILE = 0;
...@@ -20,8 +20,8 @@ message Person { ...@@ -20,8 +20,8 @@ message Person {
} }
message PhoneNumber { message PhoneNumber {
required string number = 1; string number = 1;
optional PhoneType type = 2 [default = HOME]; PhoneType type = 2;
} }
repeated PhoneNumber phone = 4; repeated PhoneNumber phone = 4;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment