Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
a967ee56
Commit
a967ee56
authored
8 years ago
by
Jan Tattermusch
Browse files
Options
Downloads
Patches
Plain Diff
support custom parsegeneratorparameter
parent
44f7c548
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/compiler/config.h
+10
-0
10 additions, 0 deletions
src/compiler/config.h
src/compiler/csharp_plugin.cc
+3
-0
3 additions, 0 deletions
src/compiler/csharp_plugin.cc
with
13 additions
and
0 deletions
src/compiler/config.h
+
10
−
0
View file @
a967ee56
...
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
src/compiler/csharp_plugin.cc
+
3
−
0
View file @
a967ee56
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment