Lines Matching refs:proto
46 /// The syntax of a .proto file
65 /// Describes a .proto file, including everything defined within.
83 private FileDescriptor(ByteString descriptorData, FileDescriptorProto proto, IEnumerable<FileDescriptor> dependencies, DescriptorPool pool, bool allowUnknownDependencies, GeneratedClrTypeInfo generatedCodeInfo)
87 Proto = proto;
90 PublicDependencies = DeterminePublicDependencies(this, proto, dependencies, allowUnknownDependencies);
94 MessageTypes = DescriptorUtil.ConvertAndMakeReadOnly(proto.MessageType,
98 EnumTypes = DescriptorUtil.ConvertAndMakeReadOnly(proto.EnumType,
102 Services = DescriptorUtil.ConvertAndMakeReadOnly(proto.Service,
110 if (!proto.HasSyntax || proto.Syntax == "proto2")
114 else if (proto.Syntax == "proto3")
218 private static IList<FileDescriptor> DeterminePublicDependencies(FileDescriptor @this, FileDescriptorProto proto, IEnumerable<FileDescriptor> dependencies, bool allowUnknownDependencies)
222 for (int i = 0; i < proto.PublicDependency.Count; i++)
224 int index = proto.PublicDependency[i];
225 if (index < 0 || index >= proto.Dependency.Count)
229 string name = proto.Dependency[index];
263 /// The package as declared in the .proto file. This may or may not
354 /// <param name="proto">The protocol message form of the FileDescriptor.</param>
356 /// file's dependencies, in the exact order listed in the .proto file. May be null,
360 /// <exception cref="DescriptorValidationException">If <paramref name="proto"/> is not
363 private static FileDescriptor BuildFrom(ByteString descriptorData, FileDescriptorProto proto, FileDescriptor[] dependencies, bool allowUnknownDependencies, GeneratedClrTypeInfo generatedCodeInfo)
380 FileDescriptor result = new FileDescriptor(descriptorData, proto, dependencies, pool, allowUnknownDependencies, generatedCodeInfo);
384 if (dependencies.Length != proto.Dependency.Count)
427 FileDescriptorProto proto;
430 proto = FileDescriptorProto.Parser.WithExtensionRegistry(registry).ParseFrom(descriptorData);
441 return BuildFrom(ByteString.CopyFrom(descriptorData), proto, dependencies, true, generatedCodeInfo);
445 throw new ArgumentException($"Invalid embedded descriptor for \"{proto.Name}\".", e);
480 /// <param name="descriptorData">The binary file descriptor proto data. Must not be null, and any
495 var proto = FileDescriptorProto.Parser.ParseFrom(data);
497 foreach (var dependencyName in proto.Dependency)
508 data, proto, dependencies, pool,
533 /// Returns the file descriptor for descriptor.proto.
536 /// This is used for protos which take a direct dependency on <c>descriptor.proto</c>, typically for
537 /// annotations. While <c>descriptor.proto</c> is a proto2 file, it is built into the Google.Protobuf
540 /// C# codegen in protoc automatically uses this property when it detects a dependency on <c>descriptor.proto</c>.
543 /// The file descriptor for <c>descriptor.proto</c>.
554 /// The <c>FileOptions</c>, defined in <c>descriptor.proto</c>.