Go to the documentation of this file.
33 #include <google/protobuf/compiler/code_generator.h>
34 #include <google/protobuf/descriptor.h>
35 #include <google/protobuf/descriptor.pb.h>
36 #include <google/protobuf/io/printer.h>
37 #include <google/protobuf/io/zero_copy_stream.h>
38 #include <google/protobuf/stubs/strutil.h>
40 #include <google/protobuf/compiler/csharp/csharp_doc_comment.h>
41 #include <google/protobuf/compiler/csharp/csharp_enum.h>
42 #include <google/protobuf/compiler/csharp/csharp_helpers.h>
43 #include <google/protobuf/compiler/csharp/csharp_options.h>
60 printer->Print(
"$access_level$ enum $name$ {\n",
64 std::set<std::string> used_names;
65 std::set<int> used_number;
72 while (!used_names.insert(
name).second) {
75 <<
") in " <<
descriptor_->
name() <<
"; adding underscore to distinguish";
79 if (!used_number.insert(
number).second) {
80 printer->Print(
"[pbr::OriginalName(\"$original_name$\", PreferredAlias = false)] $name$ = $number$,\n",
81 "original_name", original_name,
85 printer->Print(
"[pbr::OriginalName(\"$original_name$\")] $name$ = $number$,\n",
86 "original_name", original_name,
92 printer->Print(
"}\n");
void WriteEnumDocComment(io::Printer *printer, const EnumDescriptor *enumDescriptor)
GRPC_CUSTOM_PRINTER Printer
const EnumDescriptor * descriptor_
void Generate(io::Printer *printer)
string StrCat(const AlphaNum &a, const AlphaNum &b)
const std::string & name() const
const std::string & name() const
const EnumValueDescriptor * value(int index) const
static const LogLevel WARNING
EnumGenerator(const EnumDescriptor *descriptor, const Options *options)
void WriteEnumValueDocComment(io::Printer *printer, const EnumValueDescriptor *value)
std::string class_access_level()
std::string GetEnumValueName(const std::string &enum_name, const std::string &enum_value_name)
#define GOOGLE_LOG(LEVEL)
static const char descriptor[1336]
grpc
Author(s):
autogenerated on Fri May 16 2025 02:58:07