diff options
author | Nicolas Noble <nnoble@google.com> | 2015-01-15 16:36:13 -0800 |
---|---|---|
committer | Nicolas Noble <nnoble@google.com> | 2015-01-15 17:33:09 -0800 |
commit | f5c5d80968a466ceb999fe51cb33e6dc871b762e (patch) | |
tree | 150ca7649270dd6f041018c96eb002bf518bd260 /src/compiler/ruby_generator.cc | |
parent | 07c7c680e89e28444d1dad9718c98a81419ede64 (diff) |
Removing "using namespace std" everywhere.
Diffstat (limited to 'src/compiler/ruby_generator.cc')
-rw-r--r-- | src/compiler/ruby_generator.cc | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/compiler/ruby_generator.cc b/src/compiler/ruby_generator.cc index fae8858ff7..7795515b34 100644 --- a/src/compiler/ruby_generator.cc +++ b/src/compiler/ruby_generator.cc @@ -56,17 +56,17 @@ namespace grpc_ruby_generator { namespace { // Prints out the method using the ruby gRPC DSL. -void PrintMethod(const MethodDescriptor* method, const string& package, +void PrintMethod(const MethodDescriptor* method, const std::string& package, Printer* out) { - string input_type = RubyTypeOf(method->input_type()->name(), package); + std::string input_type = RubyTypeOf(method->input_type()->name(), package); if (method->client_streaming()) { input_type = "stream(" + input_type + ")"; } - string output_type = RubyTypeOf(method->output_type()->name(), package); + std::string output_type = RubyTypeOf(method->output_type()->name(), package); if (method->server_streaming()) { output_type = "stream(" + output_type + ")"; } - map<string, string> method_vars = ListToDict({ + std::map<std::string, std::string> method_vars = ListToDict({ "mth.name", method->name(), "input.type", input_type, "output.type", output_type, }); @@ -74,22 +74,22 @@ void PrintMethod(const MethodDescriptor* method, const string& package, } // Prints out the service using the ruby gRPC DSL. -void PrintService(const ServiceDescriptor* service, const string& package, +void PrintService(const ServiceDescriptor* service, const std::string& package, Printer* out) { if (service->method_count() == 0) { return; } // Begin the service module - map<string, string> module_vars = ListToDict({ + std::map<std::string, std::string> module_vars = ListToDict({ "module.name", CapitalizeFirst(service->name()), }); out->Print(module_vars, "module $module.name$\n"); out->Indent(); // TODO(temiola): add documentation - string doc = "TODO: add proto service documentation here"; - map<string, string> template_vars = ListToDict({ + std::string doc = "TODO: add proto service documentation here"; + std::map<std::string, std::string> template_vars = ListToDict({ "Documentation", doc, }); out->Print("\n"); @@ -103,7 +103,7 @@ void PrintService(const ServiceDescriptor* service, const string& package, out->Print("\n"); out->Print("self.marshal_class_method = :encode\n"); out->Print("self.unmarshal_class_method = :decode\n"); - map<string, string> pkg_vars = ListToDict({ + std::map<std::string, std::string> pkg_vars = ListToDict({ "service.name", service->name(), "pkg.name", package, }); out->Print(pkg_vars, "self.service_name = '$pkg.name$.$service.name$'\n"); @@ -124,8 +124,8 @@ void PrintService(const ServiceDescriptor* service, const string& package, } // namespace -string GetServices(const FileDescriptor* file) { - string output; +std::string GetServices(const FileDescriptor* file) { + std::string output; StringOutputStream output_stream(&output); Printer out(&output_stream, '$'); @@ -136,7 +136,7 @@ string GetServices(const FileDescriptor* file) { } // Write out a file header. - map<string, string> header_comment_vars = ListToDict({ + std::map<std::string, std::string> header_comment_vars = ListToDict({ "file.name", file->name(), "file.package", file->package(), }); out.Print("# Generated by the protocol buffer compiler. DO NOT EDIT!\n"); @@ -148,16 +148,16 @@ string GetServices(const FileDescriptor* file) { // Write out require statemment to import the separately generated file // that defines the messages used by the service. This is generated by the // main ruby plugin. - map<string, string> dep_vars = ListToDict({ + std::map<std::string, std::string> dep_vars = ListToDict({ "dep.name", MessagesRequireName(file), }); out.Print(dep_vars, "require '$dep.name$'\n"); // Write out services within the modules out.Print("\n"); - vector<string> modules = Split(file->package(), '.'); + std::vector<std::string> modules = Split(file->package(), '.'); for (size_t i = 0; i < modules.size(); ++i) { - map<string, string> module_vars = ListToDict({ + std::map<std::string, std::string> module_vars = ListToDict({ "module.name", CapitalizeFirst(modules[i]), }); out.Print(module_vars, "module $module.name$\n"); |