|
|
|
@ -86,6 +86,8 @@ grpc::string FilenameIdentifier(const grpc::string &filename) { |
|
|
|
|
grpc::string GetHeaderPrologue(const grpc::protobuf::FileDescriptor *file, |
|
|
|
|
const Parameters ¶ms) { |
|
|
|
|
grpc::string output; |
|
|
|
|
{ |
|
|
|
|
// Scope the output stream so it closes and finalizes output to the string.
|
|
|
|
|
grpc::protobuf::io::StringOutputStream output_stream(&output); |
|
|
|
|
grpc::protobuf::io::Printer printer(&output_stream, '$'); |
|
|
|
|
std::map<grpc::string, grpc::string> vars; |
|
|
|
@ -102,7 +104,7 @@ grpc::string GetHeaderPrologue(const grpc::protobuf::FileDescriptor *file, |
|
|
|
|
printer.Print(vars, "\n"); |
|
|
|
|
printer.Print(vars, "#include \"$filename_base$.pb.h\"\n"); |
|
|
|
|
printer.Print(vars, "\n"); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
return output; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -626,6 +628,8 @@ void PrintHeaderService(grpc::protobuf::io::Printer *printer, |
|
|
|
|
grpc::string GetHeaderServices(const grpc::protobuf::FileDescriptor *file, |
|
|
|
|
const Parameters ¶ms) { |
|
|
|
|
grpc::string output; |
|
|
|
|
{ |
|
|
|
|
// Scope the output stream so it closes and finalizes output to the string.
|
|
|
|
|
grpc::protobuf::io::StringOutputStream output_stream(&output); |
|
|
|
|
grpc::protobuf::io::Printer printer(&output_stream, '$'); |
|
|
|
|
std::map<grpc::string, grpc::string> vars; |
|
|
|
@ -643,13 +647,15 @@ grpc::string GetHeaderServices(const grpc::protobuf::FileDescriptor *file, |
|
|
|
|
if (!params.services_namespace.empty()) { |
|
|
|
|
printer.Print(vars, "} // namespace $services_namespace$\n\n"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
return output; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
grpc::string GetHeaderEpilogue(const grpc::protobuf::FileDescriptor *file, |
|
|
|
|
const Parameters ¶ms) { |
|
|
|
|
grpc::string output; |
|
|
|
|
{ |
|
|
|
|
// Scope the output stream so it closes and finalizes output to the string.
|
|
|
|
|
grpc::protobuf::io::StringOutputStream output_stream(&output); |
|
|
|
|
grpc::protobuf::io::Printer printer(&output_stream, '$'); |
|
|
|
|
std::map<grpc::string, grpc::string> vars; |
|
|
|
@ -670,13 +676,15 @@ grpc::string GetHeaderEpilogue(const grpc::protobuf::FileDescriptor *file, |
|
|
|
|
|
|
|
|
|
printer.Print(vars, "\n"); |
|
|
|
|
printer.Print(vars, "#endif // GRPC_$filename_identifier$__INCLUDED\n"); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
return output; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
grpc::string GetSourcePrologue(const grpc::protobuf::FileDescriptor *file, |
|
|
|
|
const Parameters ¶ms) { |
|
|
|
|
grpc::string output; |
|
|
|
|
{ |
|
|
|
|
// Scope the output stream so it closes and finalizes output to the string.
|
|
|
|
|
grpc::protobuf::io::StringOutputStream output_stream(&output); |
|
|
|
|
grpc::protobuf::io::Printer printer(&output_stream, '$'); |
|
|
|
|
std::map<grpc::string, grpc::string> vars; |
|
|
|
@ -690,13 +698,15 @@ grpc::string GetSourcePrologue(const grpc::protobuf::FileDescriptor *file, |
|
|
|
|
printer.Print(vars, "#include \"$filename_base$.pb.h\"\n"); |
|
|
|
|
printer.Print(vars, "#include \"$filename_base$.grpc.pb.h\"\n"); |
|
|
|
|
printer.Print(vars, "\n"); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
return output; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
grpc::string GetSourceIncludes(const grpc::protobuf::FileDescriptor *file, |
|
|
|
|
const Parameters ¶m) { |
|
|
|
|
grpc::string output; |
|
|
|
|
{ |
|
|
|
|
// Scope the output stream so it closes and finalizes output to the string.
|
|
|
|
|
grpc::protobuf::io::StringOutputStream output_stream(&output); |
|
|
|
|
grpc::protobuf::io::Printer printer(&output_stream, '$'); |
|
|
|
|
std::map<grpc::string, grpc::string> vars; |
|
|
|
@ -719,7 +729,7 @@ grpc::string GetSourceIncludes(const grpc::protobuf::FileDescriptor *file, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
printer.Print(vars, "\n"); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
return output; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1077,6 +1087,8 @@ void PrintSourceService(grpc::protobuf::io::Printer *printer, |
|
|
|
|
grpc::string GetSourceServices(const grpc::protobuf::FileDescriptor *file, |
|
|
|
|
const Parameters ¶ms) { |
|
|
|
|
grpc::string output; |
|
|
|
|
{ |
|
|
|
|
// Scope the output stream so it closes and finalizes output to the string.
|
|
|
|
|
grpc::protobuf::io::StringOutputStream output_stream(&output); |
|
|
|
|
grpc::protobuf::io::Printer printer(&output_stream, '$'); |
|
|
|
|
std::map<grpc::string, grpc::string> vars; |
|
|
|
@ -1098,6 +1110,7 @@ grpc::string GetSourceServices(const grpc::protobuf::FileDescriptor *file, |
|
|
|
|
PrintSourceService(&printer, file->service(i), &vars); |
|
|
|
|
printer.Print("\n"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return output; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|