Removed constants kPackageName and kServiceName so multiple services
can be defined in one proto.
pull/6855/head
Makarand Dharmapurikar 9 years ago
parent 1bc2976a0f
commit 857495ae44
  1. 9
      src/compiler/objective_c_generator.cc

@ -220,18 +220,13 @@ void PrintMethodImplementations(Printer *printer,
{"service_class", ServiceClassName(service)}, {"service_class", ServiceClassName(service)},
{"package", service->file()->package()}}; {"package", service->file()->package()}};
printer.Print(vars,
"static NSString *const kPackageName = @\"$package$\";\n");
printer.Print(
vars, "static NSString *const kServiceName = @\"$service_name$\";\n\n");
printer.Print(vars, "@implementation $service_class$\n\n"); printer.Print(vars, "@implementation $service_class$\n\n");
printer.Print("// Designated initializer\n"); printer.Print("// Designated initializer\n");
printer.Print("- (instancetype)initWithHost:(NSString *)host {\n"); printer.Print("- (instancetype)initWithHost:(NSString *)host {\n");
printer.Print( printer.Print(vars,
" return (self = [super initWithHost:host" " return (self = [super initWithHost:host"
" packageName:kPackageName serviceName:kServiceName]);\n"); " packageName:@\"$package$\" serviceName:@\"$service_name$\"]);\n");
printer.Print("}\n\n"); printer.Print("}\n\n");
printer.Print( printer.Print(
"// Override superclass initializer to disallow different" "// Override superclass initializer to disallow different"

Loading…
Cancel
Save