aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/compiler/csharp_generator.cc
diff options
context:
space:
mode:
authorGravatar yang-g <yangg@google.com>2015-08-28 11:33:52 -0700
committerGravatar yang-g <yangg@google.com>2015-08-28 11:33:52 -0700
commitc3ee1d5eb4aa790db7c309627286be5d60ff60ec (patch)
tree25d8aef9b0ba8f3fda6f604132790e91c26284cf /src/compiler/csharp_generator.cc
parent9b1f91e7eac88ba477871a60912cc3b6ed3380ed (diff)
Do not include internal proto header
Diffstat (limited to 'src/compiler/csharp_generator.cc')
-rw-r--r--src/compiler/csharp_generator.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/compiler/csharp_generator.cc b/src/compiler/csharp_generator.cc
index 51d8d982e2..7b497df7f4 100644
--- a/src/compiler/csharp_generator.cc
+++ b/src/compiler/csharp_generator.cc
@@ -33,6 +33,7 @@
#include <cctype>
#include <map>
+#include <sstream>
#include <vector>
#include "src/compiler/csharp_generator.h"
@@ -44,7 +45,6 @@
using google::protobuf::compiler::csharp::GetFileNamespace;
using google::protobuf::compiler::csharp::GetClassName;
using google::protobuf::compiler::csharp::GetUmbrellaClassName;
-using google::protobuf::SimpleItoa;
using grpc::protobuf::FileDescriptor;
using grpc::protobuf::Descriptor;
using grpc::protobuf::ServiceDescriptor;
@@ -228,11 +228,14 @@ void GenerateStaticMethodField(Printer* out, const MethodDescriptor *method) {
}
void GenerateServiceDescriptorProperty(Printer* out, const ServiceDescriptor *service) {
+ std::ostringstream index;
+ index << service->index();
out->Print("// service descriptor\n");
out->Print("public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor\n");
out->Print("{\n");
out->Print(" get { return $umbrella$.Descriptor.Services[$index$]; }\n",
- "umbrella", GetUmbrellaClassName(service->file()), "index", SimpleItoa(service->index()));
+ "umbrella", GetUmbrellaClassName(service->file()), "index",
+ index.str());
out->Print("}\n");
out->Print("\n");
}