aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/compiler/objective_c_plugin.cc
diff options
context:
space:
mode:
authorGravatar Muxi Yan <mxyan@google.com>2017-06-05 11:57:12 -0700
committerGravatar Muxi Yan <mxyan@google.com>2017-06-05 11:57:12 -0700
commitc4f84819bd92ccc1851647727400407bb9366564 (patch)
treeeb2d40d237b3abf001d8dc6ac1fc9bd2c3346674 /src/compiler/objective_c_plugin.cc
parent88d937736548544077357a0bb74df52f275dec7e (diff)
Backward compatibility
Diffstat (limited to 'src/compiler/objective_c_plugin.cc')
-rw-r--r--src/compiler/objective_c_plugin.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/compiler/objective_c_plugin.cc b/src/compiler/objective_c_plugin.cc
index 466da4c3b4..92b9c828fb 100644
--- a/src/compiler/objective_c_plugin.cc
+++ b/src/compiler/objective_c_plugin.cc
@@ -59,8 +59,16 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
return true;
}
- ::grpc::string file_name =
- google::protobuf::compiler::objectivec::FilePath(file);
+ ::grpc::string file_name;
+
+ // Simple parameter parsing as we have only one parameter.
+ // TODO(mxyan): Complete parameter parsing.
+ bool dash_as_separator = (0 == parameter.compare("--filename-dash-as-separator"));
+ if (dash_as_separator) {
+ file_name = google::protobuf::compiler::objectivec::FilePath(file);
+ } else {
+ file_name = grpc_generator::FileNameInUpperCamel(file);
+ }
::grpc::string prefix = file->options().objc_class_prefix();
{
@@ -78,7 +86,7 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
::grpc::string proto_imports;
for (int i = 0; i < file->dependency_count(); i++) {
::grpc::string header =
- grpc_objective_c_generator::MessageHeaderName(file->dependency(i));
+ grpc_objective_c_generator::MessageHeaderName(file->dependency(i), dash_as_separator);
const grpc::protobuf::FileDescriptor *dependency = file->dependency(i);
if (IsProtobufLibraryBundledProtoFile(dependency)) {
::grpc::string base_name = header;