Go to the documentation of this file.
33 #include <google/protobuf/compiler/objectivec/objectivec_extension.h>
34 #include <google/protobuf/compiler/objectivec/objectivec_helpers.h>
35 #include <google/protobuf/descriptor.pb.h>
36 #include <google/protobuf/stubs/strutil.h>
37 #include <google/protobuf/io/printer.h>
42 namespace objectivec {
47 root_class_and_method_name_(root_class_name +
"_" + method_name_),
52 std::cerr <<
"error: Extension is a map<>!"
53 <<
" That used to be blocked by the compiler." << std::endl;
62 std::map<std::string, std::string> vars;
65 vars[
"storage_attribute"] =
" NS_RETURNS_NOT_RETAINED";
67 vars[
"storage_attribute"] =
"";
73 vars[
"comments"] =
"";
80 "+ (GPBExtensionDescriptor *)$method_name$$storage_attribute$$deprecated_attribute$;\n");
85 std::map<std::string, std::string> vars;
91 std::vector<std::string>
options;
95 options.push_back(
"GPBExtensionSetWireFormat");
104 vars[
"type"] =
"Nil";
109 vars[
"default"] =
"nil";
117 vars[
"enum_desc_func_name"] =
120 vars[
"enum_desc_func_name"] =
"NULL";
125 " .defaultValue.$default_name$ = $default$,\n"
126 " .singletonName = GPBStringifySymbol($root_class_and_method_name$),\n"
127 " .extendedClass.clazz = $extended_type$,\n"
128 " .messageOrGroupClass.clazz = $type$,\n"
129 " .enumDescriptorFunc = $enum_desc_func_name$,\n"
130 " .fieldNumber = $number$,\n"
131 " .dataType = $extension_type$,\n"
132 " .options = $options$,\n"
137 std::set<std::string>* fwd_decls) {
149 "[registry addExtension:$root_class_and_method_name$];\n",
void GenerateMembersHeader(io::Printer *printer)
void Print(const std::map< std::string, std::string > &variables, const char *text)
std::string ObjCClassDeclaration(const std::string &class_name)
string DefaultValue(const FieldDescriptor *field)
std::string ObjCClass(const std::string &class_name)
const Descriptor * message_type
string ClassName(const Descriptor *descriptor)
const Descriptor * containing_type() const
GRPC_CUSTOM_PRINTER Printer
string root_class_and_method_name_
string StrCat(const AlphaNum &a, const AlphaNum &b)
string ExtensionMethodName(const FieldDescriptor *descriptor)
const MessageOptions & options() const
void GenerateRegistrationSource(io::Printer *printer)
const FileDescriptor * file() const
string GetOptionalDeprecatedAttribute(const TDescriptor *descriptor, const FileDescriptor *file=NULL, bool preSpace=true, bool postNewline=false)
string BuildFlagsString(const FlagType flag_type, const std::vector< string > &strings)
void DetermineObjectiveCClassDefinitions(std::set< std::string > *fwd_decls)
string GetCapitalizedType(const FieldDescriptor *field)
const EnumDescriptor * enum_type
bool IsRetainedName(const string &name)
const FieldDescriptor * descriptor_
bool GetSourceLocation(SourceLocation *out_location) const
GRPC_CUSTOM_SOURCELOCATION SourceLocation
string EnumName(const EnumDescriptor *descriptor)
void GenerateStaticVariablesInitialization(io::Printer *printer)
ExtensionGenerator(const string &root_class_name, const FieldDescriptor *descriptor)
ObjectiveCType GetObjectiveCType(FieldDescriptor::Type field_type)
static const char descriptor[1336]
string GPBGenericValueFieldName(const FieldDescriptor *field)
string BuildCommentsString(const SourceLocation &location, bool prefer_single_line)
bool message_set_wire_format() const
grpc
Author(s):
autogenerated on Fri May 16 2025 02:59:34