diff options
Diffstat (limited to 'src/google/protobuf/compiler/java/java_generator.cc')
-rw-r--r-- | src/google/protobuf/compiler/java/java_generator.cc | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/src/google/protobuf/compiler/java/java_generator.cc b/src/google/protobuf/compiler/java/java_generator.cc index 51af5f0d..8ed3affb 100644 --- a/src/google/protobuf/compiler/java/java_generator.cc +++ b/src/google/protobuf/compiler/java/java_generator.cc @@ -45,32 +45,6 @@ namespace protobuf { namespace compiler { namespace java { -namespace { - -// Parses a set of comma-delimited name/value pairs, e.g.: -// "foo=bar,baz,qux=corge" -// parses to the pairs: -// ("foo", "bar"), ("baz", ""), ("qux", "corge") -void ParseOptions(const string& text, vector<pair<string, string> >* output) { - vector<string> parts; - SplitStringUsing(text, ",", &parts); - - for (int i = 0; i < parts.size(); i++) { - string::size_type equals_pos = parts[i].find_first_of('='); - pair<string, string> value; - if (equals_pos == string::npos) { - value.first = parts[i]; - value.second = ""; - } else { - value.first = parts[i].substr(0, equals_pos); - value.second = parts[i].substr(equals_pos + 1); - } - output->push_back(value); - } -} - -} // namespace - JavaGenerator::JavaGenerator() {} JavaGenerator::~JavaGenerator() {} @@ -79,7 +53,7 @@ bool JavaGenerator::Generate(const FileDescriptor* file, OutputDirectory* output_directory, string* error) const { vector<pair<string, string> > options; - ParseOptions(parameter, &options); + ParseGeneratorParameter(parameter, &options); // ----------------------------------------------------------------- // parse generator options |