Go to the documentation of this file.
33 #ifndef GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_HELPERS_H__
34 #define GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_HELPERS_H__
39 #include <google/protobuf/descriptor.h>
40 #include <google/protobuf/descriptor.pb.h>
41 #include <google/protobuf/io/zero_copy_stream.h>
43 #include <google/protobuf/port_def.inc>
48 namespace objectivec {
175 template <
class TDescriptor>
178 bool preSpace =
true,
179 bool postNewline =
false) {
180 bool isDeprecated =
descriptor->options().deprecated();
184 bool isFileLevelDeprecation =
false;
185 if (!isDeprecated &&
file) {
186 isFileLevelDeprecation =
file->options().deprecated();
187 isDeprecated = isFileLevelDeprecation;
192 if (isFileLevelDeprecation) {
196 sourceFile->
name() +
").";
235 bool prefer_single_line);
253 const std::vector<const FileDescriptor*>&
files,
254 const Options& generation_options,
std::string* out_error);
258 class PROTOC_EXPORT TextFormatDecodeData {
260 TextFormatDecodeData();
261 ~TextFormatDecodeData();
263 TextFormatDecodeData(
const TextFormatDecodeData&) =
delete;
264 TextFormatDecodeData& operator=(
const TextFormatDecodeData&) =
delete;
276 std::vector<DataEntry> entries_;
288 LineConsumer* line_consumer,
293 LineConsumer* line_consumer,
298 class PROTOC_EXPORT ImportWriter {
300 ImportWriter(
const std::string& generate_for_named_framework,
301 const std::string& named_framework_to_proto_path_mappings_path,
303 bool include_wkt_imports);
309 static void PrintRuntimeImports(
io::Printer* printer,
310 const std::vector<std::string>& header_to_import,
312 bool default_cpp_symbol =
false);
315 class ProtoFrameworkCollector :
public LineConsumer {
318 : map_(inout_proto_file_to_framework_name) {}
323 std::map<std::string, std::string>*
map_;
326 void ParseFrameworkMappings();
331 const bool include_wkt_imports_;
333 bool need_to_parse_mapping_file_;
345 #include <google/protobuf/port_undef.inc>
347 #endif // GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_HELPERS_H__
const char *const ProtobufLibraryFrameworkName
bool IsReferenceType(const FieldDescriptor *field)
bool ParseSimpleFile(const string &path, LineConsumer *line_consumer, string *out_error)
std::map< std::string, std::string > proto_file_to_framework_name_
@ FLAGTYPE_DESCRIPTOR_INITIALIZATION
string FileClassPrefix(const FileDescriptor *file)
string FilePathBasename(const FileDescriptor *file)
void SetUseProtoPackageAsDefaultPrefix(bool on_or_off)
std::string ObjCClassDeclaration(const std::string &class_name)
string OneofEnumName(const OneofDescriptor *descriptor)
string FileClassName(const FileDescriptor *file)
bool HasPreservingUnknownEnumSemantics(const FileDescriptor *file)
string DefaultValue(const FieldDescriptor *field)
std::string generate_for_named_framework
const std::string runtime_import_prefix_
std::vector< std::string > expected_prefixes_suppressions
std::string Print(const T &value)
std::string ObjCClass(const std::string &class_name)
string ClassName(const Descriptor *descriptor)
void AddFile(const std::string &filename, const std::string &data)
string UnCamelCaseFieldName(const string &name, const FieldDescriptor *field)
string EnumValueName(const EnumValueDescriptor *descriptor)
std::vector< std::string > protobuf_imports_
string ExtensionMethodName(const FieldDescriptor *descriptor)
string EnumValueShortName(const EnumValueDescriptor *descriptor)
bool HasNonZeroDefaultValue(const FieldDescriptor *field)
bool prefixes_must_be_registered
std::string expected_prefixes_path
bool IsMapEntryMessage(const Descriptor *descriptor)
bool IsPrimitiveType(const FieldDescriptor *field)
bool IsInitName(const string &name)
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)
const std::string generate_for_named_framework_
ProtoFrameworkCollector(std::map< std::string, std::string > *inout_proto_file_to_framework_name)
void TrimWhitespace(StringPiece *input)
string FieldName(const FieldDescriptor *field)
string GetCapitalizedType(const FieldDescriptor *field)
string OneofName(const OneofDescriptor *descriptor)
bool ValidateObjCClassPrefixes(const std::vector< const FileDescriptor * > &files, const Options &generation_options, string *out_error)
string OneofNameCapitalized(const OneofDescriptor *descriptor)
static const char * class_name(int dnsclass)
string UnCamelCaseEnumShortName(const string &name)
std::string named_framework_to_proto_path_mappings_path
string FieldNameCapitalized(const FieldDescriptor *field)
const std::string & name() const
string ProtobufFrameworkImportSymbol(const string &framework_name)
const FieldDescriptor * field
std::map< std::string, std::string > * map_
size_t num_entries() const
std::string GetProtoPackagePrefixExceptionList()
void SetProtoPackagePrefixExceptionList(const std::string &file_path)
zend_class_entry * field_type
std::vector< std::string > other_imports_
bool IsRetainedName(const string &name)
bool IsProtobufLibraryBundledProtoFile(const FileDescriptor *file)
string EnumName(const EnumDescriptor *descriptor)
std::pair< int32_t, std::string > DataEntry
ObjectiveCType GetObjectiveCType(FieldDescriptor::Type field_type)
string FilePath(const FileDescriptor *file)
string EscapeTrigraphs(const string &to_escape)
static const char descriptor[1336]
string GPBGenericValueFieldName(const FieldDescriptor *field)
std::vector< std::string > other_framework_imports_
bool UseProtoPackageAsDefaultPrefix()
bool ParseSimpleStream(io::ZeroCopyInputStream &input_stream, const std::string &stream_name, LineConsumer *line_consumer, std::string *out_error)
string BuildCommentsString(const SourceLocation &location, bool prefer_single_line)
std::string runtime_import_prefix
const std::string named_framework_to_proto_path_mappings_path_
grpc
Author(s):
autogenerated on Fri May 16 2025 02:59:34