aboutsummaryrefslogtreecommitdiff
path: root/csharp/src/ProtocolBuffers/IBuilder.cs
diff options
context:
space:
mode:
authorJie Luo <jieluo@google.com>2015-05-29 12:48:25 -0700
committerJie Luo <jieluo@google.com>2015-05-29 13:29:30 -0700
commitf7b417ddfe63cb4d39775e5fd4560894cc547d65 (patch)
tree2ffb9956310e6aeb46078e7ad58db94d517f1d86 /csharp/src/ProtocolBuffers/IBuilder.cs
parent55df12194f5f0348c3ddf0636c63ba2b3978fab5 (diff)
downloadprotobuf-f7b417ddfe63cb4d39775e5fd4560894cc547d65.tar.gz
protobuf-f7b417ddfe63cb4d39775e5fd4560894cc547d65.tar.bz2
protobuf-f7b417ddfe63cb4d39775e5fd4560894cc547d65.zip
Add oneof support for C#
Diffstat (limited to 'csharp/src/ProtocolBuffers/IBuilder.cs')
-rw-r--r--csharp/src/ProtocolBuffers/IBuilder.cs14
1 files changed, 14 insertions, 0 deletions
diff --git a/csharp/src/ProtocolBuffers/IBuilder.cs b/csharp/src/ProtocolBuffers/IBuilder.cs
index f9c0df61..e765464a 100644
--- a/csharp/src/ProtocolBuffers/IBuilder.cs
+++ b/csharp/src/ProtocolBuffers/IBuilder.cs
@@ -103,6 +103,11 @@ namespace Google.ProtocolBuffers
/// </summary>
object this[FieldDescriptor field, int index] { get; set; }
+
+ bool HasOneof(OneofDescriptor oneof);
+
+ FieldDescriptor OneofFieldDescriptor(OneofDescriptor oneof);
+
/// <summary>
/// <see cref="IMessage{TMessage, TBuilder}.HasField"/>
/// </summary>
@@ -125,6 +130,7 @@ namespace Google.ProtocolBuffers
IBuilder WeakAddRepeatedField(FieldDescriptor field, object value);
new IBuilder WeakClear();
IBuilder WeakClearField(FieldDescriptor field);
+ IBuilder WeakClearOneof(OneofDescriptor oneof);
IBuilder WeakMergeFrom(IMessage message);
new IBuilder WeakMergeFrom(ByteString data);
new IBuilder WeakMergeFrom(ByteString data, ExtensionRegistry registry);
@@ -228,6 +234,14 @@ namespace Google.ProtocolBuffers
TBuilder ClearField(FieldDescriptor field);
/// <summary>
+ /// Clears the oneof. This is exactly equivalent to calling the generated
+ /// Clear method corresponding to the oneof.
+ /// </summary>
+ /// <param name="oneof"></param>
+ /// <returns></returns>
+ TBuilder ClearOneof(OneofDescriptor oneof);
+
+ /// <summary>
/// Appends the given value as a new element for the specified repeated field.
/// </summary>
/// <exception cref="ArgumentException">the field is not a repeated field,