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
29namespace grpc {
30
31typedef GRPC_CUSTOM_STRING string;
32
33namespace protobuf {
34
35namespace compiler {
36typedef GRPC_CUSTOM_CODEGENERATOR CodeGenerator;
37typedef GRPC_CUSTOM_GENERATORCONTEXT GeneratorContext;
38static inline int PluginMain(int argc, char* argv[],
39 const CodeGenerator* generator) {
40 return GRPC_CUSTOM_PLUGINMAIN(argc, argv, generator);
41}
42static 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
48namespace io {
49typedef GRPC_CUSTOM_PRINTER Printer;
50typedef GRPC_CUSTOM_CODEDOUTPUTSTREAM CodedOutputStream;
51typedef GRPC_CUSTOM_STRINGOUTPUTSTREAM StringOutputStream;
52} // namespace io
53} // namespace protobuf
54} // namespace grpc
55
56namespace grpc_cpp_generator {
57
58static const char* const kCppGeneratorMessageHeaderExt = ".pb.h";
59static const char* const kCppGeneratorServiceHeaderExt = ".grpc.pb.h";
60
61} // namespace grpc_cpp_generator
62
63#endif // SRC_COMPILER_CONFIG_H
64