""";
var set = new FileDescriptorSet();
set.Add("some.proto", source: new StringReader(schema));
set.Process();
foreach (var file in set.Files)
{
Console.WriteLine($"in {file.Name}");
foreach (var msg in file.MessageTypes)
{
Console.WriteLine(msg.Name);
foreach (var field in msg.Fields)
{
Console.WriteLine($"> {field.Name}");
}
}
Console.WriteLine();
}
This is entirely managed code (i.e. no "shell to protoc"). The API is basically identical to the Google one - the idea is that the type system is binary compatible (i.e. you can serialize it as protobuf and you'd get the same thing that protoc would give, in binary mode)