Пример #1
0
 public SourceCodeInfo.Types.Location GetDoc(IEnumerable <int> path)
 {
     if (path == null)
     {
         return(null);
     }
     return(FileDocFactory.GetDoc(
                path?.Prepend(Message).Prepend(4).ToArray()
                ));
 }
Пример #2
0
        public SourceCodeInfo.Types.Location GetDoc(params int[] path)
        {
            if (path == null)
            {
                return(null);
            }
            var newPath = new int[path.Length + 2];

            newPath[0] = 6;
            newPath[1] = Service;
            Array.Copy(path, 0, newPath, 2, path.Length);
            return(FileDocFactory.GetDoc(newPath));
        }
Пример #3
0
        static void WorkSingleBinFile(string file)
        {
            if (settings.Verbose)
            {
                Console.WriteLine($"Read protobuf descriptor of {file}...");
            }
            FileDescriptorSet descriptor;

            using var stream = new FileStream(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
            try { descriptor = FileDescriptorSet.Parser.ParseFrom(stream); }
            catch (Exception e)
            {
                Console.Error.WriteLine(e);
                return;
            }

            var docs = new Docs.DocFactory(descriptor);

            if (settings.Verbose)
            {
                Console.WriteLine("Load type list...");
            }
            List <NameInfo> names = new List <NameInfo>();

            for (int i = 0; i < descriptor.File.Count; ++i)
            {
                LoadTypes(
                    descriptor.File[i],
                    new Docs.FileDocFactory(docs, i),
                    names
                    );
            }

            for (int i = 0; i < descriptor.File.Count; ++i)
            {
                var filedesc = descriptor.File[i];
                var filedoc  = new Docs.FileDocFactory(docs, i);
                for (int j = 0; j < filedesc.Service.Count; ++j)
                {
                    WorkSingleEntry(
                        new Docs.ServiceDocFactory(filedoc, j),
                        filedesc,
                        filedesc.Service[j],
                        names,
                        file
                        );
                }
            }
        }
Пример #4
0
 public EnumDocFactory(FileDocFactory docFactory, int message)
 {
     DocFactory = docFactory ?? throw new ArgumentNullException(nameof(docFactory));
     Message    = message;
     fieldId    = 5;
 }
Пример #5
0
 public BaseMessageDocFactory(FileDocFactory docFactory, int message)
 {
     FileDocFactory = docFactory ?? throw new ArgumentNullException(nameof(docFactory));
     Message        = message;
 }
Пример #6
0
 public SourceCodeInfo.Types.Location GetServiceRpcDoc(int rpcIndex)
 => FileDocFactory.GetServiceRpcDoc(Service, rpcIndex);
Пример #7
0
 public SourceCodeInfo.Types.Location GetServiceDoc()
 => FileDocFactory.GetServiceDoc(Service);
Пример #8
0
 public ServiceDocFactory(FileDocFactory docFactory, int serviceIndex)
 {
     FileDocFactory = docFactory ?? throw new ArgumentNullException(nameof(docFactory));
     Service        = serviceIndex;
 }