csharp_options.proto 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. // Extra options for C# generator
  2. import "google/protobuf/descriptor.proto";
  3. package google.protobuf;
  4. message CSharpFileOptions {
  5. // Namespace for generated classes; defaults to the package.
  6. optional string namespace = 1;
  7. // Name of the "umbrella" class used for metadata about all
  8. // the messages within this file. Default is based on the name
  9. // of the file.
  10. optional string umbrella_classname = 2;
  11. // Whether classes should be public (true) or internal (false)
  12. optional bool public_classes = 3 [default = true];
  13. // Whether to generate a single file for everything within the
  14. // .proto file (false), or one file per message (true).
  15. // This option is not currently honored; please log a feature
  16. // request if you really want it.
  17. optional bool multiple_files = 4;
  18. // Whether to nest messages within a single umbrella class (true)
  19. // or create the umbrella class as a peer, with messages as
  20. // top-level classes in the namespace (false)
  21. optional bool nest_classes = 5;
  22. // Generate appropriate support for Code Contracts
  23. // (Ongoing; support should improve over time)
  24. optional bool code_contracts = 6;
  25. // Create subdirectories for namespaces, e.g. namespace "Foo.Bar"
  26. // would generate files within [output directory]/Foo/Bar
  27. optional bool expand_namespace_directories = 7;
  28. // Generate attributes indicating non-CLS-compliance
  29. optional bool cls_compliance = 8 [default = true];
  30. // Generate messages/builders with the [Serializable] attribute
  31. optional bool add_serializable = 9 [default = false];
  32. // The extension that should be appended to the umbrella_classname when creating files.
  33. optional string file_extension = 221 [default = ".cs"];
  34. // A nested namespace for the umbrella class. Helpful for name collisions caused by
  35. // umbrella_classname conflicting with an existing type. This will be automatically
  36. // set to 'Proto' if a collision is detected with types being generated. This value
  37. // is ignored when nest_classes == true
  38. optional string umbrella_namespace = 222;
  39. // The output path for the source file(s) generated
  40. optional string output_directory = 223 [default = "."];
  41. // Will ignore the type generations and remove dependencies for the descriptor proto
  42. // files that declare their package to be "google.protobuf"
  43. optional bool ignore_google_protobuf = 224 [default = false];
  44. // Controls how services are generated, GENERIC is the deprecated original implementation
  45. // INTERFACE generates service interfaces only, RPCINTEROP generates interfaces and
  46. // implementations using the included Windows RPC interop libarary.
  47. optional CSharpServiceType service_generator_type = 225 [default = NONE];
  48. }
  49. enum CSharpServiceType {
  50. // Services are ignored by the generator
  51. NONE = 0;
  52. // Generates the original Java generic service implementations
  53. GENERIC = 1;
  54. // Generates an interface for the service and nothing else
  55. INTERFACE = 2;
  56. // Generates an interface for the service and client/server wrappers for the interface
  57. IRPCDISPATCH = 3;
  58. }
  59. extend FileOptions {
  60. optional CSharpFileOptions csharp_file_options = 1000;
  61. }
  62. extend FieldOptions {
  63. optional CSharpFieldOptions csharp_field_options = 1000;
  64. }
  65. message CSharpFieldOptions {
  66. // Provides the ability to override the name of the property
  67. // generated for this field. This is applied to all properties
  68. // and methods to do with this field, including HasFoo, FooCount,
  69. // FooList etc.
  70. optional string property_name = 1;
  71. }
  72. message CSharpServiceOptions {
  73. optional string interface_id = 1;
  74. }
  75. extend ServiceOptions {
  76. optional CSharpServiceOptions csharp_service_options = 1000;
  77. }
  78. message CSharpMethodOptions {
  79. optional int32 dispatch_id = 1;
  80. }
  81. extend MethodOptions {
  82. optional CSharpMethodOptions csharp_method_options = 1000;
  83. }