aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/compiler/objectivec/objectivec_generator.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/google/protobuf/compiler/objectivec/objectivec_generator.cc')
-rw-r--r--src/google/protobuf/compiler/objectivec/objectivec_generator.cc20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/google/protobuf/compiler/objectivec/objectivec_generator.cc b/src/google/protobuf/compiler/objectivec/objectivec_generator.cc
index 375b4e0f..72e295de 100644
--- a/src/google/protobuf/compiler/objectivec/objectivec_generator.cc
+++ b/src/google/protobuf/compiler/objectivec/objectivec_generator.cc
@@ -49,21 +49,31 @@ bool ObjectiveCGenerator::Generate(const FileDescriptor* file,
const string& parameter,
OutputDirectory* output_directory,
string* error) const {
- // ObjC doesn't have any options at the moment, error if passed one.
+ // -----------------------------------------------------------------
+ // Parse generator options.
+
+ Options generation_options;
+
vector<pair<string, string> > options;
ParseGeneratorParameter(parameter, &options);
for (int i = 0; i < options.size(); i++) {
- *error = "error:: Unknown generator option: " + options[i].first;
- return false;
+ if (options[i].first == "expected_prefixes_path") {
+ generation_options.expected_prefixes_path = options[i].second;
+ } else {
+ *error = "error: Unknown generator option: " + options[i].first;
+ return false;
+ }
}
+ // -----------------------------------------------------------------
+
// Validate the objc prefix/package pairing.
- if (!ValidateObjCClassPrefix(file, error)) {
+ if (!ValidateObjCClassPrefix(file, generation_options, error)) {
// *error will have been filled in.
return false;
}
- FileGenerator file_generator(file);
+ FileGenerator file_generator(file, generation_options);
string filepath = FilePath(file);
// Generate header.