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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 struct Options cli_options; | 76 struct Options cli_options; |
77 | 77 |
78 for (int i = 0; i < options.size(); i++) { | 78 for (int i = 0; i < options.size(); i++) { |
79 if (options[i].first == "file_extension") { | 79 if (options[i].first == "file_extension") { |
80 cli_options.file_extension = options[i].second; | 80 cli_options.file_extension = options[i].second; |
81 } else if (options[i].first == "base_namespace") { | 81 } else if (options[i].first == "base_namespace") { |
82 cli_options.base_namespace = options[i].second; | 82 cli_options.base_namespace = options[i].second; |
83 cli_options.base_namespace_specified = true; | 83 cli_options.base_namespace_specified = true; |
84 } else if (options[i].first == "internal_access") { | 84 } else if (options[i].first == "internal_access") { |
85 cli_options.internal_access = true; | 85 cli_options.internal_access = true; |
| 86 } else if (options[i].first == "legacy_enum_values") { |
| 87 // TODO: Remove this before final release |
| 88 cli_options.legacy_enum_values = true; |
86 } else { | 89 } else { |
87 *error = "Unknown generator option: " + options[i].first; | 90 *error = "Unknown generator option: " + options[i].first; |
88 return false; | 91 return false; |
89 } | 92 } |
90 } | 93 } |
91 | 94 |
92 string filename_error = ""; | 95 string filename_error = ""; |
93 std::string filename = GetOutputFile(file, | 96 std::string filename = GetOutputFile(file, |
94 cli_options.file_extension, | 97 cli_options.file_extension, |
95 cli_options.base_namespace_specified, | 98 cli_options.base_namespace_specified, |
(...skipping 10 matching lines...) Expand all Loading... |
106 | 109 |
107 GenerateFile(file, &printer, &cli_options); | 110 GenerateFile(file, &printer, &cli_options); |
108 | 111 |
109 return true; | 112 return true; |
110 } | 113 } |
111 | 114 |
112 } // namespace csharp | 115 } // namespace csharp |
113 } // namespace compiler | 116 } // namespace compiler |
114 } // namespace protobuf | 117 } // namespace protobuf |
115 } // namespace google | 118 } // namespace google |
OLD | NEW |