From b015dfb55a43b73e0e67e29a2e4d4633023bb13a Mon Sep 17 00:00:00 2001 From: Jorge Canizales Date: Thu, 13 Aug 2015 18:41:29 -0700 Subject: Add ::grpc:: prefix --- src/compiler/objective_c_plugin.cc | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/compiler/objective_c_plugin.cc') diff --git a/src/compiler/objective_c_plugin.cc b/src/compiler/objective_c_plugin.cc index 10f06ad4df..17440358bb 100644 --- a/src/compiler/objective_c_plugin.cc +++ b/src/compiler/objective_c_plugin.cc @@ -39,44 +39,43 @@ #include "src/compiler/objective_c_generator.h" #include "src/compiler/objective_c_generator_helpers.h" -using ::grpc::string; - class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { public: ObjectiveCGrpcGenerator() {} virtual ~ObjectiveCGrpcGenerator() {} virtual bool Generate(const grpc::protobuf::FileDescriptor *file, - const string ¶meter, + const ::grpc::string ¶meter, grpc::protobuf::compiler::GeneratorContext *context, - string *error) const { + ::grpc::string *error) const { if (file->service_count() == 0) { // No services. Do nothing. return true; } - string file_name = grpc_generator::FileNameInUpperCamel(file); - string prefix = file->options().objc_class_prefix(); + ::grpc::string file_name = grpc_generator::FileNameInUpperCamel(file); + ::grpc::string prefix = file->options().objc_class_prefix(); { // Generate .pbrpc.h - string imports = string("#import \"") + file_name + ".pbobjc.h\"\n\n" + ::grpc::string imports = ::grpc::string("#import \"") + file_name + + ".pbobjc.h\"\n\n" "#import \n" "#import \n" "#import \n"; // TODO(jcanizales): Instead forward-declare the input and output types // and import the files in the .pbrpc.m - string proto_imports; + ::grpc::string proto_imports; for (int i = 0; i < file->dependency_count(); i++) { - string header = grpc_objective_c_generator::MessageHeaderName( + ::grpc::string header = grpc_objective_c_generator::MessageHeaderName( file->dependency(i)); - proto_imports += string("#import \"") + header + "\"\n"; + proto_imports += ::grpc::string("#import \"") + header + "\"\n"; } - string declarations; + ::grpc::string declarations; for (int i = 0; i < file->service_count(); i++) { const grpc::protobuf::ServiceDescriptor *service = file->service(i); declarations += grpc_objective_c_generator::GetHeader(service); @@ -89,11 +88,12 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { { // Generate .pbrpc.m - string imports = string("#import \"") + file_name + ".pbrpc.h\"\n\n" + ::grpc::string imports = ::grpc::string("#import \"") + file_name + + ".pbrpc.h\"\n\n" "#import \n" "#import \n"; - string definitions; + ::grpc::string definitions; for (int i = 0; i < file->service_count(); i++) { const grpc::protobuf::ServiceDescriptor *service = file->service(i); definitions += grpc_objective_c_generator::GetSource(service); @@ -108,7 +108,7 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { private: // Write the given code into the given file. void Write(grpc::protobuf::compiler::GeneratorContext *context, - const string &filename, const string &code) const { + const ::grpc::string &filename, const ::grpc::string &code) const { std::unique_ptr output( context->Open(filename)); grpc::protobuf::io::CodedOutputStream coded_out(output.get()); -- cgit v1.2.3