diff --git a/src/compiler/cpp_plugin.cc b/src/compiler/cpp_plugin.cc index f1a1d809396102f1fdbf8caaa851f98b9249854b..a4c6f011c75c7c9c0566dc576767838c254cc48f 100644 --- a/src/compiler/cpp_plugin.cc +++ b/src/compiler/cpp_plugin.cc @@ -43,7 +43,7 @@ #include "src/compiler/cpp_generator_helpers.h" #include "src/compiler/generator_helpers.h" -using grpc_generator::GetComments; +using grpc_generator::GetCppComments; class ProtoBufMethod : public grpc_cpp_generator::Method { public: @@ -75,10 +75,12 @@ class ProtoBufMethod : public grpc_cpp_generator::Method { return method_->client_streaming() && method_->server_streaming(); } - grpc::string GetLeadingComments() const { return GetComments(method_, true); } + grpc::string GetLeadingComments() const { + return GetCppComments(method_, true); + } grpc::string GetTrailingComments() const { - return GetComments(method_, false); + return GetCppComments(method_, false); } private: @@ -99,11 +101,11 @@ class ProtoBufService : public grpc_cpp_generator::Service { }; grpc::string GetLeadingComments() const { - return GetComments(service_, true); + return GetCppComments(service_, true); } grpc::string GetTrailingComments() const { - return GetComments(service_, false); + return GetCppComments(service_, false); } private: @@ -154,9 +156,13 @@ class ProtoBufFile : public grpc_cpp_generator::File { new ProtoBufPrinter(str)); } - grpc::string GetLeadingComments() const { return GetComments(file_, true); } + grpc::string GetLeadingComments() const { + return GetCppComments(file_, true); + } - grpc::string GetTrailingComments() const { return GetComments(file_, false); } + grpc::string GetTrailingComments() const { + return GetCppComments(file_, false); + } private: const grpc::protobuf::FileDescriptor *file_; diff --git a/src/compiler/generator_helpers.h b/src/compiler/generator_helpers.h index 4e32e76a0566f2834153b3f229a6a34aded17f23..93bf3b85d30a3fe032fb677e6220eac5b0cb60d7 100644 --- a/src/compiler/generator_helpers.h +++ b/src/compiler/generator_helpers.h @@ -258,7 +258,7 @@ inline grpc::string GenerateCommentsWithPrefix( // Get leading or trailing comments in a string. Comment lines start with "// ". // Leading detached comments are put in in front of leading comments. template <typename DescriptorType> -inline grpc::string GetComments(const DescriptorType *desc, bool leading) { +inline grpc::string GetCppComments(const DescriptorType *desc, bool leading) { std::vector<grpc::string> out; if (leading) { grpc_generator::GetComment(