aboutsummaryrefslogtreecommitdiff
path: root/csharp/src/ProtocolBuffers/Descriptors/FileDescriptor.cs
diff options
context:
space:
mode:
authorJie Luo <anandolee@gmail.com>2015-04-29 11:33:07 -0700
committerJie Luo <anandolee@gmail.com>2015-04-29 11:33:07 -0700
commitc5c9c6a7e05a44724bc4bc6192ff995b4398d559 (patch)
treebb4eab9a4c4830b7e6d91f83b1309498a9e41578 /csharp/src/ProtocolBuffers/Descriptors/FileDescriptor.cs
parent8bae6c09bc8c8be808f0acc9b2ad4c9811493060 (diff)
downloadprotobuf-c5c9c6a7e05a44724bc4bc6192ff995b4398d559.tar.gz
protobuf-c5c9c6a7e05a44724bc4bc6192ff995b4398d559.tar.bz2
protobuf-c5c9c6a7e05a44724bc4bc6192ff995b4398d559.zip
field presence Reflection and tests
Diffstat (limited to 'csharp/src/ProtocolBuffers/Descriptors/FileDescriptor.cs')
-rw-r--r--csharp/src/ProtocolBuffers/Descriptors/FileDescriptor.cs16
1 files changed, 16 insertions, 0 deletions
diff --git a/csharp/src/ProtocolBuffers/Descriptors/FileDescriptor.cs b/csharp/src/ProtocolBuffers/Descriptors/FileDescriptor.cs
index 354e99a3..8a3e26fa 100644
--- a/csharp/src/ProtocolBuffers/Descriptors/FileDescriptor.cs
+++ b/csharp/src/ProtocolBuffers/Descriptors/FileDescriptor.cs
@@ -54,6 +54,22 @@ namespace Google.ProtocolBuffers.Descriptors
private readonly IList<FileDescriptor> publicDependencies;
private readonly DescriptorPool pool;
+ public enum Syntax
+ {
+ UNKNOWN,
+ PROTO2,
+ PROTO3
+ }
+
+ public Syntax GetSyntax()
+ {
+ if (proto.Syntax == "proto3")
+ {
+ return Syntax.PROTO3;
+ }
+ return Syntax.PROTO2;
+ }
+
private FileDescriptor(FileDescriptorProto proto, FileDescriptor[] dependencies, DescriptorPool pool, bool allowUnknownDependencies)
{
this.pool = pool;