OLD | NEW |
1 // Protocol Buffers - Google's data interchange format | 1 // Protocol Buffers - Google's data interchange format |
2 // Copyright 2008 Google Inc. All rights reserved. | 2 // Copyright 2008 Google Inc. All rights reserved. |
3 // https://developers.google.com/protocol-buffers/ | 3 // https://developers.google.com/protocol-buffers/ |
4 // | 4 // |
5 // Redistribution and use in source and binary forms, with or without | 5 // Redistribution and use in source and binary forms, with or without |
6 // modification, are permitted provided that the following conditions are | 6 // modification, are permitted provided that the following conditions are |
7 // met: | 7 // met: |
8 // | 8 // |
9 // * Redistributions of source code must retain the above copyright | 9 // * Redistributions of source code must retain the above copyright |
10 // notice, this list of conditions and the following disclaimer. | 10 // notice, this list of conditions and the following disclaimer. |
(...skipping 27 matching lines...) Expand all Loading... |
38 namespace protobuf { | 38 namespace protobuf { |
39 namespace compiler { | 39 namespace compiler { |
40 namespace csharp { | 40 namespace csharp { |
41 | 41 |
42 // Generator options (used by csharp_generator.cc): | 42 // Generator options (used by csharp_generator.cc): |
43 struct Options { | 43 struct Options { |
44 Options() : | 44 Options() : |
45 file_extension(".cs"), | 45 file_extension(".cs"), |
46 base_namespace(""), | 46 base_namespace(""), |
47 base_namespace_specified(false), | 47 base_namespace_specified(false), |
48 internal_access(false) { | 48 internal_access(false), |
| 49 legacy_enum_values(false) { |
49 } | 50 } |
50 // Extension of the generated file. Defaults to ".cs" | 51 // Extension of the generated file. Defaults to ".cs" |
51 string file_extension; | 52 string file_extension; |
52 // Base namespace to use to create directory hierarchy. Defaults to "". | 53 // Base namespace to use to create directory hierarchy. Defaults to "". |
53 // This option allows the simple creation of a conventional C# file layout, | 54 // This option allows the simple creation of a conventional C# file layout, |
54 // where directories are created relative to a project-specific base | 55 // where directories are created relative to a project-specific base |
55 // namespace. For example, in a project with a base namespace of PetShop, a | 56 // namespace. For example, in a project with a base namespace of PetShop, a |
56 // proto of user.proto with a C# namespace of PetShop.Model.Shared would | 57 // proto of user.proto with a C# namespace of PetShop.Model.Shared would |
57 // generate Model/Shared/User.cs underneath the specified --csharp_out | 58 // generate Model/Shared/User.cs underneath the specified --csharp_out |
58 // directory. | 59 // directory. |
59 // | 60 // |
60 // If no base namespace is specified, all files are generated in the | 61 // If no base namespace is specified, all files are generated in the |
61 // --csharp_out directory, with no subdirectories created automatically. | 62 // --csharp_out directory, with no subdirectories created automatically. |
62 string base_namespace; | 63 string base_namespace; |
63 // Whether the base namespace has been explicitly specified by the user. | 64 // Whether the base namespace has been explicitly specified by the user. |
64 // This is required as the base namespace can be explicitly set to the empty | 65 // This is required as the base namespace can be explicitly set to the empty |
65 // string, meaning "create a full directory hierarchy, starting from the first | 66 // string, meaning "create a full directory hierarchy, starting from the first |
66 // segment of the namespace." | 67 // segment of the namespace." |
67 bool base_namespace_specified; | 68 bool base_namespace_specified; |
68 // Whether the generated classes should have accessibility level of "internal"
. | 69 // Whether the generated classes should have accessibility level of "internal"
. |
69 // Defaults to false that generates "public" classes. | 70 // Defaults to false that generates "public" classes. |
70 bool internal_access; | 71 bool internal_access; |
| 72 // By default, C# codegen now uses PascalCased enum values names, after |
| 73 // removing the enum type name as a prefix (if it *is* a prefix of the value). |
| 74 // Setting this option reverts to the previous behavior of just copying the |
| 75 // value name specified in the .proto file, allowing gradual migration. |
| 76 // This option will be removed before final release. |
| 77 bool legacy_enum_values; |
71 }; | 78 }; |
72 | 79 |
73 } // namespace csharp | 80 } // namespace csharp |
74 } // namespace compiler | 81 } // namespace compiler |
75 } // namespace protobuf | 82 } // namespace protobuf |
76 | 83 |
77 | 84 |
78 } // namespace google | 85 } // namespace google |
79 #endif // GOOGLE_PROTOBUF_COMPILER_CSHARP_OPTIONS_H__ | 86 #endif // GOOGLE_PROTOBUF_COMPILER_CSHARP_OPTIONS_H__ |
OLD | NEW |