Skip to content
Snippets Groups Projects
Commit a967ee56 authored by Jan Tattermusch's avatar Jan Tattermusch
Browse files

support custom parsegeneratorparameter

parent 44f7c548
No related branches found
No related tags found
No related merge requests found
......@@ -68,6 +68,11 @@
#define GRPC_CUSTOM_PLUGINMAIN ::google::protobuf::compiler::PluginMain
#endif
#ifndef GRPC_CUSTOM_PARSEGENERATORPARAMETER
#include <google/protobuf/compiler/code_generator.h>
#define GRPC_CUSTOM_PARSEGENERATORPARAMETER ::google::protobuf::compiler::ParseGeneratorParameter
#endif
namespace grpc {
namespace protobuf {
typedef GRPC_CUSTOM_DESCRIPTOR Descriptor;
......@@ -81,6 +86,11 @@ static inline int PluginMain(int argc, char* argv[],
const CodeGenerator* generator) {
return GRPC_CUSTOM_PLUGINMAIN(argc, argv, generator);
}
static inline void ParseGeneratorParameter(const string& parameter,
std::vector<std::pair<string, string> >* options) {
GRPC_CUSTOM_PARSEGENERATORPARAMETER(parameter, options);
}
} // namespace compiler
namespace io {
typedef GRPC_CUSTOM_PRINTER Printer;
......
......@@ -48,6 +48,9 @@ class CSharpGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
const grpc::string &parameter,
grpc::protobuf::compiler::GeneratorContext *context,
grpc::string *error) const {
std::vector<std::pair<grpc::string, grpc::string> > options;
grpc::protobuf::compiler::ParseGeneratorParameter(parameter, &options);
grpc::string code = grpc_csharp_generator::GetServices(file);
if (code.size() == 0) {
return true; // don't generate a file if there are no services
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment