diff options
author | Jie Luo <anandolee@gmail.com> | 2015-05-29 17:19:46 -0700 |
---|---|---|
committer | Jie Luo <anandolee@gmail.com> | 2015-05-29 17:19:46 -0700 |
commit | 802e1848ada7d95e867b178314ee89629680c771 (patch) | |
tree | d33bc7c6b42955601e290909e47bcb273292b30d /csharp/src/ProtocolBuffers/GeneratedBuilder.cs | |
parent | 252daef02beb27dfb271af8c191102bd24ffd3e3 (diff) | |
parent | f7b417ddfe63cb4d39775e5fd4560894cc547d65 (diff) | |
download | protobuf-802e1848ada7d95e867b178314ee89629680c771.tar.gz protobuf-802e1848ada7d95e867b178314ee89629680c771.tar.bz2 protobuf-802e1848ada7d95e867b178314ee89629680c771.zip |
Merge pull request #404 from anandolee/master
Add oneof support for c#
Diffstat (limited to 'csharp/src/ProtocolBuffers/GeneratedBuilder.cs')
-rw-r--r-- | csharp/src/ProtocolBuffers/GeneratedBuilder.cs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/csharp/src/ProtocolBuffers/GeneratedBuilder.cs b/csharp/src/ProtocolBuffers/GeneratedBuilder.cs index e60a4201..0f121ae8 100644 --- a/csharp/src/ProtocolBuffers/GeneratedBuilder.cs +++ b/csharp/src/ProtocolBuffers/GeneratedBuilder.cs @@ -105,6 +105,16 @@ namespace Google.ProtocolBuffers set { InternalFieldAccessors[field].SetRepeated(ThisBuilder, index, value); }
}
+ public override bool HasOneof(OneofDescriptor oneof)
+ {
+ return MessageBeingBuilt.HasOneof(oneof);
+ }
+
+ public override FieldDescriptor OneofFieldDescriptor(OneofDescriptor oneof)
+ {
+ return MessageBeingBuilt.OneofFieldDescriptor(oneof);
+ }
+
public override bool HasField(FieldDescriptor field)
{
return MessageBeingBuilt.HasField(field);
@@ -121,6 +131,12 @@ namespace Google.ProtocolBuffers return ThisBuilder;
}
+ public override TBuilder ClearOneof(OneofDescriptor oneof)
+ {
+ InternalFieldAccessors.Oneof(oneof).Clear(ThisBuilder);
+ return ThisBuilder;
+ }
+
public override TBuilder MergeFrom(TMessage other)
{
if (other.DescriptorForType != InternalFieldAccessors.Descriptor)
|