1 | /* |
2 | * |
3 | * Copyright 2015 gRPC authors. |
4 | * |
5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
6 | * you may not use this file except in compliance with the License. |
7 | * You may obtain a copy of the License at |
8 | * |
9 | * http://www.apache.org/licenses/LICENSE-2.0 |
10 | * |
11 | * Unless required by applicable law or agreed to in writing, software |
12 | * distributed under the License is distributed on an "AS IS" BASIS, |
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
14 | * See the License for the specific language governing permissions and |
15 | * limitations under the License. |
16 | * |
17 | */ |
18 | |
19 | #ifndef SRC_COMPILER_CONFIG_H |
20 | #define SRC_COMPILER_CONFIG_H |
21 | |
22 | #include "src/compiler/config_protobuf.h" |
23 | |
24 | #ifndef GRPC_CUSTOM_STRING |
25 | #include <string> |
26 | #define GRPC_CUSTOM_STRING std::string |
27 | #endif |
28 | |
29 | namespace grpc { |
30 | |
31 | typedef GRPC_CUSTOM_STRING string; |
32 | |
33 | namespace protobuf { |
34 | |
35 | namespace compiler { |
36 | typedef GRPC_CUSTOM_CODEGENERATOR CodeGenerator; |
37 | typedef GRPC_CUSTOM_GENERATORCONTEXT GeneratorContext; |
38 | static inline int PluginMain(int argc, char* argv[], |
39 | const CodeGenerator* generator) { |
40 | return GRPC_CUSTOM_PLUGINMAIN(argc, argv, generator); |
41 | } |
42 | static inline void ParseGeneratorParameter( |
43 | const string& parameter, std::vector<std::pair<string, string> >* options) { |
44 | GRPC_CUSTOM_PARSEGENERATORPARAMETER(parameter, options); |
45 | } |
46 | |
47 | } // namespace compiler |
48 | namespace io { |
49 | typedef GRPC_CUSTOM_PRINTER Printer; |
50 | typedef GRPC_CUSTOM_CODEDOUTPUTSTREAM CodedOutputStream; |
51 | typedef GRPC_CUSTOM_STRINGOUTPUTSTREAM StringOutputStream; |
52 | } // namespace io |
53 | } // namespace protobuf |
54 | } // namespace grpc |
55 | |
56 | namespace grpc_cpp_generator { |
57 | |
58 | static const char* const = ".pb.h" ; |
59 | static const char* const = ".grpc.pb.h" ; |
60 | |
61 | } // namespace grpc_cpp_generator |
62 | |
63 | #endif // SRC_COMPILER_CONFIG_H |
64 | |