Initial support for services and extensions. Incomplete, but enough to get generated unit test files to compile.
This commit is contained in:
parent
1353315ded
commit
575083ae9c
37 changed files with 16089 additions and 296 deletions
|
@ -48,6 +48,12 @@
|
|||
<Compile Include="CodedInputStreamTest.cs" />
|
||||
<Compile Include="CodedOutputStreamTest.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="TestProtos\UnitTestEmbedOptimizeForProtoFile.cs" />
|
||||
<Compile Include="TestProtos\UnitTestImportProtoFile.cs" />
|
||||
<Compile Include="TestProtos\UnitTestMessageSetProtoFile.cs" />
|
||||
<Compile Include="TestProtos\UnitTestOptimizeForProtoFile.cs" />
|
||||
<Compile Include="TestProtos\UnitTestProtoFile.cs" />
|
||||
<Compile Include="TestUtil.cs" />
|
||||
<Compile Include="WireFormatTest.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
|
|
@ -0,0 +1,372 @@
|
|||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
|
||||
using pb = global::Google.ProtocolBuffers;
|
||||
using pbc = global::Google.ProtocolBuffers.Collections;
|
||||
using pbd = global::Google.ProtocolBuffers.Descriptors;
|
||||
using scg = global::System.Collections.Generic;
|
||||
using self = global::Google.ProtocolBuffers.TestProtos;
|
||||
|
||||
namespace Google.ProtocolBuffers.TestProtos {
|
||||
|
||||
public static partial class UnitTestEmbedOptimizeForProtoFile {
|
||||
|
||||
#region Descriptor
|
||||
public static pbd::FileDescriptor Descriptor {
|
||||
get { return descriptor; }
|
||||
}
|
||||
private static readonly pbd::FileDescriptor descriptor = pbd::FileDescriptor.InternalBuildGeneratedFileFrom (
|
||||
new byte[] {
|
||||
0x0a, 0x31, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x75, 0x6e,
|
||||
0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a,
|
||||
0x65, 0x5f, 0x66, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
|
||||
0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x6f, 0x70, 0x74,
|
||||
0x69, 0x6d, 0x69, 0x7a, 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa1, 0x01, 0x0a, 0x19,
|
||||
0x54, 0x65, 0x73, 0x74, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x64, 0x46, 0x6f,
|
||||
0x72, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x41, 0x0a, 0x10, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x6d, 0x65,
|
||||
0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
|
||||
0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69,
|
||||
0x6d, 0x69, 0x7a, 0x65, 0x64, 0x46, 0x6f, 0x72, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x41, 0x0a, 0x10, 0x72, 0x65, 0x70, 0x65,
|
||||
0x61, 0x74, 0x65, 0x64, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54,
|
||||
0x65, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x64, 0x46, 0x6f, 0x72, 0x53, 0x69, 0x7a, 0x65, 0x42,
|
||||
0x4a, 0x48, 0x01, 0xc2, 0x3e, 0x21, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f,
|
||||
0x6c, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x73, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0xca,
|
||||
0x3e, 0x21, 0x55, 0x6e, 0x69, 0x74, 0x54, 0x65, 0x73, 0x74, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6d,
|
||||
0x69, 0x7a, 0x65, 0x46, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x46, 0x69, 0x6c, 0x65,
|
||||
}, new pbd::FileDescriptor[] {
|
||||
self::UnitTestOptimizeForProtoFile.Descriptor,
|
||||
});
|
||||
#endregion
|
||||
|
||||
#region Extensions
|
||||
/**/
|
||||
#endregion
|
||||
|
||||
#region Static variables
|
||||
internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_TestEmbedOptimizedForSize__Descriptor
|
||||
= Descriptor.MessageTypes[0];
|
||||
internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestEmbedOptimizedForSize__FieldAccessorTable
|
||||
= new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestEmbedOptimizedForSize__Descriptor,
|
||||
new string[] { "OptionalMessage", "RepeatedMessage", },
|
||||
typeof (self::TestEmbedOptimizedForSize),
|
||||
typeof (self::TestEmbedOptimizedForSize.Builder));
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
#region Enums
|
||||
#endregion
|
||||
|
||||
#region Messages
|
||||
public sealed partial class TestEmbedOptimizedForSize : pb::GeneratedMessage<TestEmbedOptimizedForSize, TestEmbedOptimizedForSize.Builder> {
|
||||
// Use TestEmbedOptimizedForSize.CreateBuilder() to construct.
|
||||
private TestEmbedOptimizedForSize() {}
|
||||
|
||||
private static readonly TestEmbedOptimizedForSize defaultInstance = new TestEmbedOptimizedForSize();
|
||||
public static TestEmbedOptimizedForSize DefaultInstance {
|
||||
get { return defaultInstance; }
|
||||
}
|
||||
|
||||
public override TestEmbedOptimizedForSize DefaultInstanceForType {
|
||||
get { return defaultInstance; }
|
||||
}
|
||||
|
||||
public static pbd::MessageDescriptor Descriptor {
|
||||
get { return self::UnitTestEmbedOptimizeForProtoFile.internal__static_protobuf_unittest_TestEmbedOptimizedForSize__Descriptor; }
|
||||
}
|
||||
|
||||
protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors {
|
||||
get { return self::UnitTestEmbedOptimizeForProtoFile.internal__static_protobuf_unittest_TestEmbedOptimizedForSize__FieldAccessorTable; }
|
||||
}
|
||||
|
||||
// optional .protobuf_unittest.TestOptimizedForSize optional_message = 1;
|
||||
private bool hasOptionalMessage;
|
||||
private self::TestOptimizedForSize optionalMessage_ = self::TestOptimizedForSize.DefaultInstance;
|
||||
public bool HasOptionalMessage {
|
||||
get { return hasOptionalMessage; }
|
||||
}
|
||||
public self::TestOptimizedForSize OptionalMessage {
|
||||
get { return optionalMessage_; }
|
||||
}
|
||||
|
||||
// repeated .protobuf_unittest.TestOptimizedForSize repeated_message = 2;
|
||||
private scg::IList<self::TestOptimizedForSize> repeatedMessage_ = pbc::Lists<self::TestOptimizedForSize>.Empty;
|
||||
public scg::IList<self::TestOptimizedForSize> RepeatedMessageList {
|
||||
get { return repeatedMessage_; }
|
||||
}
|
||||
public int RepeatedMessageCount
|
||||
{ get { return repeatedMessage_.Count; }
|
||||
}
|
||||
public self::TestOptimizedForSize GetRepeatedMessage(int index) {
|
||||
return repeatedMessage_ [index];
|
||||
}
|
||||
|
||||
public override bool IsInitialized {
|
||||
get {
|
||||
if (HasOptionalMessage) {
|
||||
if (!OptionalMessage.IsInitialized) return false;
|
||||
}
|
||||
foreach (self::TestOptimizedForSize element in RepeatedMessageList) {
|
||||
if (!element.IsInitialized) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public override void WriteTo(pb::CodedOutputStream output) {
|
||||
if (HasOptionalMessage) {
|
||||
output.WriteMessage(1, OptionalMessage);
|
||||
}
|
||||
foreach (self::TestOptimizedForSize element in RepeatedMessageList) {
|
||||
output.WriteMessage(2, element);
|
||||
}
|
||||
UnknownFields.WriteTo(output);
|
||||
}
|
||||
|
||||
private int memoizedSerializedSize = -1;
|
||||
public override int SerializedSize {
|
||||
get {
|
||||
int size = memoizedSerializedSize;
|
||||
if (size != -1) return size;
|
||||
|
||||
size = 0;
|
||||
if (HasOptionalMessage) {
|
||||
size += pb::CodedOutputStream.ComputeMessageSize(1, OptionalMessage);
|
||||
}
|
||||
foreach (self::TestOptimizedForSize element in RepeatedMessageList) {
|
||||
size += pb::CodedOutputStream.ComputeMessageSize(2, element);
|
||||
}
|
||||
size += UnknownFields.SerializedSize;
|
||||
memoizedSerializedSize = size;
|
||||
return size;
|
||||
}
|
||||
}
|
||||
|
||||
public static self::TestEmbedOptimizedForSize ParseFrom(pb::ByteString data) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
|
||||
}
|
||||
public static self::TestEmbedOptimizedForSize ParseFrom(pb::ByteString data,
|
||||
pb::ExtensionRegistry extensionRegistry) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
|
||||
.BuildParsed();
|
||||
}
|
||||
public static self::TestEmbedOptimizedForSize ParseFrom(byte[] data) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
|
||||
}
|
||||
public static self::TestEmbedOptimizedForSize parseFrom(byte[] data,
|
||||
pb::ExtensionRegistry extensionRegistry) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
|
||||
.BuildParsed();
|
||||
}
|
||||
public static self::TestEmbedOptimizedForSize ParseFrom(global::System.IO.Stream input) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
|
||||
}
|
||||
public static self::TestEmbedOptimizedForSize ParseFrom(
|
||||
global::System.IO.Stream input,
|
||||
pb::ExtensionRegistry extensionRegistry) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
|
||||
.BuildParsed();
|
||||
}
|
||||
public static self::TestEmbedOptimizedForSize ParseFrom(pb::CodedInputStream input) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
|
||||
}
|
||||
public static self::TestEmbedOptimizedForSize ParseFrom(pb::CodedInputStream input,
|
||||
pb::ExtensionRegistry extensionRegistry) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
|
||||
.BuildParsed();
|
||||
}
|
||||
|
||||
public static Builder CreateBuilder() { return new Builder(); }
|
||||
public override IBuilder<self::TestEmbedOptimizedForSize> CreateBuilderForType() { return new Builder(); }
|
||||
public static Builder CreateBuilder(self::TestEmbedOptimizedForSize prototype) {
|
||||
return (Builder) new Builder().MergeFrom(prototype);
|
||||
}
|
||||
|
||||
public sealed partial class Builder : pb::GeneratedBuilder<self::TestEmbedOptimizedForSize, Builder> {
|
||||
// Construct using self::TestEmbedOptimizedForSize.CreateBuilder()
|
||||
internal Builder() {}
|
||||
|
||||
self::TestEmbedOptimizedForSize result = new self::TestEmbedOptimizedForSize();
|
||||
|
||||
protected override self::TestEmbedOptimizedForSize MessageBeingBuilt {
|
||||
get { return result; }
|
||||
}
|
||||
|
||||
public override IBuilder<self::TestEmbedOptimizedForSize> Clear() {
|
||||
result = new self::TestEmbedOptimizedForSize();
|
||||
return this;
|
||||
}
|
||||
|
||||
public override IBuilder<self::TestEmbedOptimizedForSize> Clone() {
|
||||
return new Builder().MergeFrom(result);
|
||||
}
|
||||
|
||||
public override pbd::MessageDescriptor DescriptorForType {
|
||||
get { return self::TestEmbedOptimizedForSize.Descriptor; }
|
||||
}
|
||||
|
||||
public override self::TestEmbedOptimizedForSize DefaultInstanceForType {
|
||||
get { return self::TestEmbedOptimizedForSize.DefaultInstance; }
|
||||
}
|
||||
|
||||
public override self::TestEmbedOptimizedForSize BuildPartial() {
|
||||
if (result.repeatedMessage_ != pbc::Lists<self::TestOptimizedForSize>.Empty) {
|
||||
result.repeatedMessage_ = pbc::Lists<self::TestOptimizedForSize>.AsReadOnly(result.repeatedMessage_);
|
||||
}
|
||||
self::TestEmbedOptimizedForSize returnMe = result;
|
||||
result = null;
|
||||
return returnMe;
|
||||
}
|
||||
|
||||
public override IBuilder MergeFrom(pb::IMessage other) {
|
||||
if (other is self::TestEmbedOptimizedForSize) {
|
||||
return MergeFrom((self::TestEmbedOptimizedForSize) other);
|
||||
} else {
|
||||
base.MergeFrom(other);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public override IBuilder<self::TestEmbedOptimizedForSize> MergeFrom(self::TestEmbedOptimizedForSize other) {
|
||||
if (other == self::TestEmbedOptimizedForSize.DefaultInstance) return this;
|
||||
if (other.HasOptionalMessage) {
|
||||
MergeOptionalMessage(other.OptionalMessage);
|
||||
}
|
||||
if (other.repeatedMessage_.Count != 0) {
|
||||
if (result.repeatedMessage_.Count == 0) {
|
||||
result.repeatedMessage_ = new scg::List<self::TestOptimizedForSize>();
|
||||
}
|
||||
base.AddRange(other.repeatedMessage_, result.repeatedMessage_);
|
||||
}
|
||||
this.MergeUnknownFields(other.UnknownFields);
|
||||
return this;
|
||||
}
|
||||
|
||||
public override IBuilder<self::TestEmbedOptimizedForSize> MergeFrom(pb::CodedInputStream input) {
|
||||
return MergeFrom(input, pb::ExtensionRegistry.Empty);
|
||||
}
|
||||
|
||||
public override IBuilder<self::TestEmbedOptimizedForSize> MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
|
||||
pb::UnknownFieldSet.Builder unknownFields =
|
||||
pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
|
||||
while (true) {
|
||||
uint tag = input.ReadTag();
|
||||
switch (tag) {
|
||||
case 0:
|
||||
this.UnknownFields = unknownFields.Build();
|
||||
return this;
|
||||
default: {
|
||||
if (!ParseUnknownField(input, unknownFields,
|
||||
extensionRegistry, tag)) {
|
||||
this.UnknownFields = unknownFields.Build();
|
||||
return this;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 10: {
|
||||
self::TestOptimizedForSize.Builder subBuilder = self::TestOptimizedForSize.CreateBuilder();
|
||||
if (HasOptionalMessage) {
|
||||
subBuilder.MergeFrom(OptionalMessage);
|
||||
}
|
||||
input.ReadMessage(subBuilder, extensionRegistry);
|
||||
OptionalMessage = subBuilder.BuildPartial();
|
||||
break;
|
||||
}
|
||||
case 18: {
|
||||
self::TestOptimizedForSize.Builder subBuilder = self::TestOptimizedForSize.CreateBuilder();
|
||||
input.ReadMessage(subBuilder, extensionRegistry);
|
||||
AddRepeatedMessage(subBuilder.BuildPartial());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// optional .protobuf_unittest.TestOptimizedForSize optional_message = 1;
|
||||
public bool HasOptionalMessage {
|
||||
get { return result.HasOptionalMessage; }
|
||||
}
|
||||
public self::TestOptimizedForSize OptionalMessage {
|
||||
get { return result.OptionalMessage; }
|
||||
set { SetOptionalMessage(value); }
|
||||
}
|
||||
public Builder SetOptionalMessage(self::TestOptimizedForSize value) {
|
||||
result.hasOptionalMessage = true;
|
||||
result.optionalMessage_ = value;
|
||||
return this;
|
||||
}
|
||||
public Builder SetOptionalMessage(self::TestOptimizedForSize.Builder builderForValue) {
|
||||
result.hasOptionalMessage = true;
|
||||
result.optionalMessage_ = builderForValue.Build();
|
||||
return this;
|
||||
}
|
||||
public Builder MergeOptionalMessage(self::TestOptimizedForSize value) {
|
||||
if (result.HasOptionalMessage &&
|
||||
result.optionalMessage_ != self::TestOptimizedForSize.DefaultInstance) {
|
||||
result.optionalMessage_ =
|
||||
self::TestOptimizedForSize.CreateBuilder(result.optionalMessage_).MergeFrom(value).BuildPartial();
|
||||
} else {
|
||||
result.optionalMessage_ = value;
|
||||
}
|
||||
result.hasOptionalMessage = true;
|
||||
return this;
|
||||
}
|
||||
public Builder ClearOptionalMessage() {
|
||||
result.hasOptionalMessage = false;
|
||||
result.optionalMessage_ = self::TestOptimizedForSize.DefaultInstance;
|
||||
return this;
|
||||
}
|
||||
|
||||
// repeated .protobuf_unittest.TestOptimizedForSize repeated_message = 2;
|
||||
public scg::IList<self::TestOptimizedForSize> RepeatedMessageList {
|
||||
get { return pbc::Lists.AsReadOnly(result.repeatedMessage_); }
|
||||
}
|
||||
public int RepeatedMessageCount {
|
||||
get { return result.RepeatedMessageCount; }
|
||||
}
|
||||
public self::TestOptimizedForSize GetRepeatedMessage(int index) {
|
||||
return result.GetRepeatedMessage(index);
|
||||
}
|
||||
public Builder SetRepeatedMessage(int index, self::TestOptimizedForSize value) {
|
||||
result.repeatedMessage_[index] = value;
|
||||
return this;
|
||||
}
|
||||
public Builder SetRepeatedMessage(int index, self::TestOptimizedForSize.Builder builderForValue) {
|
||||
result.repeatedMessage_[index] = builderForValue.Build();
|
||||
return this;
|
||||
}
|
||||
public Builder AddRepeatedMessage(self::TestOptimizedForSize value) {
|
||||
if (result.repeatedMessage_ == pbc::Lists<self::TestOptimizedForSize>.Empty) {
|
||||
result.repeatedMessage_ = new scg::List<self::TestOptimizedForSize>();
|
||||
}
|
||||
result.repeatedMessage_.Add(value);
|
||||
return this;
|
||||
}
|
||||
public Builder AddRepeatedMessage(self::TestOptimizedForSize.Builder builderForValue) {
|
||||
if (result.repeatedMessage_ == pbc::Lists<self::TestOptimizedForSize>.Empty) {
|
||||
result.repeatedMessage_ = new scg::List<self::TestOptimizedForSize>();
|
||||
}
|
||||
result.repeatedMessage_.Add(builderForValue.Build());
|
||||
return this;
|
||||
}
|
||||
public Builder AddRangeRepeatedMessage(scg::IEnumerable<self::TestOptimizedForSize> values) {
|
||||
if (result.repeatedMessage_ == pbc::Lists<self::TestOptimizedForSize>.Empty) {
|
||||
result.repeatedMessage_ = new scg::List<self::TestOptimizedForSize>();
|
||||
}
|
||||
base.AddRange(values, result.repeatedMessage_);
|
||||
return this;
|
||||
}
|
||||
public Builder ClearRepeatedMessage() {
|
||||
result.repeatedMessage_ = pbc::Lists<self::TestOptimizedForSize>.Empty;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Services
|
||||
#endregion
|
||||
}
|
|
@ -0,0 +1,268 @@
|
|||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
|
||||
using pb = global::Google.ProtocolBuffers;
|
||||
using pbc = global::Google.ProtocolBuffers.Collections;
|
||||
using pbd = global::Google.ProtocolBuffers.Descriptors;
|
||||
using scg = global::System.Collections.Generic;
|
||||
using self = global::Google.ProtocolBuffers.TestProtos;
|
||||
|
||||
namespace Google.ProtocolBuffers.TestProtos {
|
||||
|
||||
public static partial class UnitTestImportProtoFile {
|
||||
|
||||
#region Descriptor
|
||||
public static pbd::FileDescriptor Descriptor {
|
||||
get { return descriptor; }
|
||||
}
|
||||
private static readonly pbd::FileDescriptor descriptor = pbd::FileDescriptor.InternalBuildGeneratedFileFrom (
|
||||
new byte[] {
|
||||
0x0a, 0x25, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x75, 0x6e,
|
||||
0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
|
||||
0x18, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x69,
|
||||
0x6d, 0x70, 0x6f, 0x72, 0x74, 0x22, 0x1a, 0x0a, 0x0d, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61,
|
||||
0x67, 0x65, 0x12, 0x09, 0x0a, 0x01, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x2a, 0x3c, 0x0a, 0x0a, 0x49, 0x6d, 0x70,
|
||||
0x6f, 0x72, 0x74, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x0e, 0x0a, 0x0a, 0x49, 0x4d, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x46, 0x4f,
|
||||
0x4f, 0x10, 0x07, 0x12, 0x0e, 0x0a, 0x0a, 0x49, 0x4d, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x42, 0x41, 0x52, 0x10, 0x08, 0x12,
|
||||
0x0e, 0x0a, 0x0a, 0x49, 0x4d, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x42, 0x41, 0x5a, 0x10, 0x09, 0x42, 0x5a, 0x0a, 0x18, 0x63,
|
||||
0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x74,
|
||||
0x65, 0x73, 0x74, 0x48, 0x01, 0xc2, 0x3e, 0x21, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x63, 0x6f, 0x6c, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x73, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x73, 0xca, 0x3e, 0x17, 0x55, 0x6e, 0x69, 0x74, 0x54, 0x65, 0x73, 0x74, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x50, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x46, 0x69, 0x6c, 0x65,
|
||||
}, new pbd::FileDescriptor[] {
|
||||
});
|
||||
#endregion
|
||||
|
||||
#region Extensions
|
||||
/**/
|
||||
#endregion
|
||||
|
||||
#region Static variables
|
||||
internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_import_ImportMessage__Descriptor
|
||||
= Descriptor.MessageTypes[0];
|
||||
internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_import_ImportMessage__FieldAccessorTable
|
||||
= new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_import_ImportMessage__Descriptor,
|
||||
new string[] { "D", },
|
||||
typeof (self::ImportMessage),
|
||||
typeof (self::ImportMessage.Builder));
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
#region Enums
|
||||
public enum ImportEnum {
|
||||
IMPORT_FOO = 7,
|
||||
IMPORT_BAR = 8,
|
||||
IMPORT_BAZ = 9,
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Messages
|
||||
public sealed partial class ImportMessage : pb::GeneratedMessage<ImportMessage, ImportMessage.Builder> {
|
||||
// Use ImportMessage.CreateBuilder() to construct.
|
||||
private ImportMessage() {}
|
||||
|
||||
private static readonly ImportMessage defaultInstance = new ImportMessage();
|
||||
public static ImportMessage DefaultInstance {
|
||||
get { return defaultInstance; }
|
||||
}
|
||||
|
||||
public override ImportMessage DefaultInstanceForType {
|
||||
get { return defaultInstance; }
|
||||
}
|
||||
|
||||
public static pbd::MessageDescriptor Descriptor {
|
||||
get { return self::UnitTestImportProtoFile.internal__static_protobuf_unittest_import_ImportMessage__Descriptor; }
|
||||
}
|
||||
|
||||
protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors {
|
||||
get { return self::UnitTestImportProtoFile.internal__static_protobuf_unittest_import_ImportMessage__FieldAccessorTable; }
|
||||
}
|
||||
|
||||
// optional int32 d = 1;
|
||||
private bool hasD;
|
||||
private int d_ = 0;
|
||||
public bool HasD {
|
||||
get { return hasD; }
|
||||
}
|
||||
public int D {
|
||||
get { return d_; }
|
||||
}
|
||||
|
||||
public override bool IsInitialized {
|
||||
get {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public override void WriteTo(pb::CodedOutputStream output) {
|
||||
if (HasD) {
|
||||
output.WriteInt32(1, D);
|
||||
}
|
||||
UnknownFields.WriteTo(output);
|
||||
}
|
||||
|
||||
private int memoizedSerializedSize = -1;
|
||||
public override int SerializedSize {
|
||||
get {
|
||||
int size = memoizedSerializedSize;
|
||||
if (size != -1) return size;
|
||||
|
||||
size = 0;
|
||||
if (HasD) {
|
||||
size += pb::CodedOutputStream.ComputeInt32Size(1, D);
|
||||
}
|
||||
size += UnknownFields.SerializedSize;
|
||||
memoizedSerializedSize = size;
|
||||
return size;
|
||||
}
|
||||
}
|
||||
|
||||
public static self::ImportMessage ParseFrom(pb::ByteString data) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
|
||||
}
|
||||
public static self::ImportMessage ParseFrom(pb::ByteString data,
|
||||
pb::ExtensionRegistry extensionRegistry) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
|
||||
.BuildParsed();
|
||||
}
|
||||
public static self::ImportMessage ParseFrom(byte[] data) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
|
||||
}
|
||||
public static self::ImportMessage parseFrom(byte[] data,
|
||||
pb::ExtensionRegistry extensionRegistry) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
|
||||
.BuildParsed();
|
||||
}
|
||||
public static self::ImportMessage ParseFrom(global::System.IO.Stream input) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
|
||||
}
|
||||
public static self::ImportMessage ParseFrom(
|
||||
global::System.IO.Stream input,
|
||||
pb::ExtensionRegistry extensionRegistry) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
|
||||
.BuildParsed();
|
||||
}
|
||||
public static self::ImportMessage ParseFrom(pb::CodedInputStream input) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
|
||||
}
|
||||
public static self::ImportMessage ParseFrom(pb::CodedInputStream input,
|
||||
pb::ExtensionRegistry extensionRegistry) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
|
||||
.BuildParsed();
|
||||
}
|
||||
|
||||
public static Builder CreateBuilder() { return new Builder(); }
|
||||
public override IBuilder<self::ImportMessage> CreateBuilderForType() { return new Builder(); }
|
||||
public static Builder CreateBuilder(self::ImportMessage prototype) {
|
||||
return (Builder) new Builder().MergeFrom(prototype);
|
||||
}
|
||||
|
||||
public sealed partial class Builder : pb::GeneratedBuilder<self::ImportMessage, Builder> {
|
||||
// Construct using self::ImportMessage.CreateBuilder()
|
||||
internal Builder() {}
|
||||
|
||||
self::ImportMessage result = new self::ImportMessage();
|
||||
|
||||
protected override self::ImportMessage MessageBeingBuilt {
|
||||
get { return result; }
|
||||
}
|
||||
|
||||
public override IBuilder<self::ImportMessage> Clear() {
|
||||
result = new self::ImportMessage();
|
||||
return this;
|
||||
}
|
||||
|
||||
public override IBuilder<self::ImportMessage> Clone() {
|
||||
return new Builder().MergeFrom(result);
|
||||
}
|
||||
|
||||
public override pbd::MessageDescriptor DescriptorForType {
|
||||
get { return self::ImportMessage.Descriptor; }
|
||||
}
|
||||
|
||||
public override self::ImportMessage DefaultInstanceForType {
|
||||
get { return self::ImportMessage.DefaultInstance; }
|
||||
}
|
||||
|
||||
public override self::ImportMessage BuildPartial() {
|
||||
self::ImportMessage returnMe = result;
|
||||
result = null;
|
||||
return returnMe;
|
||||
}
|
||||
|
||||
public override IBuilder MergeFrom(pb::IMessage other) {
|
||||
if (other is self::ImportMessage) {
|
||||
return MergeFrom((self::ImportMessage) other);
|
||||
} else {
|
||||
base.MergeFrom(other);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public override IBuilder<self::ImportMessage> MergeFrom(self::ImportMessage other) {
|
||||
if (other == self::ImportMessage.DefaultInstance) return this;
|
||||
if (other.HasD) {
|
||||
D = other.D;
|
||||
}
|
||||
this.MergeUnknownFields(other.UnknownFields);
|
||||
return this;
|
||||
}
|
||||
|
||||
public override IBuilder<self::ImportMessage> MergeFrom(pb::CodedInputStream input) {
|
||||
return MergeFrom(input, pb::ExtensionRegistry.Empty);
|
||||
}
|
||||
|
||||
public override IBuilder<self::ImportMessage> MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
|
||||
pb::UnknownFieldSet.Builder unknownFields =
|
||||
pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
|
||||
while (true) {
|
||||
uint tag = input.ReadTag();
|
||||
switch (tag) {
|
||||
case 0:
|
||||
this.UnknownFields = unknownFields.Build();
|
||||
return this;
|
||||
default: {
|
||||
if (!ParseUnknownField(input, unknownFields,
|
||||
extensionRegistry, tag)) {
|
||||
this.UnknownFields = unknownFields.Build();
|
||||
return this;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 8: {
|
||||
D = input.ReadInt32();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// optional int32 d = 1;
|
||||
public bool HasD {
|
||||
get { return result.HasD; }
|
||||
}
|
||||
public int D {
|
||||
get { return result.D; }
|
||||
set { SetD(value); }
|
||||
}
|
||||
public Builder SetD(int value) {
|
||||
result.hasD = true;
|
||||
result.d_ = value;
|
||||
return this;
|
||||
}
|
||||
public Builder ClearD() {
|
||||
result.hasD = false;
|
||||
result.d_ = 0;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Services
|
||||
#endregion
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,243 @@
|
|||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
|
||||
using pb = global::Google.ProtocolBuffers;
|
||||
using pbc = global::Google.ProtocolBuffers.Collections;
|
||||
using pbd = global::Google.ProtocolBuffers.Descriptors;
|
||||
using scg = global::System.Collections.Generic;
|
||||
using self = global::Google.ProtocolBuffers.TestProtos;
|
||||
|
||||
namespace Google.ProtocolBuffers.TestProtos {
|
||||
|
||||
public static partial class UnitTestOptimizeForProtoFile {
|
||||
|
||||
#region Descriptor
|
||||
public static pbd::FileDescriptor Descriptor {
|
||||
get { return descriptor; }
|
||||
}
|
||||
private static readonly pbd::FileDescriptor descriptor = pbd::FileDescriptor.InternalBuildGeneratedFileFrom (
|
||||
new byte[] {
|
||||
0x0a, 0x2b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x75, 0x6e,
|
||||
0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74,
|
||||
0x74, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
|
||||
0x66, 0x2f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9e, 0x01, 0x0a,
|
||||
0x14, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x64, 0x46, 0x6f, 0x72, 0x53, 0x69, 0x7a,
|
||||
0x65, 0x12, 0x09, 0x0a, 0x01, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x12, 0x2e, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18,
|
||||
0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69,
|
||||
0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x6f, 0x72, 0x65, 0x69, 0x67, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
|
||||
0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x32, 0x40, 0x0a, 0x0e, 0x74, 0x65, 0x73, 0x74, 0x5f,
|
||||
0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
|
||||
0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69,
|
||||
0x7a, 0x65, 0x64, 0x46, 0x6f, 0x72, 0x53, 0x69, 0x7a, 0x65, 0x18, 0xd2, 0x09, 0x20, 0x01, 0x28, 0x05, 0x42, 0x45, 0x48,
|
||||
0x02, 0xc2, 0x3e, 0x21, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x42,
|
||||
0x75, 0x66, 0x66, 0x65, 0x72, 0x73, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0xca, 0x3e, 0x1c,
|
||||
0x55, 0x6e, 0x69, 0x74, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x46, 0x6f, 0x72, 0x50,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x46, 0x69, 0x6c, 0x65,
|
||||
}, new pbd::FileDescriptor[] {
|
||||
self::UnitTestProtoFile.Descriptor,
|
||||
});
|
||||
#endregion
|
||||
|
||||
#region Extensions
|
||||
/**/
|
||||
#endregion
|
||||
|
||||
#region Static variables
|
||||
internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_TestOptimizedForSize__Descriptor
|
||||
= Descriptor.MessageTypes[0];
|
||||
internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestOptimizedForSize__FieldAccessorTable
|
||||
= new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestOptimizedForSize__Descriptor,
|
||||
new string[] { "I", "Msg", },
|
||||
typeof (self::TestOptimizedForSize),
|
||||
typeof (self::TestOptimizedForSize.Builder));
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
#region Enums
|
||||
#endregion
|
||||
|
||||
#region Messages
|
||||
public sealed partial class TestOptimizedForSize : pb::ExtendableMessage<TestOptimizedForSize, TestOptimizedForSize.Builder> {
|
||||
// Use TestOptimizedForSize.CreateBuilder() to construct.
|
||||
private TestOptimizedForSize() {}
|
||||
|
||||
private static readonly TestOptimizedForSize defaultInstance = new TestOptimizedForSize();
|
||||
public static TestOptimizedForSize DefaultInstance {
|
||||
get { return defaultInstance; }
|
||||
}
|
||||
|
||||
public override TestOptimizedForSize DefaultInstanceForType {
|
||||
get { return defaultInstance; }
|
||||
}
|
||||
|
||||
public static pbd::MessageDescriptor Descriptor {
|
||||
get { return self::UnitTestOptimizeForProtoFile.internal__static_protobuf_unittest_TestOptimizedForSize__Descriptor; }
|
||||
}
|
||||
|
||||
protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors {
|
||||
get { return self::UnitTestOptimizeForProtoFile.internal__static_protobuf_unittest_TestOptimizedForSize__FieldAccessorTable; }
|
||||
}
|
||||
|
||||
#region Nested types
|
||||
public static class Types {
|
||||
public static readonly pb::GeneratedExtension<self::TestOptimizedForSize, int> TestExtension =
|
||||
pb::GeneratedExtension.CreateExtension<self::TestOptimizedForSize, int>(Descriptor.Extensions[0]);
|
||||
}
|
||||
#endregion
|
||||
|
||||
// optional int32 i = 1;
|
||||
private bool hasI;
|
||||
private int i_ = 0;
|
||||
public bool HasI {
|
||||
get { return hasI; }
|
||||
}
|
||||
public int I {
|
||||
get { return i_; }
|
||||
}
|
||||
|
||||
// optional .protobuf_unittest.ForeignMessage msg = 19;
|
||||
private bool hasMsg;
|
||||
private self::ForeignMessage msg_ = self::ForeignMessage.DefaultInstance;
|
||||
public bool HasMsg {
|
||||
get { return hasMsg; }
|
||||
}
|
||||
public self::ForeignMessage Msg {
|
||||
get { return msg_; }
|
||||
}
|
||||
|
||||
public static self::TestOptimizedForSize ParseFrom(pb::ByteString data) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
|
||||
}
|
||||
public static self::TestOptimizedForSize ParseFrom(pb::ByteString data,
|
||||
pb::ExtensionRegistry extensionRegistry) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
|
||||
.BuildParsed();
|
||||
}
|
||||
public static self::TestOptimizedForSize ParseFrom(byte[] data) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
|
||||
}
|
||||
public static self::TestOptimizedForSize parseFrom(byte[] data,
|
||||
pb::ExtensionRegistry extensionRegistry) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
|
||||
.BuildParsed();
|
||||
}
|
||||
public static self::TestOptimizedForSize ParseFrom(global::System.IO.Stream input) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
|
||||
}
|
||||
public static self::TestOptimizedForSize ParseFrom(
|
||||
global::System.IO.Stream input,
|
||||
pb::ExtensionRegistry extensionRegistry) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
|
||||
.BuildParsed();
|
||||
}
|
||||
public static self::TestOptimizedForSize ParseFrom(pb::CodedInputStream input) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
|
||||
}
|
||||
public static self::TestOptimizedForSize ParseFrom(pb::CodedInputStream input,
|
||||
pb::ExtensionRegistry extensionRegistry) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
|
||||
.BuildParsed();
|
||||
}
|
||||
|
||||
public static Builder CreateBuilder() { return new Builder(); }
|
||||
public override IBuilder<self::TestOptimizedForSize> CreateBuilderForType() { return new Builder(); }
|
||||
public static Builder CreateBuilder(self::TestOptimizedForSize prototype) {
|
||||
return (Builder) new Builder().MergeFrom(prototype);
|
||||
}
|
||||
|
||||
public sealed partial class Builder : pb::GeneratedBuilder<self::TestOptimizedForSize, self::TestOptimizedForSize.Builder>.ExtendableBuilder {
|
||||
// Construct using self::TestOptimizedForSize.CreateBuilder()
|
||||
internal Builder() {}
|
||||
|
||||
self::TestOptimizedForSize result = new self::TestOptimizedForSize();
|
||||
|
||||
protected override self::TestOptimizedForSize MessageBeingBuilt {
|
||||
get { return result; }
|
||||
}
|
||||
|
||||
public override IBuilder<self::TestOptimizedForSize> Clear() {
|
||||
result = new self::TestOptimizedForSize();
|
||||
return this;
|
||||
}
|
||||
|
||||
public override IBuilder<self::TestOptimizedForSize> Clone() {
|
||||
return new Builder().MergeFrom(result);
|
||||
}
|
||||
|
||||
public override pbd::MessageDescriptor DescriptorForType {
|
||||
get { return self::TestOptimizedForSize.Descriptor; }
|
||||
}
|
||||
|
||||
public override self::TestOptimizedForSize DefaultInstanceForType {
|
||||
get { return self::TestOptimizedForSize.DefaultInstance; }
|
||||
}
|
||||
|
||||
public override self::TestOptimizedForSize BuildPartial() {
|
||||
self::TestOptimizedForSize returnMe = result;
|
||||
result = null;
|
||||
return returnMe;
|
||||
}
|
||||
|
||||
|
||||
// optional int32 i = 1;
|
||||
public bool HasI {
|
||||
get { return result.HasI; }
|
||||
}
|
||||
public int I {
|
||||
get { return result.I; }
|
||||
set { SetI(value); }
|
||||
}
|
||||
public Builder SetI(int value) {
|
||||
result.hasI = true;
|
||||
result.i_ = value;
|
||||
return this;
|
||||
}
|
||||
public Builder ClearI() {
|
||||
result.hasI = false;
|
||||
result.i_ = 0;
|
||||
return this;
|
||||
}
|
||||
|
||||
// optional .protobuf_unittest.ForeignMessage msg = 19;
|
||||
public bool HasMsg {
|
||||
get { return result.HasMsg; }
|
||||
}
|
||||
public self::ForeignMessage Msg {
|
||||
get { return result.Msg; }
|
||||
set { SetMsg(value); }
|
||||
}
|
||||
public Builder SetMsg(self::ForeignMessage value) {
|
||||
result.hasMsg = true;
|
||||
result.msg_ = value;
|
||||
return this;
|
||||
}
|
||||
public Builder SetMsg(self::ForeignMessage.Builder builderForValue) {
|
||||
result.hasMsg = true;
|
||||
result.msg_ = builderForValue.Build();
|
||||
return this;
|
||||
}
|
||||
public Builder MergeMsg(self::ForeignMessage value) {
|
||||
if (result.HasMsg &&
|
||||
result.msg_ != self::ForeignMessage.DefaultInstance) {
|
||||
result.msg_ =
|
||||
self::ForeignMessage.CreateBuilder(result.msg_).MergeFrom(value).BuildPartial();
|
||||
} else {
|
||||
result.msg_ = value;
|
||||
}
|
||||
result.hasMsg = true;
|
||||
return this;
|
||||
}
|
||||
public Builder ClearMsg() {
|
||||
result.hasMsg = false;
|
||||
result.msg_ = self::ForeignMessage.DefaultInstance;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Services
|
||||
#endregion
|
||||
}
|
13140
csharp/ProtocolBuffers.Test/TestProtos/UnitTestProtoFile.cs
Normal file
13140
csharp/ProtocolBuffers.Test/TestProtos/UnitTestProtoFile.cs
Normal file
File diff suppressed because it is too large
Load diff
32
csharp/ProtocolBuffers.Test/TestUtil.cs
Normal file
32
csharp/ProtocolBuffers.Test/TestUtil.cs
Normal file
|
@ -0,0 +1,32 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
|
||||
namespace Google.ProtocolBuffers {
|
||||
internal static class TestUtil {
|
||||
|
||||
private static DirectoryInfo testDataDirectory;
|
||||
|
||||
internal static DirectoryInfo TestDataDirectory {
|
||||
get {
|
||||
if (testDataDirectory != null) {
|
||||
return testDataDirectory;
|
||||
}
|
||||
|
||||
DirectoryInfo ancestor = new DirectoryInfo(".");
|
||||
// Search each parent directory looking for "src/google/protobuf".
|
||||
while (ancestor != null) {
|
||||
string candidate = Path.Combine(ancestor.FullName, "src/google/protobuf");
|
||||
if (Directory.Exists(candidate)) {
|
||||
testDataDirectory = new DirectoryInfo(candidate);
|
||||
return testDataDirectory;
|
||||
}
|
||||
ancestor = ancestor.Parent;
|
||||
}
|
||||
// TODO(jonskeet): Come up with a better exception to throw
|
||||
throw new Exception("Unable to find directory containing test files");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -142,6 +142,7 @@ namespace Google.ProtocolBuffers {
|
|||
/// Read a double field from the stream.
|
||||
/// </summary>
|
||||
public double ReadDouble() {
|
||||
// TODO(jonskeet): Test this on different endiannesses
|
||||
return BitConverter.Int64BitsToDouble((long) ReadRawLittleEndian64());
|
||||
}
|
||||
|
||||
|
@ -149,9 +150,10 @@ namespace Google.ProtocolBuffers {
|
|||
/// Read a float field from the stream.
|
||||
/// </summary>
|
||||
public float ReadFloat() {
|
||||
//return Float.intBitsToFloat(readRawLittleEndian32());
|
||||
// FIXME implement!
|
||||
throw new NotImplementedException();
|
||||
// TODO(jonskeet): Test this on different endiannesses
|
||||
uint raw = ReadRawLittleEndian32();
|
||||
byte[] rawBytes = BitConverter.GetBytes(raw);
|
||||
return BitConverter.ToSingle(rawBytes, 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -98,6 +98,7 @@ namespace Google.ProtocolBuffers {
|
|||
/// Writes a double field value, including tag, to the stream.
|
||||
/// </summary>
|
||||
public void WriteDouble(int fieldNumber, double value) {
|
||||
// TODO(jonskeet): Test this on different endiannesses
|
||||
WriteTag(fieldNumber, WireFormat.WireType.Fixed64);
|
||||
WriteRawLittleEndian64((ulong)BitConverter.DoubleToInt64Bits(value));
|
||||
}
|
||||
|
@ -107,8 +108,10 @@ namespace Google.ProtocolBuffers {
|
|||
/// </summary>
|
||||
public void WriteFloat(int fieldNumber, float value) {
|
||||
WriteTag(fieldNumber, WireFormat.WireType.Fixed32);
|
||||
// FIXME: How do we convert a single to 32 bits? (Without unsafe code)
|
||||
//WriteRawLittleEndian32(BitConverter.SingleT(value));
|
||||
// TODO(jonskeet): Test this on different endiannesses
|
||||
byte[] rawBytes = BitConverter.GetBytes(value);
|
||||
uint asInteger = BitConverter.ToUInt32(rawBytes, 0);
|
||||
WriteRawLittleEndian32(asInteger);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -434,7 +437,7 @@ namespace Google.ProtocolBuffers {
|
|||
/// Compute the number of bytes that would be needed to encode a
|
||||
/// fixed64 field, including the tag.
|
||||
/// </summary>
|
||||
public static int ComputeFixed64Size(int fieldNumber, long value) {
|
||||
public static int ComputeFixed64Size(int fieldNumber, ulong value) {
|
||||
return ComputeTagSize(fieldNumber) + LittleEndian64Size;
|
||||
}
|
||||
|
||||
|
@ -442,7 +445,7 @@ namespace Google.ProtocolBuffers {
|
|||
/// Compute the number of bytes that would be needed to encode a
|
||||
/// fixed32 field, including the tag.
|
||||
/// </summary>
|
||||
public static int ComputeFixed32Size(int fieldNumber, int value) {
|
||||
public static int ComputeFixed32Size(int fieldNumber, uint value) {
|
||||
return ComputeTagSize(fieldNumber) + LittleEndian32Size;
|
||||
}
|
||||
|
||||
|
@ -625,8 +628,8 @@ namespace Google.ProtocolBuffers {
|
|||
case FieldType.Int64: return ComputeInt64Size(fieldNumber, (long)value);
|
||||
case FieldType.UInt64: return ComputeUInt64Size(fieldNumber, (ulong)value);
|
||||
case FieldType.Int32: return ComputeInt32Size(fieldNumber, (int)value);
|
||||
case FieldType.Fixed64: return ComputeFixed64Size(fieldNumber, (long)value);
|
||||
case FieldType.Fixed32: return ComputeFixed32Size(fieldNumber, (int)value);
|
||||
case FieldType.Fixed64: return ComputeFixed64Size(fieldNumber, (ulong)value);
|
||||
case FieldType.Fixed32: return ComputeFixed32Size(fieldNumber, (uint)value);
|
||||
case FieldType.Bool: return ComputeBoolSize(fieldNumber, (bool)value);
|
||||
case FieldType.String: return ComputeStringSize(fieldNumber, (string)value);
|
||||
case FieldType.Group: return ComputeGroupSize(fieldNumber, (IMessage)value);
|
||||
|
|
|
@ -16,152 +16,152 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
|
|||
}
|
||||
private static readonly pbd::FileDescriptor descriptor = pbd::FileDescriptor.InternalBuildGeneratedFileFrom (
|
||||
new byte[] {
|
||||
0x0a, 0x24, 0x73, 0x72, 0x63, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
|
||||
0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f,
|
||||
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x22, 0xdc, 0x02, 0x0a, 0x13,
|
||||
0x46, 0x69, 0x6c, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12,
|
||||
0x0c, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x12, 0x0f, 0x0a, 0x07, 0x70, 0x61, 0x63,
|
||||
0x6b, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x12, 0x12, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64,
|
||||
0x65, 0x6e, 0x63, 0x79, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x12, 0x36, 0x0a, 0x0c, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
|
||||
0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
|
||||
0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f,
|
||||
0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x37, 0x0a, 0x09, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18,
|
||||
0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x12, 0x38, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b,
|
||||
0x32, 0x27, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53,
|
||||
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x12, 0x38, 0x0a, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b,
|
||||
0x32, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46,
|
||||
0x69, 0x65, 0x6c, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12,
|
||||
0x2d, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67,
|
||||
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f,
|
||||
0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xa9, 0x03, 0x0a, 0x0f, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f,
|
||||
0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
|
||||
0x12, 0x34, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f,
|
||||
0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x44,
|
||||
0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x38, 0x0a, 0x09, 0x65, 0x78,
|
||||
0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
|
||||
0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x44, 0x65, 0x73,
|
||||
0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x35, 0x0a, 0x0b, 0x6e, 0x65, 0x73, 0x74,
|
||||
0x65, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
|
||||
0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74,
|
||||
0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x37, 0x0a, 0x09, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x74, 0x79, 0x70, 0x65,
|
||||
0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x12, 0x48, 0x0a, 0x0f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x61,
|
||||
0x6e, 0x67, 0x65, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x30,
|
||||
0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x67, 0x6f,
|
||||
0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
|
||||
0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x2c, 0x0a, 0x0e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f,
|
||||
0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x0d, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x05, 0x12, 0x0b, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x22, 0x94, 0x05, 0x0a, 0x14, 0x46,
|
||||
0x69, 0x65, 0x6c, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12,
|
||||
0x0c, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x12, 0x0e, 0x0a, 0x06, 0x6e, 0x75, 0x6d,
|
||||
0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x12, 0x3a, 0x0a, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x04,
|
||||
0x20, 0x01, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
|
||||
0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x38, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20,
|
||||
0x01, 0x28, 0x0e, 0x32, 0x2a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
|
||||
0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x11, 0x0a, 0x09, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65,
|
||||
0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x12, 0x10, 0x0a, 0x08, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x65, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x09, 0x12, 0x15, 0x0a, 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75,
|
||||
0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x12, 0x2e, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x08,
|
||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
|
||||
0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xb6, 0x02, 0x0a, 0x04,
|
||||
0x54, 0x79, 0x70, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, 0x4f, 0x55, 0x42, 0x4c, 0x45, 0x10,
|
||||
0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x4c, 0x4f, 0x41, 0x54, 0x10, 0x02, 0x12, 0x0e, 0x0a,
|
||||
0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x10, 0x03, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50,
|
||||
0x45, 0x5f, 0x55, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x10, 0x04, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49,
|
||||
0x4e, 0x54, 0x33, 0x32, 0x10, 0x05, 0x12, 0x10, 0x0a, 0x0c, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x58, 0x45, 0x44,
|
||||
0x36, 0x34, 0x10, 0x06, 0x12, 0x10, 0x0a, 0x0c, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x58, 0x45, 0x44, 0x33, 0x32,
|
||||
0x10, 0x07, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x4f, 0x4f, 0x4c, 0x10, 0x08, 0x12, 0x0f, 0x0a,
|
||||
0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x09, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x59,
|
||||
0x50, 0x45, 0x5f, 0x47, 0x52, 0x4f, 0x55, 0x50, 0x10, 0x0a, 0x12, 0x10, 0x0a, 0x0c, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d,
|
||||
0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x10, 0x0b, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x59, 0x54,
|
||||
0x45, 0x53, 0x10, 0x0c, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x49, 0x4e, 0x54, 0x33, 0x32, 0x10,
|
||||
0x0d, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x4e, 0x55, 0x4d, 0x10, 0x0e, 0x12, 0x11, 0x0a, 0x0d,
|
||||
0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x46, 0x49, 0x58, 0x45, 0x44, 0x33, 0x32, 0x10, 0x14, 0x12, 0x11, 0x0a, 0x0d, 0x54,
|
||||
0x59, 0x50, 0x45, 0x5f, 0x53, 0x46, 0x49, 0x58, 0x45, 0x44, 0x36, 0x34, 0x10, 0x10, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59,
|
||||
0x50, 0x45, 0x5f, 0x53, 0x49, 0x4e, 0x54, 0x33, 0x32, 0x10, 0x11, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f,
|
||||
0x53, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x10, 0x12, 0x22, 0x43, 0x0a, 0x05, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x12, 0x0a,
|
||||
0x0e, 0x4c, 0x41, 0x42, 0x45, 0x4c, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x12, 0x0a,
|
||||
0x0e, 0x4c, 0x41, 0x42, 0x45, 0x4c, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x49, 0x52, 0x45, 0x44, 0x10, 0x02, 0x12, 0x12, 0x0a,
|
||||
0x0e, 0x4c, 0x41, 0x42, 0x45, 0x4c, 0x5f, 0x52, 0x45, 0x50, 0x45, 0x41, 0x54, 0x45, 0x44, 0x10, 0x03, 0x22, 0x8c, 0x01,
|
||||
0x0a, 0x13, 0x45, 0x6e, 0x75, 0x6d, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x12, 0x0c, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x12, 0x38, 0x0a, 0x05, 0x76,
|
||||
0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x44, 0x65,
|
||||
0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x2d, 0x0a, 0x07, 0x6f, 0x70, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73,
|
||||
0x22, 0x6c, 0x0a, 0x18, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70,
|
||||
0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x09, 0x12, 0x0e, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x12, 0x32,
|
||||
0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6f,
|
||||
0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61,
|
||||
0x6c, 0x75, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x90, 0x01, 0x0a, 0x16, 0x53, 0x65, 0x72, 0x76, 0x69,
|
||||
0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x0a,
|
||||
0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x12, 0x36, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f,
|
||||
0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74,
|
||||
0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x30, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03,
|
||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
|
||||
0x75, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x7f, 0x0a,
|
||||
0x15, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x12, 0x0c, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x12, 0x12, 0x0a, 0x0a,
|
||||
0x69, 0x6e, 0x70, 0x75, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x12, 0x13, 0x0a, 0x0b,
|
||||
0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x12, 0x2f, 0x0a,
|
||||
0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x6f, 0x6f,
|
||||
0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f,
|
||||
0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x88, 0x03, 0x0a, 0x0b, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x73, 0x12, 0x14, 0x0a, 0x0c, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x09, 0x12, 0x1c, 0x0a, 0x14, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x5f, 0x63,
|
||||
0x6c, 0x61, 0x73, 0x73, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x12, 0x22, 0x0a, 0x13, 0x6a, 0x61,
|
||||
0x76, 0x61, 0x5f, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x0a, 0x20,
|
||||
0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x12, 0x4a, 0x0a, 0x0c, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x69,
|
||||
0x7a, 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
|
||||
0x0a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65,
|
||||
0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x67, 0x6f, 0x6f, 0x67,
|
||||
0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x22, 0xdc, 0x02, 0x0a, 0x13, 0x46, 0x69, 0x6c, 0x65,
|
||||
0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x0a, 0x04, 0x6e,
|
||||
0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x12, 0x0f, 0x0a, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65,
|
||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x12, 0x12, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79,
|
||||
0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x12, 0x36, 0x0a, 0x0c, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x79,
|
||||
0x70, 0x65, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x12, 0x37, 0x0a, 0x09, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x03, 0x28,
|
||||
0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
|
||||
0x45, 0x6e, 0x75, 0x6d, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12,
|
||||
0x38, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x67,
|
||||
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69,
|
||||
0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x38, 0x0a,
|
||||
0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67,
|
||||
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64,
|
||||
0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x2d, 0x0a, 0x07, 0x6f,
|
||||
0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
|
||||
0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x73, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x3a, 0x09, 0x43, 0x4f, 0x44,
|
||||
0x45, 0x5f, 0x53, 0x49, 0x5a, 0x45, 0x12, 0x19, 0x0a, 0x10, 0x63, 0x73, 0x68, 0x61, 0x72, 0x70, 0x5f, 0x6e, 0x61, 0x6d,
|
||||
0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0xe8, 0x07, 0x20, 0x01, 0x28, 0x09, 0x12, 0x1e, 0x0a, 0x15, 0x63, 0x73, 0x68,
|
||||
0x61, 0x72, 0x70, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0xe9,
|
||||
0x07, 0x20, 0x01, 0x28, 0x09, 0x12, 0x25, 0x0a, 0x15, 0x63, 0x73, 0x68, 0x61, 0x72, 0x70, 0x5f, 0x6d, 0x75, 0x6c, 0x74,
|
||||
0x69, 0x70, 0x6c, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0xea, 0x07, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66,
|
||||
0x61, 0x6c, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x13, 0x63, 0x73, 0x68, 0x61, 0x72, 0x70, 0x5f, 0x6e, 0x65, 0x73, 0x74, 0x5f,
|
||||
0x63, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x18, 0xeb, 0x07, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73,
|
||||
0x65, 0x12, 0x24, 0x0a, 0x15, 0x63, 0x73, 0x68, 0x61, 0x72, 0x70, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x63,
|
||||
0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x18, 0xec, 0x07, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x04, 0x74, 0x72, 0x75, 0x65, 0x22,
|
||||
0x28, 0x0a, 0x0c, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x53,
|
||||
0x50, 0x45, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x53, 0x49, 0x5a, 0x45, 0x10,
|
||||
0x02, 0x22, 0x38, 0x0a, 0x0e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12,
|
||||
0x26, 0x0a, 0x17, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x65, 0x74, 0x5f, 0x77, 0x69, 0x72, 0x65, 0x5f,
|
||||
0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x22,
|
||||
0x85, 0x01, 0x0a, 0x0c, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x32, 0x0a, 0x05,
|
||||
0x63, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x73, 0x2e, 0x43, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x14, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65,
|
||||
0x6e, 0x74, 0x61, 0x6c, 0x5f, 0x6d, 0x61, 0x70, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x22, 0x23,
|
||||
0x0a, 0x05, 0x43, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x43, 0x4f, 0x52, 0x44, 0x10, 0x01, 0x12, 0x10, 0x0a,
|
||||
0x0c, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x50, 0x49, 0x45, 0x43, 0x45, 0x10, 0x02, 0x22, 0x0d, 0x0a, 0x0b, 0x45,
|
||||
0x6e, 0x75, 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x12, 0x0a, 0x10, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61,
|
||||
0x6c, 0x75, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x10, 0x0a, 0x0e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
|
||||
0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x0f, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x72, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x42, 0x10, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72,
|
||||
0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x48, 0x01, 0xc2, 0x3e, 0x27, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x73, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69,
|
||||
0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0xca, 0x3e, 0x13, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70,
|
||||
0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x46, 0x69, 0x6c, 0x65, 0xd0, 0x3e, 0x00, 0xd8, 0x3e, 0x00, 0xe0, 0x3e,
|
||||
0x01,
|
||||
0x6e, 0x73, 0x22, 0xa9, 0x03, 0x0a, 0x0f, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x12, 0x0c, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x12, 0x34, 0x0a, 0x05,
|
||||
0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72,
|
||||
0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x38, 0x0a, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73,
|
||||
0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70,
|
||||
0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x35, 0x0a, 0x0b, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x74,
|
||||
0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x12, 0x37, 0x0a, 0x09, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x03,
|
||||
0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
|
||||
0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x12, 0x48, 0x0a, 0x0f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18,
|
||||
0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x62, 0x75, 0x66, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e,
|
||||
0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x30, 0x0a, 0x07, 0x6f, 0x70,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x2c, 0x0a, 0x0e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x6e,
|
||||
0x67, 0x65, 0x12, 0x0d, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x12, 0x0b, 0x0a,
|
||||
0x03, 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x22, 0x94, 0x05, 0x0a, 0x14, 0x46, 0x69, 0x65, 0x6c, 0x64,
|
||||
0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x0a, 0x04, 0x6e,
|
||||
0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x12, 0x0e, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18,
|
||||
0x03, 0x20, 0x01, 0x28, 0x05, 0x12, 0x3a, 0x0a, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e,
|
||||
0x32, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46,
|
||||
0x69, 0x65, 0x6c, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e,
|
||||
0x4c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x38, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32,
|
||||
0x2a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69,
|
||||
0x65, 0x6c, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x54,
|
||||
0x79, 0x70, 0x65, 0x12, 0x11, 0x0a, 0x09, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01,
|
||||
0x28, 0x09, 0x12, 0x10, 0x0a, 0x08, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
|
||||
0x12, 0x15, 0x0a, 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x07, 0x20,
|
||||
0x01, 0x28, 0x09, 0x12, 0x2e, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b,
|
||||
0x32, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46,
|
||||
0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xb6, 0x02, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65,
|
||||
0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, 0x4f, 0x55, 0x42, 0x4c, 0x45, 0x10, 0x01, 0x12, 0x0e, 0x0a,
|
||||
0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x4c, 0x4f, 0x41, 0x54, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50,
|
||||
0x45, 0x5f, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x10, 0x03, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x49,
|
||||
0x4e, 0x54, 0x36, 0x34, 0x10, 0x04, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4e, 0x54, 0x33, 0x32,
|
||||
0x10, 0x05, 0x12, 0x10, 0x0a, 0x0c, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x58, 0x45, 0x44, 0x36, 0x34, 0x10, 0x06,
|
||||
0x12, 0x10, 0x0a, 0x0c, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x58, 0x45, 0x44, 0x33, 0x32, 0x10, 0x07, 0x12, 0x0d,
|
||||
0x0a, 0x09, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x4f, 0x4f, 0x4c, 0x10, 0x08, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50,
|
||||
0x45, 0x5f, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x09, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x47,
|
||||
0x52, 0x4f, 0x55, 0x50, 0x10, 0x0a, 0x12, 0x10, 0x0a, 0x0c, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x45, 0x53, 0x53, 0x41,
|
||||
0x47, 0x45, 0x10, 0x0b, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x59, 0x54, 0x45, 0x53, 0x10, 0x0c,
|
||||
0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x49, 0x4e, 0x54, 0x33, 0x32, 0x10, 0x0d, 0x12, 0x0d, 0x0a,
|
||||
0x09, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x4e, 0x55, 0x4d, 0x10, 0x0e, 0x12, 0x11, 0x0a, 0x0d, 0x54, 0x59, 0x50, 0x45,
|
||||
0x5f, 0x53, 0x46, 0x49, 0x58, 0x45, 0x44, 0x33, 0x32, 0x10, 0x0f, 0x12, 0x11, 0x0a, 0x0d, 0x54, 0x59, 0x50, 0x45, 0x5f,
|
||||
0x53, 0x46, 0x49, 0x58, 0x45, 0x44, 0x36, 0x34, 0x10, 0x10, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53,
|
||||
0x49, 0x4e, 0x54, 0x33, 0x32, 0x10, 0x11, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x49, 0x4e, 0x54,
|
||||
0x36, 0x34, 0x10, 0x12, 0x22, 0x43, 0x0a, 0x05, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x12, 0x0a, 0x0e, 0x4c, 0x41, 0x42,
|
||||
0x45, 0x4c, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x4c, 0x41, 0x42,
|
||||
0x45, 0x4c, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x49, 0x52, 0x45, 0x44, 0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e, 0x4c, 0x41, 0x42,
|
||||
0x45, 0x4c, 0x5f, 0x52, 0x45, 0x50, 0x45, 0x41, 0x54, 0x45, 0x44, 0x10, 0x03, 0x22, 0x8c, 0x01, 0x0a, 0x13, 0x45, 0x6e,
|
||||
0x75, 0x6d, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x0a,
|
||||
0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x12, 0x38, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
|
||||
0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69,
|
||||
0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x2d, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73,
|
||||
0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x6c, 0x0a, 0x18,
|
||||
0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x12, 0x0e,
|
||||
0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x12, 0x32, 0x0a, 0x07, 0x6f, 0x70,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f,
|
||||
0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x90, 0x01, 0x0a, 0x16, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x44, 0x65,
|
||||
0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x0a, 0x04, 0x6e, 0x61, 0x6d,
|
||||
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x12, 0x36, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x02, 0x20,
|
||||
0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
|
||||
0x66, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x12, 0x30, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b,
|
||||
0x32, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53,
|
||||
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x7f, 0x0a, 0x15, 0x4d, 0x65, 0x74,
|
||||
0x68, 0x6f, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c,
|
||||
0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x12, 0x12, 0x0a, 0x0a, 0x69, 0x6e, 0x70, 0x75,
|
||||
0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x12, 0x13, 0x0a, 0x0b, 0x6f, 0x75, 0x74, 0x70,
|
||||
0x75, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x12, 0x2f, 0x0a, 0x07, 0x6f, 0x70, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x73, 0x22, 0x88, 0x03, 0x0a, 0x0b, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x14,
|
||||
0x0a, 0x0c, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
|
||||
0x12, 0x1c, 0x0a, 0x14, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73,
|
||||
0x6e, 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x12, 0x22, 0x0a, 0x13, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x6d,
|
||||
0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x3a,
|
||||
0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x12, 0x4a, 0x0a, 0x0c, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x5f, 0x66,
|
||||
0x6f, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x4f,
|
||||
0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x3a, 0x09, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x53, 0x49,
|
||||
0x5a, 0x45, 0x12, 0x19, 0x0a, 0x10, 0x63, 0x73, 0x68, 0x61, 0x72, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61,
|
||||
0x63, 0x65, 0x18, 0xe8, 0x07, 0x20, 0x01, 0x28, 0x09, 0x12, 0x1e, 0x0a, 0x15, 0x63, 0x73, 0x68, 0x61, 0x72, 0x70, 0x5f,
|
||||
0x66, 0x69, 0x6c, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0xe9, 0x07, 0x20, 0x01, 0x28,
|
||||
0x09, 0x12, 0x25, 0x0a, 0x15, 0x63, 0x73, 0x68, 0x61, 0x72, 0x70, 0x5f, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65,
|
||||
0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0xea, 0x07, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65,
|
||||
0x12, 0x23, 0x0a, 0x13, 0x63, 0x73, 0x68, 0x61, 0x72, 0x70, 0x5f, 0x6e, 0x65, 0x73, 0x74, 0x5f, 0x63, 0x6c, 0x61, 0x73,
|
||||
0x73, 0x65, 0x73, 0x18, 0xeb, 0x07, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x12, 0x24, 0x0a,
|
||||
0x15, 0x63, 0x73, 0x68, 0x61, 0x72, 0x70, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73,
|
||||
0x65, 0x73, 0x18, 0xec, 0x07, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x04, 0x74, 0x72, 0x75, 0x65, 0x22, 0x28, 0x0a, 0x0c, 0x4f,
|
||||
0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x50, 0x45, 0x45, 0x44,
|
||||
0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x53, 0x49, 0x5a, 0x45, 0x10, 0x02, 0x22, 0x38, 0x0a,
|
||||
0x0e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x26, 0x0a, 0x17, 0x6d,
|
||||
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x65, 0x74, 0x5f, 0x77, 0x69, 0x72, 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x6d,
|
||||
0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x22, 0x85, 0x01, 0x0a, 0x0c,
|
||||
0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x32, 0x0a, 0x05, 0x63, 0x74, 0x79, 0x70,
|
||||
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x43,
|
||||
0x54, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x14, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c,
|
||||
0x5f, 0x6d, 0x61, 0x70, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x22, 0x23, 0x0a, 0x05, 0x43, 0x54,
|
||||
0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x43, 0x4f, 0x52, 0x44, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x54, 0x52,
|
||||
0x49, 0x4e, 0x47, 0x5f, 0x50, 0x49, 0x45, 0x43, 0x45, 0x10, 0x02, 0x22, 0x0d, 0x0a, 0x0b, 0x45, 0x6e, 0x75, 0x6d, 0x4f,
|
||||
0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x12, 0x0a, 0x10, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f,
|
||||
0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x10, 0x0a, 0x0e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x73, 0x22, 0x0f, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e,
|
||||
0x73, 0x42, 0x72, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x62, 0x75, 0x66, 0x42, 0x10, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x73, 0x48, 0x01, 0xc2, 0x3e, 0x27, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63,
|
||||
0x6f, 0x6c, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x73, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72,
|
||||
0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0xca, 0x3e, 0x13, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x46, 0x69, 0x6c, 0x65, 0xd0, 0x3e, 0x00, 0xd8, 0x3e, 0x00, 0xe0, 0x3e, 0x01,
|
||||
}, new pbd::FileDescriptor[] {
|
||||
});
|
||||
#endregion
|
||||
|
||||
#region Extensions
|
||||
/**/
|
||||
#endregion
|
||||
|
||||
#region Static variables
|
||||
|
@ -295,7 +295,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
|
|||
get { return self::DescriptorProtoFile.internal__static_google_protobuf_FileDescriptorProto__Descriptor; }
|
||||
}
|
||||
|
||||
protected internal override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors {
|
||||
protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors {
|
||||
get { return self::DescriptorProtoFile.internal__static_google_protobuf_FileDescriptorProto__FieldAccessorTable; }
|
||||
}
|
||||
|
||||
|
@ -973,7 +973,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
|
|||
get { return self::DescriptorProtoFile.internal__static_google_protobuf_DescriptorProto__Descriptor; }
|
||||
}
|
||||
|
||||
protected internal override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors {
|
||||
protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors {
|
||||
get { return self::DescriptorProtoFile.internal__static_google_protobuf_DescriptorProto__FieldAccessorTable; }
|
||||
}
|
||||
|
||||
|
@ -996,7 +996,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
|
|||
get { return self::DescriptorProtoFile.internal__static_google_protobuf_DescriptorProto_ExtensionRange__Descriptor; }
|
||||
}
|
||||
|
||||
protected internal override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors {
|
||||
protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors {
|
||||
get { return self::DescriptorProtoFile.internal__static_google_protobuf_DescriptorProto_ExtensionRange__FieldAccessorTable; }
|
||||
}
|
||||
|
||||
|
@ -1872,57 +1872,36 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
|
|||
get { return self::DescriptorProtoFile.internal__static_google_protobuf_FieldDescriptorProto__Descriptor; }
|
||||
}
|
||||
|
||||
protected internal override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors {
|
||||
protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors {
|
||||
get { return self::DescriptorProtoFile.internal__static_google_protobuf_FieldDescriptorProto__FieldAccessorTable; }
|
||||
}
|
||||
|
||||
#region Nested types
|
||||
public static class Types {
|
||||
public enum Type {
|
||||
[pbd::EnumDescriptorIndex(0)]
|
||||
TYPE_DOUBLE = 1,
|
||||
[pbd::EnumDescriptorIndex(1)]
|
||||
TYPE_FLOAT = 2,
|
||||
[pbd::EnumDescriptorIndex(2)]
|
||||
TYPE_INT64 = 3,
|
||||
[pbd::EnumDescriptorIndex(3)]
|
||||
TYPE_UINT64 = 4,
|
||||
[pbd::EnumDescriptorIndex(4)]
|
||||
TYPE_INT32 = 5,
|
||||
[pbd::EnumDescriptorIndex(5)]
|
||||
TYPE_FIXED64 = 6,
|
||||
[pbd::EnumDescriptorIndex(6)]
|
||||
TYPE_FIXED32 = 7,
|
||||
[pbd::EnumDescriptorIndex(7)]
|
||||
TYPE_BOOL = 8,
|
||||
[pbd::EnumDescriptorIndex(8)]
|
||||
TYPE_STRING = 9,
|
||||
[pbd::EnumDescriptorIndex(9)]
|
||||
TYPE_GROUP = 10,
|
||||
[pbd::EnumDescriptorIndex(10)]
|
||||
TYPE_MESSAGE = 11,
|
||||
[pbd::EnumDescriptorIndex(11)]
|
||||
TYPE_BYTES = 12,
|
||||
[pbd::EnumDescriptorIndex(12)]
|
||||
TYPE_UINT32 = 13,
|
||||
[pbd::EnumDescriptorIndex(13)]
|
||||
TYPE_ENUM = 14,
|
||||
[pbd::EnumDescriptorIndex(14)]
|
||||
TYPE_SFIXED32 = 20,
|
||||
[pbd::EnumDescriptorIndex(15)]
|
||||
TYPE_SFIXED32 = 15,
|
||||
TYPE_SFIXED64 = 16,
|
||||
[pbd::EnumDescriptorIndex(16)]
|
||||
TYPE_SINT32 = 17,
|
||||
[pbd::EnumDescriptorIndex(17)]
|
||||
TYPE_SINT64 = 18,
|
||||
}
|
||||
|
||||
public enum Label {
|
||||
[pbd::EnumDescriptorIndex(0)]
|
||||
LABEL_OPTIONAL = 1,
|
||||
[pbd::EnumDescriptorIndex(1)]
|
||||
LABEL_REQUIRED = 2,
|
||||
[pbd::EnumDescriptorIndex(2)]
|
||||
LABEL_REPEATED = 3,
|
||||
}
|
||||
|
||||
|
@ -2450,7 +2429,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
|
|||
get { return self::DescriptorProtoFile.internal__static_google_protobuf_EnumDescriptorProto__Descriptor; }
|
||||
}
|
||||
|
||||
protected internal override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors {
|
||||
protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors {
|
||||
get { return self::DescriptorProtoFile.internal__static_google_protobuf_EnumDescriptorProto__FieldAccessorTable; }
|
||||
}
|
||||
|
||||
|
@ -2792,7 +2771,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
|
|||
get { return self::DescriptorProtoFile.internal__static_google_protobuf_EnumValueDescriptorProto__Descriptor; }
|
||||
}
|
||||
|
||||
protected internal override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors {
|
||||
protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors {
|
||||
get { return self::DescriptorProtoFile.internal__static_google_protobuf_EnumValueDescriptorProto__FieldAccessorTable; }
|
||||
}
|
||||
|
||||
|
@ -3099,7 +3078,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
|
|||
get { return self::DescriptorProtoFile.internal__static_google_protobuf_ServiceDescriptorProto__Descriptor; }
|
||||
}
|
||||
|
||||
protected internal override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors {
|
||||
protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors {
|
||||
get { return self::DescriptorProtoFile.internal__static_google_protobuf_ServiceDescriptorProto__FieldAccessorTable; }
|
||||
}
|
||||
|
||||
|
@ -3441,7 +3420,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
|
|||
get { return self::DescriptorProtoFile.internal__static_google_protobuf_MethodDescriptorProto__Descriptor; }
|
||||
}
|
||||
|
||||
protected internal override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors {
|
||||
protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors {
|
||||
get { return self::DescriptorProtoFile.internal__static_google_protobuf_MethodDescriptorProto__FieldAccessorTable; }
|
||||
}
|
||||
|
||||
|
@ -3790,16 +3769,14 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
|
|||
get { return self::DescriptorProtoFile.internal__static_google_protobuf_FileOptions__Descriptor; }
|
||||
}
|
||||
|
||||
protected internal override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors {
|
||||
protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors {
|
||||
get { return self::DescriptorProtoFile.internal__static_google_protobuf_FileOptions__FieldAccessorTable; }
|
||||
}
|
||||
|
||||
#region Nested types
|
||||
public static class Types {
|
||||
public enum OptimizeMode {
|
||||
[pbd::EnumDescriptorIndex(0)]
|
||||
SPEED = 1,
|
||||
[pbd::EnumDescriptorIndex(1)]
|
||||
CODE_SIZE = 2,
|
||||
}
|
||||
|
||||
|
@ -4344,7 +4321,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
|
|||
get { return self::DescriptorProtoFile.internal__static_google_protobuf_MessageOptions__Descriptor; }
|
||||
}
|
||||
|
||||
protected internal override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors {
|
||||
protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors {
|
||||
get { return self::DescriptorProtoFile.internal__static_google_protobuf_MessageOptions__FieldAccessorTable; }
|
||||
}
|
||||
|
||||
|
@ -4546,16 +4523,14 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
|
|||
get { return self::DescriptorProtoFile.internal__static_google_protobuf_FieldOptions__Descriptor; }
|
||||
}
|
||||
|
||||
protected internal override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors {
|
||||
protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors {
|
||||
get { return self::DescriptorProtoFile.internal__static_google_protobuf_FieldOptions__FieldAccessorTable; }
|
||||
}
|
||||
|
||||
#region Nested types
|
||||
public static class Types {
|
||||
public enum CType {
|
||||
[pbd::EnumDescriptorIndex(0)]
|
||||
CORD = 1,
|
||||
[pbd::EnumDescriptorIndex(1)]
|
||||
STRING_PIECE = 2,
|
||||
}
|
||||
|
||||
|
@ -4806,7 +4781,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
|
|||
get { return self::DescriptorProtoFile.internal__static_google_protobuf_EnumOptions__Descriptor; }
|
||||
}
|
||||
|
||||
protected internal override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors {
|
||||
protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors {
|
||||
get { return self::DescriptorProtoFile.internal__static_google_protobuf_EnumOptions__FieldAccessorTable; }
|
||||
}
|
||||
|
||||
|
@ -4966,7 +4941,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
|
|||
get { return self::DescriptorProtoFile.internal__static_google_protobuf_EnumValueOptions__Descriptor; }
|
||||
}
|
||||
|
||||
protected internal override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors {
|
||||
protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors {
|
||||
get { return self::DescriptorProtoFile.internal__static_google_protobuf_EnumValueOptions__FieldAccessorTable; }
|
||||
}
|
||||
|
||||
|
@ -5126,7 +5101,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
|
|||
get { return self::DescriptorProtoFile.internal__static_google_protobuf_ServiceOptions__Descriptor; }
|
||||
}
|
||||
|
||||
protected internal override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors {
|
||||
protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors {
|
||||
get { return self::DescriptorProtoFile.internal__static_google_protobuf_ServiceOptions__FieldAccessorTable; }
|
||||
}
|
||||
|
||||
|
@ -5286,7 +5261,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
|
|||
get { return self::DescriptorProtoFile.internal__static_google_protobuf_MethodOptions__Descriptor; }
|
||||
}
|
||||
|
||||
protected internal override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors {
|
||||
protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors {
|
||||
get { return self::DescriptorProtoFile.internal__static_google_protobuf_MethodOptions__FieldAccessorTable; }
|
||||
}
|
||||
|
||||
|
|
|
@ -3,9 +3,10 @@
|
|||
namespace Google.ProtocolBuffers.Descriptors {
|
||||
/// <summary>
|
||||
/// Allows enum values to express the index within their descriptor.
|
||||
/// TODO(jonskeet): Consider removing this. I don't think we need it after all.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Field)]
|
||||
internal class EnumDescriptorIndexAttribute : Attribute {
|
||||
public class EnumDescriptorIndexAttribute : Attribute {
|
||||
readonly int index;
|
||||
|
||||
internal int Index {
|
||||
|
|
11
csharp/ProtocolBuffers/DynamicMessage.cs
Normal file
11
csharp/ProtocolBuffers/DynamicMessage.cs
Normal file
|
@ -0,0 +1,11 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Google.ProtocolBuffers {
|
||||
public class DynamicMessage {
|
||||
internal static object GetDefaultInstance(Google.ProtocolBuffers.Descriptors.MessageDescriptor messageDescriptor) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
165
csharp/ProtocolBuffers/ExtendableMessage.cs
Normal file
165
csharp/ProtocolBuffers/ExtendableMessage.cs
Normal file
|
@ -0,0 +1,165 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Google.ProtocolBuffers.Descriptors;
|
||||
using Google.ProtocolBuffers.Collections;
|
||||
|
||||
namespace Google.ProtocolBuffers {
|
||||
public abstract class ExtendableMessage<TMessage,TBuilder> : GeneratedMessage<TMessage,TBuilder>
|
||||
where TMessage : GeneratedMessage<TMessage, TBuilder>
|
||||
where TBuilder : IBuilder<TMessage> {
|
||||
|
||||
protected ExtendableMessage() {}
|
||||
private readonly FieldSet extensions = FieldSet.CreateFieldSet();
|
||||
|
||||
/// <summary>
|
||||
/// Checks if a singular extension is present.
|
||||
/// </summary>
|
||||
public bool HasExtension(GeneratedExtension<TMessage, TBuilder> extension) {
|
||||
return extensions.HasField(extension.Descriptor);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the number of elements in a repeated extension.
|
||||
/// </summary>
|
||||
public int GetExtensionCount<TExtension>(GeneratedExtension<TMessage, IList<TExtension>> extension) {
|
||||
return extensions.GetRepeatedFieldCount(extension.Descriptor);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the value of an extension.
|
||||
/// </summary>
|
||||
public TExtension GetExtension<TExtension>(GeneratedExtension<TMessage, TExtension> extension) {
|
||||
object value = extensions[extension.Descriptor];
|
||||
if (value == null) {
|
||||
return (TExtension) extension.MessageDefaultInstance;
|
||||
} else {
|
||||
return (TExtension) extension.FromReflectionType(value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns one element of a repeated extension.
|
||||
/// </summary>
|
||||
public TExtension GetExtension<TExtension>(GeneratedExtension<TMessage, IList<TExtension>> extension, int index) {
|
||||
return (TExtension) extension.SingularFromReflectionType(extensions[extension.Descriptor, index]);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called by subclasses to check if all extensions are initialized.
|
||||
/// </summary>
|
||||
protected bool ExtensionsAreInitialized {
|
||||
get { return extensions.IsInitialized; }
|
||||
}
|
||||
|
||||
#region Reflection
|
||||
public override IDictionary<FieldDescriptor, object> AllFields {
|
||||
get {
|
||||
IDictionary<FieldDescriptor, object> result = GetMutableFieldMap();
|
||||
foreach(KeyValuePair<FieldDescriptor, object> entry in extensions.AllFields) {
|
||||
result[entry.Key] = entry.Value;
|
||||
}
|
||||
return Dictionaries.AsReadOnly(result);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool HasField(FieldDescriptor field) {
|
||||
if (field.IsExtension) {
|
||||
VerifyContainingType(field);
|
||||
return extensions.HasField(field);
|
||||
} else {
|
||||
return base.HasField(field);
|
||||
}
|
||||
}
|
||||
|
||||
public override object this[FieldDescriptor field] {
|
||||
get {
|
||||
if (field.IsExtension) {
|
||||
VerifyContainingType(field);
|
||||
object value = extensions[field];
|
||||
if (value == null) {
|
||||
// Lacking an ExtensionRegistry, we have no way to determine the
|
||||
// extension's real type, so we return a DynamicMessage.
|
||||
// TODO(jonskeet): Work out what this means
|
||||
return DynamicMessage.GetDefaultInstance(field.MessageType);
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
} else {
|
||||
return base[field];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override int GetRepeatedFieldCount(FieldDescriptor field) {
|
||||
if (field.IsExtension) {
|
||||
VerifyContainingType(field);
|
||||
return extensions.GetRepeatedFieldCount(field);
|
||||
} else {
|
||||
return base.GetRepeatedFieldCount(field);
|
||||
}
|
||||
}
|
||||
|
||||
public override object this[FieldDescriptor field, int index] {
|
||||
get {
|
||||
if (field.IsExtension) {
|
||||
VerifyContainingType(field);
|
||||
return extensions[field, index];
|
||||
} else {
|
||||
return base[field, index];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void VerifyContainingType(FieldDescriptor field) {
|
||||
if (field.ContainingType != DescriptorForType) {
|
||||
throw new ArgumentException("FieldDescriptor does not match message type.");
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Used by subclasses to serialize extensions. Extension ranges may be
|
||||
/// interleaves with field numbers, but we must write them in canonical
|
||||
/// (sorted by field number) order. This class helps us to write individual
|
||||
/// ranges of extensions at once.
|
||||
///
|
||||
/// TODO(jonskeet): See if we can improve this in terms of readability.
|
||||
/// </summary>
|
||||
protected class ExtensionWriter {
|
||||
readonly IEnumerator<KeyValuePair<FieldDescriptor, object>> iterator;
|
||||
readonly FieldSet extensions;
|
||||
KeyValuePair<FieldDescriptor, object>? next = null;
|
||||
|
||||
internal ExtensionWriter(ExtendableMessage<TMessage, TBuilder> message) {
|
||||
extensions = message.extensions;
|
||||
iterator = message.extensions.GetEnumerator();
|
||||
if (iterator.MoveNext()) {
|
||||
next = iterator.Current;
|
||||
}
|
||||
}
|
||||
|
||||
public void WriteUntil(int end, CodedOutputStream output) {
|
||||
while (next != null && next.Value.Key.FieldNumber < end) {
|
||||
extensions.WriteField(next.Value.Key, next.Value.Value, output);
|
||||
if (iterator.MoveNext()) {
|
||||
next = iterator.Current;
|
||||
} else {
|
||||
next = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected ExtensionWriter CreateExtensionWriter(ExtendableMessage<TMessage, TBuilder> message) {
|
||||
return new ExtensionWriter(message);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called by subclasses to compute the size of extensions.
|
||||
/// </summary>
|
||||
protected int ExtensionsSerializedSize {
|
||||
get { return extensions.SerializedSize; }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -30,6 +30,10 @@ namespace Google.ProtocolBuffers {
|
|||
this.fields = fields;
|
||||
}
|
||||
|
||||
public static FieldSet CreateFieldSet() {
|
||||
return new FieldSet(new Dictionary<FieldDescriptor, object>());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Makes this FieldSet immutable, and returns it for convenience. Any
|
||||
/// mutable repeated fields are made immutable, as well as the map itself.
|
||||
|
@ -395,6 +399,13 @@ namespace Google.ProtocolBuffers {
|
|||
((IList<object>) list).Add(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns an enumerator for the field map. Used to write the fields out.
|
||||
/// </summary>
|
||||
internal IEnumerator<KeyValuePair<FieldDescriptor, object>> GetEnumerator() {
|
||||
return fields.GetEnumerator();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// See <see cref="IMessage.IsInitialized" />
|
||||
/// </summary>
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace Google.ProtocolBuffers {
|
|||
protected abstract TMessage MessageBeingBuilt { get; }
|
||||
|
||||
protected internal FieldAccessorTable InternalFieldAccessors {
|
||||
get { return MessageBeingBuilt.InternalFieldAccessors; }
|
||||
get { return MessageBeingBuilt.FieldAccesseorsFromBuilder; }
|
||||
}
|
||||
|
||||
public override bool Initialized {
|
||||
|
@ -190,6 +190,16 @@ namespace Google.ProtocolBuffers {
|
|||
return this;
|
||||
}
|
||||
|
||||
public virtual IBuilder<TMessage> MergeFrom(CodedInputStream input) {
|
||||
((IBuilder)this).MergeFrom(input);
|
||||
return this;
|
||||
}
|
||||
|
||||
public virtual IBuilder<TMessage> MergeFrom(CodedInputStream input, ExtensionRegistry extensionRegistry) {
|
||||
((IBuilder)this).MergeFrom(input, extensionRegistry);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Like Build(), but will wrap UninitializedMessageException in
|
||||
/// InvalidProtocolBufferException.
|
||||
|
@ -217,7 +227,8 @@ namespace Google.ProtocolBuffers {
|
|||
public abstract IBuilder<TMessage> Clone();
|
||||
public abstract new IBuilder<TMessage> Clear();
|
||||
public abstract TMessage DefaultInstanceForType { get; }
|
||||
public abstract IBuilder<TMessage> MergeFrom(CodedInputStream input);
|
||||
public abstract IBuilder<TMessage> MergeFrom(CodedInputStream input, ExtensionRegistry extensionRegistry);
|
||||
|
||||
public abstract class ExtendableBuilder : GeneratedBuilder<TMessage, TBuilder> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,29 @@
|
|||
using Google.ProtocolBuffers.Descriptors;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Google.ProtocolBuffers {
|
||||
|
||||
public static class GeneratedExtension {
|
||||
|
||||
public static GeneratedExtension<TContainer, TExtension> CreateExtension<TContainer, TExtension>(FieldDescriptor descriptor)
|
||||
where TContainer : IMessage<TContainer> {
|
||||
if (descriptor.IsRepeated) {
|
||||
throw new ArgumentException("Must call CreateRepeatedGeneratedExtension() for repeated types.");
|
||||
}
|
||||
return new GeneratedExtension<TContainer, TExtension>(descriptor);
|
||||
}
|
||||
|
||||
public static GeneratedExtension<TContainer, IList<TExtension>> CreateRepeatedExtension<TContainer, TExtension>(FieldDescriptor descriptor)
|
||||
where TContainer : IMessage<TContainer> {
|
||||
if (descriptor.IsRepeated) {
|
||||
throw new ArgumentException("Must call CreateRepeatedGeneratedExtension() for repeated types.");
|
||||
}
|
||||
return new GeneratedExtension<TContainer, IList<TExtension>>(descriptor);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Base class for all generated extensions.
|
||||
/// </summary>
|
||||
|
@ -24,8 +46,52 @@ namespace Google.ProtocolBuffers {
|
|||
/// in ExtendableMessage and ExtendableBuilder.
|
||||
/// </remarks>
|
||||
public class GeneratedExtension<TContainer, TExtension> where TContainer : IMessage<TContainer> {
|
||||
public FieldDescriptor Descriptor;
|
||||
private readonly IMessage messageDefaultInstance;
|
||||
private readonly FieldDescriptor descriptor;
|
||||
|
||||
public IMessage MessageDefaultInstance;
|
||||
internal GeneratedExtension(FieldDescriptor descriptor) {
|
||||
if (!descriptor.IsExtension) {
|
||||
throw new ArgumentException("GeneratedExtension given a regular (non-extension) field.");
|
||||
}
|
||||
|
||||
this.descriptor = descriptor;
|
||||
|
||||
switch (descriptor.MappedType) {
|
||||
case MappedType.Message:
|
||||
PropertyInfo defaultInstanceProperty = typeof(TExtension)
|
||||
.GetProperty("DefaultInstance", BindingFlags.Static | BindingFlags.Public);
|
||||
if (defaultInstanceProperty == null) {
|
||||
throw new ArgumentException("No public static DefaultInstance property for type " + typeof(TExtension).Name);
|
||||
}
|
||||
messageDefaultInstance = (IMessage) defaultInstanceProperty.GetValue(null, null);
|
||||
break;
|
||||
case MappedType.Enum:
|
||||
// FIXME(jonskeet): May not need this
|
||||
//enumValueOf = getMethodOrDie(type, "valueOf",
|
||||
// EnumValueDescriptor.class);
|
||||
//enumGetValueDescriptor = getMethodOrDie(type, "getValueDescriptor");
|
||||
messageDefaultInstance = null;
|
||||
break;
|
||||
default:
|
||||
messageDefaultInstance = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public FieldDescriptor Descriptor {
|
||||
get { return descriptor; }
|
||||
}
|
||||
|
||||
public IMessage MessageDefaultInstance {
|
||||
get { return messageDefaultInstance; }
|
||||
}
|
||||
|
||||
internal object SingularFromReflectionType(object p) {
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
internal object FromReflectionType(object value) {
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,11 +14,16 @@ namespace Google.ProtocolBuffers {
|
|||
/// can ignore this class as an implementation detail.
|
||||
/// </summary>
|
||||
public abstract class GeneratedMessage<TMessage, TBuilder> : AbstractMessage, IMessage<TMessage>
|
||||
where TMessage : GeneratedMessage<TMessage, TBuilder> where TBuilder : IBuilder<TMessage> {
|
||||
where TMessage : GeneratedMessage<TMessage, TBuilder>
|
||||
where TBuilder : IBuilder<TMessage> {
|
||||
|
||||
private UnknownFieldSet unknownFields = UnknownFieldSet.DefaultInstance;
|
||||
|
||||
protected internal abstract FieldAccessorTable InternalFieldAccessors { get; }
|
||||
internal FieldAccessorTable FieldAccesseorsFromBuilder {
|
||||
get { return InternalFieldAccessors; }
|
||||
}
|
||||
|
||||
protected abstract FieldAccessorTable InternalFieldAccessors { get; }
|
||||
|
||||
public override MessageDescriptor DescriptorForType {
|
||||
get { return InternalFieldAccessors.Descriptor; }
|
||||
|
@ -36,7 +41,7 @@ namespace Google.ProtocolBuffers {
|
|||
|
||||
public abstract IBuilder<TMessage> CreateBuilderForType();
|
||||
|
||||
private IDictionary<FieldDescriptor, Object> GetMutableFieldMap() {
|
||||
internal IDictionary<FieldDescriptor, Object> GetMutableFieldMap() {
|
||||
|
||||
// Use a SortedList so we'll end up serializing fields in order
|
||||
var ret = new SortedList<FieldDescriptor, object>();
|
||||
|
@ -83,6 +88,6 @@ namespace Google.ProtocolBuffers {
|
|||
/// </summary>
|
||||
internal void SetUnknownFields(UnknownFieldSet fieldSet) {
|
||||
unknownFields = fieldSet;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
14
csharp/ProtocolBuffers/IRpcChannel.cs
Normal file
14
csharp/ProtocolBuffers/IRpcChannel.cs
Normal file
|
@ -0,0 +1,14 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Google.ProtocolBuffers.Descriptors;
|
||||
|
||||
namespace Google.ProtocolBuffers {
|
||||
/// <summary>
|
||||
/// TODO(jonskeet): Do this properly.
|
||||
/// </summary>
|
||||
public interface IRpcChannel {
|
||||
void CallMethod<T>(MethodDescriptor method, IRpcController controller,
|
||||
IMessage request, IMessage responsePrototype, Action<T> done);
|
||||
}
|
||||
}
|
8
csharp/ProtocolBuffers/IRpcController.cs
Normal file
8
csharp/ProtocolBuffers/IRpcController.cs
Normal file
|
@ -0,0 +1,8 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Google.ProtocolBuffers {
|
||||
public interface IRpcController {
|
||||
}
|
||||
}
|
9
csharp/ProtocolBuffers/IService.cs
Normal file
9
csharp/ProtocolBuffers/IService.cs
Normal file
|
@ -0,0 +1,9 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Google.ProtocolBuffers {
|
||||
public interface IService {
|
||||
// TODO(jonskeet): Fill this in
|
||||
}
|
||||
}
|
|
@ -67,6 +67,8 @@
|
|||
<Compile Include="Descriptors\MethodDescriptor.cs" />
|
||||
<Compile Include="Descriptors\PackageDescriptor.cs" />
|
||||
<Compile Include="Descriptors\ServiceDescriptor.cs" />
|
||||
<Compile Include="DynamicMessage.cs" />
|
||||
<Compile Include="ExtendableMessage.cs" />
|
||||
<Compile Include="ExtensionInfo.cs" />
|
||||
<Compile Include="ExtensionRegistry.cs" />
|
||||
<Compile Include="FieldAccess\SingleEnumAccessor.cs" />
|
||||
|
@ -85,7 +87,11 @@
|
|||
<Compile Include="IBuilder.cs" />
|
||||
<Compile Include="IMessage.cs" />
|
||||
<Compile Include="InvalidProtocolBufferException.cs" />
|
||||
<Compile Include="IRpcChannel.cs" />
|
||||
<Compile Include="IRpcController.cs" />
|
||||
<Compile Include="IService.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="RpcUtil.cs" />
|
||||
<Compile Include="TextFormat.cs" />
|
||||
<Compile Include="TextGenerator.cs" />
|
||||
<Compile Include="UninitializedMessageException.cs" />
|
||||
|
|
35
csharp/ProtocolBuffers/RpcUtil.cs
Normal file
35
csharp/ProtocolBuffers/RpcUtil.cs
Normal file
|
@ -0,0 +1,35 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Google.ProtocolBuffers {
|
||||
public static class RpcUtil {
|
||||
|
||||
/// <summary>
|
||||
/// Converts an Action[IMessage] to an Action[T].
|
||||
/// </summary>
|
||||
public static Action<T> SpecializeCallback<T>(Action<IMessage> action)
|
||||
where T : IMessage<T> {
|
||||
return message => action(message);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts an Action[T] to an Action[IMessage].
|
||||
/// The generalized action will accept any message object which has
|
||||
/// the same descriptor, and will convert it to the correct class
|
||||
/// before calling the original action. However, if the generalized
|
||||
/// callback is given a message with a different descriptor, an
|
||||
/// exception will be thrown.
|
||||
/// </summary>
|
||||
public static Action<IMessage> GeneralizeCallback<T>(Action<T> action, T defaultInstance)
|
||||
where T : class, IMessage<T> {
|
||||
return message => {
|
||||
T castMessage = message as T;
|
||||
if (castMessage == null) {
|
||||
castMessage = (T) defaultInstance.CreateBuilderForType().MergeFrom(message).Build();
|
||||
}
|
||||
action(castMessage);
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
|
@ -155,25 +155,18 @@ namespace Google.ProtocolBuffers {
|
|||
UnknownField field = entry.Value;
|
||||
|
||||
foreach (ulong value in field.VarintList) {
|
||||
generator.Print(entry.Key.ToString());
|
||||
generator.Print(": ");
|
||||
generator.Print(prefix);
|
||||
generator.Print(value.ToString());
|
||||
generator.Print("\n");
|
||||
}
|
||||
foreach (uint value in field.Fixed32List) {
|
||||
generator.Print(entry.Key.ToString());
|
||||
generator.Print(": ");
|
||||
// FIXME(jonskeet): Get format of this right; in Java it's %08x. Find out what this means
|
||||
// Also check we're okay in terms of signed/unsigned.
|
||||
generator.Print(string.Format("0x{0:x}", value));
|
||||
generator.Print(prefix);
|
||||
generator.Print(string.Format("0x{0:x8}", value));
|
||||
generator.Print("\n");
|
||||
}
|
||||
foreach (ulong value in field.Fixed64List) {
|
||||
generator.Print(entry.Key.ToString());
|
||||
generator.Print(": ");
|
||||
// FIXME(jonskeet): Get format of this right; in Java it's %016x. Find out what this means
|
||||
// Also check we're okay in terms of signed/unsigned.
|
||||
generator.Print(string.Format("0x{0:x}", value));
|
||||
generator.Print(prefix);
|
||||
generator.Print(string.Format("0x{0:x16}", value));
|
||||
generator.Print("\n");
|
||||
}
|
||||
foreach (ByteString value in field.LengthDelimitedList) {
|
||||
|
@ -193,7 +186,6 @@ namespace Google.ProtocolBuffers {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
internal static ulong ParseUInt64(string text) {
|
||||
return (ulong) ParseInteger(text, true, false);
|
||||
}
|
||||
|
|
|
@ -127,10 +127,10 @@ namespace Google.ProtocolBuffers {
|
|||
foreach (ulong value in varintList) {
|
||||
result += CodedOutputStream.ComputeUInt64Size(fieldNumber, value);
|
||||
}
|
||||
foreach (int value in fixed32List) {
|
||||
foreach (uint value in fixed32List) {
|
||||
result += CodedOutputStream.ComputeFixed32Size(fieldNumber, value);
|
||||
}
|
||||
foreach (long value in fixed64List) {
|
||||
foreach (ulong value in fixed64List) {
|
||||
result += CodedOutputStream.ComputeFixed64Size(fieldNumber, value);
|
||||
}
|
||||
foreach (ByteString value in lengthDelimitedList) {
|
||||
|
|
|
@ -69,8 +69,9 @@ void EnumGenerator::Generate(io::Printer* printer) {
|
|||
vars["number"] = SimpleItoa(canonical_values_[i]->number());
|
||||
|
||||
// TODO(jonskeet): Change CONSTANT_CASE into PascalCase
|
||||
// TODO(jonskeet): I don't think we need EnumDescriptorIndex after all
|
||||
printer->Print(vars,
|
||||
"[pbd::EnumDescriptorIndex($index$)]\r\n"
|
||||
//"[pbd::EnumDescriptorIndex($index$)]\r\n"
|
||||
"$name$ = $number$,\r\n");
|
||||
}
|
||||
printer->Outdent();
|
||||
|
|
|
@ -178,11 +178,11 @@ GenerateBuilderMembers(io::Printer* printer) const {
|
|||
// could hold on to the returned list and modify it after the message
|
||||
// has been built, thus mutating the message which is supposed to be
|
||||
// immutable.
|
||||
"public global::System.Collections.Generic::IList<$type$> $capitalized_name$List {\r\n"
|
||||
"public scg::IList<$type$> $capitalized_name$List {\r\n"
|
||||
" get { return pbc::Lists.AsReadOnly(result.$name$_); }\r\n"
|
||||
"}\r\n"
|
||||
"public int $capitalized_name$Count {\r\n"
|
||||
" get { return result.get$capitalized_name$Count; } \r\n"
|
||||
" get { return result.$capitalized_name$Count; } \r\n"
|
||||
"}\r\n"
|
||||
"public $type$ Get$capitalized_name$(int index) {\r\n"
|
||||
" return result.Get$capitalized_name$(index);\r\n"
|
||||
|
@ -191,7 +191,7 @@ GenerateBuilderMembers(io::Printer* printer) const {
|
|||
" result.$name$_[index] = value;\r\n"
|
||||
" return this;\r\n"
|
||||
"}\r\n"
|
||||
"public Builder add$capitalized_name$($type$ value) {\r\n"
|
||||
"public Builder Add$capitalized_name$($type$ value) {\r\n"
|
||||
" if (result.$name$_.Count == 0) {\r\n"
|
||||
" result.$name$_ = new scg::List<$type$>();\r\n"
|
||||
" }\r\n"
|
||||
|
@ -232,9 +232,9 @@ void RepeatedEnumFieldGenerator::
|
|||
GenerateParsingCode(io::Printer* printer) const {
|
||||
printer->Print(variables_,
|
||||
"int rawValue = input.ReadEnum();\r\n"
|
||||
"$type$ value = $type$.valueOf(rawValue);\r\n"
|
||||
"if (value == null) {\r\n"
|
||||
" unknownFields.MergeVarintField($number$, rawValue);\r\n"
|
||||
"$type$ value = ($type$) rawValue;\r\n"
|
||||
"if (!global::System.Enum.IsDefined(typeof($type$), value)) {\r\n"
|
||||
" unknownFields.MergeVarintField($number$, (ulong) rawValue);\r\n"
|
||||
"} else {\r\n"
|
||||
" Add$capitalized_name$(value);\r\n"
|
||||
"}\r\n");
|
||||
|
@ -244,7 +244,7 @@ void RepeatedEnumFieldGenerator::
|
|||
GenerateSerializationCode(io::Printer* printer) const {
|
||||
printer->Print(variables_,
|
||||
"foreach ($type$ element in $capitalized_name$List) {\r\n"
|
||||
" output.WriteEnum($number$, element.Number);\r\n"
|
||||
" output.WriteEnum($number$, (int) element);\r\n"
|
||||
"}\r\n");
|
||||
}
|
||||
|
||||
|
@ -253,7 +253,7 @@ GenerateSerializedSizeCode(io::Printer* printer) const {
|
|||
printer->Print(variables_,
|
||||
"foreach ($type$ element in $capitalized_name$List) {\r\n"
|
||||
" size += pb::CodedOutputStream\r\n"
|
||||
" .ComputeEnumSize($number$, element.Number);\r\n"
|
||||
" .ComputeEnumSize($number$, (int) element);\r\n"
|
||||
"}\r\n");
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ ExtensionGenerator::~ExtensionGenerator() {}
|
|||
|
||||
void ExtensionGenerator::Generate(io::Printer* printer) {
|
||||
map<string, string> vars;
|
||||
vars["name"] = UnderscoresToCamelCase(descriptor_);
|
||||
vars["name"] = UnderscoresToCapitalizedCamelCase(descriptor_);
|
||||
vars["containing_type"] = ClassName(descriptor_->containing_type());
|
||||
vars["index"] = SimpleItoa(descriptor_->index());
|
||||
|
||||
|
@ -56,23 +56,13 @@ void ExtensionGenerator::Generate(io::Printer* printer) {
|
|||
|
||||
if (descriptor_->is_repeated()) {
|
||||
printer->Print(vars,
|
||||
"public static final\r\n"
|
||||
" pb::GeneratedMessage.GeneratedExtension<\r\n"
|
||||
" $containing_type$,\r\n"
|
||||
" java.util.List<$type$>> $name$ =\r\n"
|
||||
" pb::GeneratedMessage\r\n"
|
||||
" .newRepeatedGeneratedExtension(\r\n"
|
||||
" getDescriptor().getExtensions().get($index$),\r\n"
|
||||
" typeof ($type$));\r\n");
|
||||
"public static readonly\r\n"
|
||||
" pb::GeneratedExtension<$containing_type$, scg::IList<$type$>> name =\r\n"
|
||||
" pb::GeneratedExtension.CreateRepeatedExtension<$containing_type$, $type$>(Descriptor.Extensions[$index$]);\r\n");
|
||||
} else {
|
||||
printer->Print(vars,
|
||||
"public static final\r\n"
|
||||
" pb::GeneratedMessage.GeneratedExtension<\r\n"
|
||||
" $containing_type$,\r\n"
|
||||
" $type$> $name$ =\r\n"
|
||||
" pb::GeneratedMessage.newGeneratedExtension(\r\n"
|
||||
" getDescriptor().getExtensions().get($index$),\r\n"
|
||||
" typeof ($type$));\r\n");
|
||||
"public static readonly pb::GeneratedExtension<$containing_type$, $type$> $name$ =\r\n"
|
||||
" pb::GeneratedExtension.CreateExtension<$containing_type$, $type$>(Descriptor.Extensions[$index$]);\r\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -148,7 +148,7 @@ void FileGenerator::Generate(io::Printer* printer) {
|
|||
printer->Print("\r\n}, new pbd::FileDescriptor[] {\r\n");
|
||||
for (int i = 0; i < file_->dependency_count(); i++) {
|
||||
printer->Print(
|
||||
" $dependency$.getDescriptor(),\r\n",
|
||||
" $dependency$.Descriptor,\r\n",
|
||||
"dependency", ClassName(file_->dependency(i)));
|
||||
}
|
||||
|
||||
|
@ -165,9 +165,11 @@ void FileGenerator::Generate(io::Printer* printer) {
|
|||
// Extensions must be generated in the outer class since they are values,
|
||||
// not classes.
|
||||
printer->Print("#region Extensions\r\n");
|
||||
printer->Print("/*");
|
||||
for (int i = 0; i < file_->extension_count(); i++) {
|
||||
ExtensionGenerator(file_->extension(i)).Generate(printer);
|
||||
}
|
||||
printer->Print("*/\r\n");
|
||||
printer->Print("#endregion\r\n\r\n");
|
||||
|
||||
printer->Print("#region Static variables\r\n");
|
||||
|
|
|
@ -91,6 +91,10 @@ string UnderscoresToCapitalizedCamelCase(const FieldDescriptor* field) {
|
|||
return UnderscoresToCamelCaseImpl(FieldName(field), true);
|
||||
}
|
||||
|
||||
string UnderscoresToCapitalizedCamelCase(const MethodDescriptor* method) {
|
||||
return UnderscoresToCamelCaseImpl(method->name(), true);
|
||||
}
|
||||
|
||||
string UnderscoresToCamelCase(const MethodDescriptor* method) {
|
||||
return UnderscoresToCamelCaseImpl(method->name(), false);
|
||||
}
|
||||
|
@ -162,19 +166,23 @@ string ClassName(const FileDescriptor* descriptor) {
|
|||
MappedType GetMappedType(FieldDescriptor::Type field_type) {
|
||||
switch (field_type) {
|
||||
case FieldDescriptor::TYPE_INT32:
|
||||
case FieldDescriptor::TYPE_UINT32:
|
||||
case FieldDescriptor::TYPE_SINT32:
|
||||
case FieldDescriptor::TYPE_FIXED32:
|
||||
case FieldDescriptor::TYPE_SFIXED32:
|
||||
return MAPPEDTYPE_INT;
|
||||
|
||||
case FieldDescriptor::TYPE_INT64:
|
||||
case FieldDescriptor::TYPE_UINT64:
|
||||
case FieldDescriptor::TYPE_SINT64:
|
||||
case FieldDescriptor::TYPE_FIXED64:
|
||||
case FieldDescriptor::TYPE_SFIXED64:
|
||||
return MAPPEDTYPE_LONG;
|
||||
|
||||
case FieldDescriptor::TYPE_UINT32:
|
||||
case FieldDescriptor::TYPE_FIXED32:
|
||||
return MAPPEDTYPE_UINT;
|
||||
|
||||
case FieldDescriptor::TYPE_UINT64:
|
||||
case FieldDescriptor::TYPE_FIXED64:
|
||||
return MAPPEDTYPE_ULONG;
|
||||
|
||||
case FieldDescriptor::TYPE_FLOAT:
|
||||
return MAPPEDTYPE_FLOAT;
|
||||
|
||||
|
|
|
@ -43,6 +43,7 @@ string UnderscoresToCapitalizedCamelCase(const FieldDescriptor* field);
|
|||
// Similar, but for method names. (Typically, this merely has the effect
|
||||
// of lower-casing the first letter of the name.)
|
||||
string UnderscoresToCamelCase(const MethodDescriptor* method);
|
||||
string UnderscoresToCapitalizedCamelCase(const MethodDescriptor* method);
|
||||
|
||||
// Strips ".proto" or ".protodevel" from the end of a filename.
|
||||
string StripProto(const string& filename);
|
||||
|
|
|
@ -204,7 +204,7 @@ void MessageGenerator::Generate(io::Printer* printer) {
|
|||
|
||||
if (descriptor_->extension_range_count() > 0) {
|
||||
printer->Print(
|
||||
"$access$ sealed partial class $classname$ : pb::GeneratedMessage.ExtendableMessage<$classname$> {\r\n",
|
||||
"$access$ sealed partial class $classname$ : pb::ExtendableMessage<$classname$, $classname$.Builder> {\r\n",
|
||||
"classname", descriptor_->name(),
|
||||
"access", ClassAccessLevel(descriptor_->file()));
|
||||
} else {
|
||||
|
@ -233,7 +233,7 @@ void MessageGenerator::Generate(io::Printer* printer) {
|
|||
" get { return $fileclass$.internal__$identifier$__Descriptor; }\r\n"
|
||||
"}\r\n"
|
||||
"\r\n"
|
||||
"protected internal override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors {\r\n"
|
||||
"protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors {\r\n"
|
||||
" get { return $fileclass$.internal__$identifier$__FieldAccessorTable; }\r\n"
|
||||
"}\r\n"
|
||||
"\r\n",
|
||||
|
@ -298,7 +298,8 @@ GenerateMessageSerializationMethods(io::Printer* printer) {
|
|||
|
||||
if (descriptor_->extension_range_count() > 0) {
|
||||
printer->Print(
|
||||
"pb::GeneratedMessage.ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter();\r\n");
|
||||
"pb::ExtendableMessage<$classname$, $classname$.Builder>.ExtensionWriter extensionWriter = CreateExtensionWriter(this);\r\n",
|
||||
"classname", descriptor_->name());
|
||||
}
|
||||
|
||||
// Merge the fields and the extension ranges, both sorted by field number.
|
||||
|
@ -434,8 +435,7 @@ void MessageGenerator::GenerateBuilder(io::Printer* printer) {
|
|||
|
||||
if (descriptor_->extension_range_count() > 0) {
|
||||
printer->Print(
|
||||
"$access$ sealed partial class Builder : pb::GeneratedMessage.ExtendableBuilder<\r\n"
|
||||
" $classname$, Builder> {\r\n",
|
||||
"$access$ sealed partial class Builder : pb::GeneratedBuilder<$classname$, $classname$.Builder>.ExtendableBuilder {\r\n",
|
||||
"classname", ClassName(descriptor_),
|
||||
"access", ClassAccessLevel(descriptor_->file()));
|
||||
} else {
|
||||
|
@ -673,7 +673,7 @@ void MessageGenerator::GenerateIsInitialized(io::Printer* printer) {
|
|||
|
||||
if (descriptor_->extension_range_count() > 0) {
|
||||
printer->Print(
|
||||
"if (!extensionsAreInitialized()) return false;\r\n");
|
||||
"if (!ExtensionsAreInitialized) return false;\r\n");
|
||||
}
|
||||
|
||||
printer->Outdent();
|
||||
|
|
|
@ -36,11 +36,8 @@ ServiceGenerator::ServiceGenerator(const ServiceDescriptor* descriptor)
|
|||
ServiceGenerator::~ServiceGenerator() {}
|
||||
|
||||
void ServiceGenerator::Generate(io::Printer* printer) {
|
||||
bool is_own_file = descriptor_->file()->options().csharp_multiple_files();
|
||||
printer->Print(
|
||||
"public $static$ abstract class $classname$\r\n"
|
||||
" implements pb::Service {\r\n",
|
||||
"static", is_own_file ? "" : "static",
|
||||
"public abstract class $classname$ : pb::IService {\r\n",
|
||||
"classname", descriptor_->name());
|
||||
printer->Indent();
|
||||
|
||||
|
@ -48,27 +45,24 @@ void ServiceGenerator::Generate(io::Printer* printer) {
|
|||
for (int i = 0; i < descriptor_->method_count(); i++) {
|
||||
const MethodDescriptor* method = descriptor_->method(i);
|
||||
map<string, string> vars;
|
||||
vars["name"] = UnderscoresToCamelCase(method);
|
||||
vars["name"] = UnderscoresToCapitalizedCamelCase(method);
|
||||
vars["input"] = ClassName(method->input_type());
|
||||
vars["output"] = ClassName(method->output_type());
|
||||
printer->Print(vars,
|
||||
"public abstract void $name$(\r\n"
|
||||
" pb::RpcController controller,\r\n"
|
||||
" pb::IRpcController controller,\r\n"
|
||||
" $input$ request,\r\n"
|
||||
" pb::RpcCallback<$output$> done);\r\n");
|
||||
" global::System.Action<$output$> done);\r\n");
|
||||
}
|
||||
|
||||
// Generate getDescriptor() and getDescriptorForType().
|
||||
// Generate Descriptor and DescriptorForType.
|
||||
printer->Print(
|
||||
"\r\n"
|
||||
"public static final\r\n"
|
||||
" pbd::ServiceDescriptor\r\n"
|
||||
" getDescriptor() {\r\n"
|
||||
" return $file$.getDescriptor().getServices().get($index$);\r\n"
|
||||
"public static pbd::ServiceDescriptor Descriptor {\r\n"
|
||||
" get { return $file$.Descriptor.Services[$index$]; }\r\n"
|
||||
"}\r\n"
|
||||
"public final pbd::ServiceDescriptor\r\n"
|
||||
" DescriptorForType {\r\n"
|
||||
" return getDescriptor();\r\n"
|
||||
"public pbd::ServiceDescriptor DescriptorForType {\r\n"
|
||||
" get { return Descriptor; }\r\n"
|
||||
"}\r\n",
|
||||
"file", ClassName(descriptor_->file()),
|
||||
"index", SimpleItoa(descriptor_->index()));
|
||||
|
@ -86,18 +80,17 @@ void ServiceGenerator::Generate(io::Printer* printer) {
|
|||
void ServiceGenerator::GenerateCallMethod(io::Printer* printer) {
|
||||
printer->Print(
|
||||
"\r\n"
|
||||
"public final void callMethod(\r\n"
|
||||
"public void CallMethod(\r\n"
|
||||
" pbd::MethodDescriptor method,\r\n"
|
||||
" pb::RpcController controller,\r\n"
|
||||
" pb::IRpcController controller,\r\n"
|
||||
" pb::IMessage request,\r\n"
|
||||
" pb::RpcCallback<\r\n"
|
||||
" pb::Message> done) {\r\n"
|
||||
" if (method.getService() != getDescriptor()) {\r\n"
|
||||
" global::System.Action<pb::IMessage> done) {\r\n"
|
||||
" if (method.Service != Descriptor) {\r\n"
|
||||
" throw new global::System.ArgumentException(\r\n"
|
||||
" \"Service.CallMethod() given method descriptor for wrong \" +\r\n"
|
||||
" \"service type.\");\r\n"
|
||||
" }\r\n"
|
||||
" switch(method.getIndex()) {\r\n");
|
||||
" switch(method.Index) {\r\n");
|
||||
printer->Indent();
|
||||
printer->Indent();
|
||||
|
||||
|
@ -105,13 +98,13 @@ void ServiceGenerator::GenerateCallMethod(io::Printer* printer) {
|
|||
const MethodDescriptor* method = descriptor_->method(i);
|
||||
map<string, string> vars;
|
||||
vars["index"] = SimpleItoa(i);
|
||||
vars["method"] = UnderscoresToCamelCase(method);
|
||||
vars["method"] = UnderscoresToCapitalizedCamelCase(method);
|
||||
vars["input"] = ClassName(method->input_type());
|
||||
vars["output"] = ClassName(method->output_type());
|
||||
printer->Print(vars,
|
||||
"case $index$:\r\n"
|
||||
" this.$method$(controller, ($input$)request,\r\n"
|
||||
" pb::RpcUtil.<$output$>specializeCallback(\r\n"
|
||||
" pb::RpcUtil.SpecializeCallback<$output$>(\r\n"
|
||||
" done));\r\n"
|
||||
" return;\r\n");
|
||||
}
|
||||
|
@ -132,10 +125,8 @@ void ServiceGenerator::GenerateCallMethod(io::Printer* printer) {
|
|||
void ServiceGenerator::GenerateGetPrototype(RequestOrResponse which,
|
||||
io::Printer* printer) {
|
||||
printer->Print(
|
||||
"public final pb::Message\r\n"
|
||||
" Get$request_or_response$Prototype(\r\n"
|
||||
" pbd::MethodDescriptor method) {\r\n"
|
||||
" if (method.getService() != getDescriptor()) {\r\n"
|
||||
"public pb::IMessage Get$request_or_response$Prototype(pbd::MethodDescriptor method) {\r\n"
|
||||
" if (method.Service != Descriptor) {\r\n"
|
||||
" throw new global::System.ArgumentException(\r\n"
|
||||
" \"Service.Get$request_or_response$Prototype() given method \" +\r\n"
|
||||
" \"descriptor for wrong service type.\");\r\n"
|
||||
|
@ -162,7 +153,6 @@ void ServiceGenerator::GenerateGetPrototype(RequestOrResponse which,
|
|||
|
||||
printer->Outdent();
|
||||
printer->Outdent();
|
||||
|
||||
printer->Print(
|
||||
" }\r\n"
|
||||
"}\r\n"
|
||||
|
@ -171,48 +161,45 @@ void ServiceGenerator::GenerateGetPrototype(RequestOrResponse which,
|
|||
|
||||
void ServiceGenerator::GenerateStub(io::Printer* printer) {
|
||||
printer->Print(
|
||||
"public static Stub newStub(\r\n"
|
||||
" pb::RpcChannel channel) {\r\n"
|
||||
"public static Stub CreateStub(\r\n"
|
||||
" pb::IRpcChannel channel) {\r\n"
|
||||
" return new Stub(channel);\r\n"
|
||||
"}\r\n"
|
||||
"\r\n"
|
||||
"public static final class Stub extends $classname$ {\r\n",
|
||||
"public class Stub : $classname$ {\r\n",
|
||||
"classname", ClassName(descriptor_));
|
||||
printer->Indent();
|
||||
|
||||
printer->Print(
|
||||
"private Stub(pb::RpcChannel channel) {\r\n"
|
||||
"internal Stub(pb::IRpcChannel channel) {\r\n"
|
||||
" this.channel = channel;\r\n"
|
||||
"}\r\n"
|
||||
"\r\n"
|
||||
"private final pb::RpcChannel channel;\r\n"
|
||||
"private readonly pb::IRpcChannel channel;\r\n"
|
||||
"\r\n"
|
||||
"public pb::RpcChannel getChannel() {\r\n"
|
||||
" return channel;\r\n"
|
||||
"public pb::IRpcChannel Channel {\r\n"
|
||||
" get { return channel; }\r\n"
|
||||
"}\r\n");
|
||||
|
||||
for (int i = 0; i < descriptor_->method_count(); i++) {
|
||||
const MethodDescriptor* method = descriptor_->method(i);
|
||||
map<string, string> vars;
|
||||
vars["index"] = SimpleItoa(i);
|
||||
vars["method"] = UnderscoresToCamelCase(method);
|
||||
vars["method"] = UnderscoresToCapitalizedCamelCase(method);
|
||||
vars["input"] = ClassName(method->input_type());
|
||||
vars["output"] = ClassName(method->output_type());
|
||||
printer->Print(vars,
|
||||
"\r\n"
|
||||
"public void $method$(\r\n"
|
||||
" pb::RpcController controller,\r\n"
|
||||
"public override void $method$(\r\n"
|
||||
" pb::IRpcController controller,\r\n"
|
||||
" $input$ request,\r\n"
|
||||
" pb::RpcCallback<$output$> done) {\r\n"
|
||||
" channel.callMethod(\r\n"
|
||||
" global::System.Action<$output$> done) {\r\n"
|
||||
" channel.CallMethod(\r\n"
|
||||
" Descriptor.Methods[$index$],\r\n"
|
||||
" controller,\r\n"
|
||||
" request,\r\n"
|
||||
" $output$.DefaultInstance,\r\n"
|
||||
" pb::RpcUtil.generalizeCallback(\r\n"
|
||||
" done,\r\n"
|
||||
" typeof ($output$),\r\n"
|
||||
" $output$.DefaultInstance));\r\n"
|
||||
" pb::RpcUtil.GeneralizeCallback(done, $output$.DefaultInstance));\r\n"
|
||||
"}\r\n");
|
||||
}
|
||||
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
//
|
||||
// A proto file we will use for unit testing.
|
||||
|
||||
option csharp_namespace = "Google.ProtocolBuffers.TestProtos";
|
||||
option csharp_file_classname = "UnitTestProtoFile";
|
||||
|
||||
import "google/protobuf/unittest_import.proto";
|
||||
|
||||
|
|
|
@ -24,6 +24,9 @@ import "google/protobuf/unittest_optimize_for.proto";
|
|||
|
||||
package protobuf_unittest;
|
||||
|
||||
option csharp_namespace = "Google.ProtocolBuffers.TestProtos";
|
||||
option csharp_file_classname = "UnitTestEmbedOptimizeForProtoFile";
|
||||
|
||||
// We optimize for speed here, but we are importing a proto that is optimized
|
||||
// for code size.
|
||||
option optimize_for = SPEED;
|
||||
|
|
|
@ -29,9 +29,12 @@ package protobuf_unittest_import;
|
|||
|
||||
option optimize_for = SPEED;
|
||||
|
||||
// Excercise the java_package option.
|
||||
// Exercise the java_package option.
|
||||
option java_package = "com.google.protobuf.test";
|
||||
|
||||
option csharp_namespace = "Google.ProtocolBuffers.TestProtos";
|
||||
option csharp_file_classname = "UnitTestImportProtoFile";
|
||||
|
||||
// Do not set a java_outer_classname here to verify that Proto2 works without
|
||||
// one.
|
||||
|
||||
|
|
|
@ -24,6 +24,9 @@ package protobuf_unittest;
|
|||
|
||||
option optimize_for = SPEED;
|
||||
|
||||
option csharp_namespace = "Google.ProtocolBuffers.TestProtos";
|
||||
option csharp_file_classname = "UnitTestMessageSetProtoFile";
|
||||
|
||||
// A message with message_set_wire_format.
|
||||
message TestMessageSet {
|
||||
option message_set_wire_format = true;
|
||||
|
|
|
@ -26,6 +26,9 @@ package protobuf_unittest;
|
|||
|
||||
option optimize_for = CODE_SIZE;
|
||||
|
||||
option csharp_namespace = "Google.ProtocolBuffers.TestProtos";
|
||||
option csharp_file_classname = "UnitTestOptimizeForProtoFile";
|
||||
|
||||
message TestOptimizedForSize {
|
||||
optional int32 i = 1;
|
||||
optional ForeignMessage msg = 19;
|
||||
|
|
Loading…
Add table
Reference in a new issue