aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/compiler/objective_c_plugin.cc
diff options
context:
space:
mode:
authorGravatar Jorge Canizales <jcanizales@google.com>2015-08-13 18:41:29 -0700
committerGravatar Jorge Canizales <jcanizales@google.com>2015-08-13 18:41:29 -0700
commitb015dfb55a43b73e0e67e29a2e4d4633023bb13a (patch)
tree9e77a2fb2ee722d300179daa56e4f8b0df2a5a65 /src/compiler/objective_c_plugin.cc
parent685674c554dab842c6797057e1b656b5c004dda1 (diff)
Add ::grpc:: prefix
Diffstat (limited to 'src/compiler/objective_c_plugin.cc')
-rw-r--r--src/compiler/objective_c_plugin.cc28
1 files changed, 14 insertions, 14 deletions
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 &parameter,
+ const ::grpc::string &parameter,
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 <ProtoRPC/ProtoService.h>\n"
"#import <RxLibrary/GRXWriteable.h>\n"
"#import <RxLibrary/GRXWriter.h>\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 <ProtoRPC/ProtoRPC.h>\n"
"#import <RxLibrary/GRXWriter+Immediate.h>\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<grpc::protobuf::io::ZeroCopyOutputStream> output(
context->Open(filename));
grpc::protobuf::io::CodedOutputStream coded_out(output.get());