File indexing completed on 2025-01-31 10:11:59
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_NAMES_H__
0011 #define GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_NAMES_H__
0012
0013 #include <string>
0014 #include <vector>
0015
0016 #include "absl/strings/string_view.h"
0017 #include "google/protobuf/descriptor.h"
0018
0019
0020 #include "google/protobuf/port_def.inc"
0021
0022 namespace google {
0023 namespace protobuf {
0024 namespace compiler {
0025 namespace objectivec {
0026
0027
0028 PROTOC_EXPORT absl::string_view GetPackageToPrefixMappingsPath();
0029 PROTOC_EXPORT void SetPackageToPrefixMappingsPath(absl::string_view file_path);
0030
0031
0032
0033
0034 PROTOC_EXPORT bool UseProtoPackageAsDefaultPrefix();
0035 PROTOC_EXPORT void SetUseProtoPackageAsDefaultPrefix(bool on_or_off);
0036
0037
0038
0039 PROTOC_EXPORT absl::string_view GetProtoPackagePrefixExceptionList();
0040 PROTOC_EXPORT void SetProtoPackagePrefixExceptionList(
0041 absl::string_view file_path);
0042
0043
0044 PROTOC_EXPORT absl::string_view GetForcedPackagePrefix();
0045 PROTOC_EXPORT void SetForcedPackagePrefix(absl::string_view prefix);
0046
0047
0048
0049 PROTOC_EXPORT bool IsRetainedName(absl::string_view name);
0050
0051
0052
0053 PROTOC_EXPORT bool IsInitName(absl::string_view name);
0054
0055
0056
0057 PROTOC_EXPORT bool IsCreateName(absl::string_view name);
0058
0059
0060 PROTOC_EXPORT std::string FileClassPrefix(const FileDescriptor* file);
0061
0062
0063
0064
0065 PROTOC_EXPORT std::string FilePath(const FileDescriptor* file);
0066
0067
0068 PROTOC_EXPORT std::string FilePathBasename(const FileDescriptor* file);
0069
0070
0071
0072
0073 PROTOC_EXPORT std::string FileClassName(const FileDescriptor* file);
0074
0075
0076
0077 PROTOC_EXPORT std::string ClassName(const Descriptor* descriptor);
0078 PROTOC_EXPORT std::string ClassName(const Descriptor* descriptor,
0079 std::string* out_suffix_added);
0080 PROTOC_EXPORT std::string EnumName(const EnumDescriptor* descriptor);
0081
0082
0083
0084 PROTOC_EXPORT std::string EnumValueName(const EnumValueDescriptor* descriptor);
0085
0086
0087 PROTOC_EXPORT std::string EnumValueShortName(
0088 const EnumValueDescriptor* descriptor);
0089
0090
0091 PROTOC_EXPORT std::string UnCamelCaseEnumShortName(absl::string_view name);
0092
0093
0094
0095 PROTOC_EXPORT std::string ExtensionMethodName(
0096 const FieldDescriptor* descriptor);
0097
0098
0099 PROTOC_EXPORT std::string FieldName(const FieldDescriptor* field);
0100 PROTOC_EXPORT std::string FieldNameCapitalized(const FieldDescriptor* field);
0101
0102
0103 enum FieldObjCTypeOptions : unsigned int {
0104
0105 kFieldObjCTypeOptions_None = 0,
0106
0107 kFieldObjCTypeOptions_OmitLightweightGenerics = 1 << 0,
0108
0109 kFieldObjCTypeOptions_IncludeSpaceBeforeStar = 1 << 1,
0110
0111
0112
0113
0114 kFieldObjCTypeOptions_IncludeSpaceAfterBasicTypes = 1 << 2,
0115 };
0116
0117
0118
0119 PROTOC_EXPORT std::string FieldObjCType(
0120 const FieldDescriptor* field,
0121 FieldObjCTypeOptions options = kFieldObjCTypeOptions_None);
0122
0123
0124 PROTOC_EXPORT std::string OneofEnumName(const OneofDescriptor* descriptor);
0125 PROTOC_EXPORT std::string OneofName(const OneofDescriptor* descriptor);
0126 PROTOC_EXPORT std::string OneofNameCapitalized(
0127 const OneofDescriptor* descriptor);
0128
0129
0130 PROTOC_EXPORT std::string UnCamelCaseFieldName(absl::string_view name,
0131 const FieldDescriptor* field);
0132
0133
0134
0135 extern PROTOC_EXPORT const char* const ProtobufLibraryFrameworkName;
0136
0137
0138 PROTOC_EXPORT std::string ProtobufFrameworkImportSymbol(
0139 absl::string_view framework_name);
0140
0141
0142
0143
0144
0145
0146
0147 PROTOC_EXPORT bool IsProtobufLibraryBundledProtoFile(
0148 const FileDescriptor* file);
0149
0150
0151
0152 struct Options {
0153 Options();
0154 std::string expected_prefixes_path;
0155 std::vector<std::string> expected_prefixes_suppressions;
0156 bool prefixes_must_be_registered;
0157 bool require_prefixes;
0158 };
0159
0160
0161
0162
0163 PROTOC_EXPORT bool ValidateObjCClassPrefixes(
0164 const std::vector<const FileDescriptor*>& files,
0165 const Options& validation_options, std::string* out_error);
0166
0167
0168 PROTOC_EXPORT bool ValidateObjCClassPrefixes(
0169 const std::vector<const FileDescriptor*>& files, std::string* out_error);
0170
0171 }
0172 }
0173 }
0174 }
0175
0176 #include "google/protobuf/port_undef.inc"
0177
0178 #endif