File indexing completed on 2025-01-31 10:11:58
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_INTERNAL_HELPERS_H__
0013 #define GOOGLE_PROTOBUF_COMPILER_JAVA_INTERNAL_HELPERS_H__
0014
0015 #include "google/protobuf/compiler/java/java_features.pb.h"
0016 #include "google/protobuf/compiler/java/generator.h"
0017 #include "google/protobuf/compiler/java/names.h"
0018 #include "google/protobuf/descriptor.h"
0019 #include "google/protobuf/descriptor.pb.h"
0020
0021
0022 #include "google/protobuf/port_def.inc"
0023
0024 namespace google {
0025 namespace protobuf {
0026 namespace compiler {
0027 namespace java {
0028
0029
0030
0031
0032 inline bool SupportUnknownEnumValue(const FieldDescriptor* field) {
0033 if (JavaGenerator::GetResolvedSourceFeatures(*field)
0034 .GetExtension(pb::java)
0035 .legacy_closed_enum()) {
0036 return false;
0037 }
0038 return field->enum_type() != nullptr && !field->enum_type()->is_closed();
0039 }
0040
0041 inline bool CheckUtf8(const FieldDescriptor* descriptor) {
0042 if (JavaGenerator::GetResolvedSourceFeatures(*descriptor)
0043 .GetExtension(pb::java)
0044 .utf8_validation() == pb::JavaFeatures::VERIFY) {
0045 return true;
0046 }
0047 return JavaGenerator::GetResolvedSourceFeatures(*descriptor)
0048 .utf8_validation() == FeatureSet::VERIFY ||
0049
0050 descriptor->file()->options().java_string_check_utf8();
0051 }
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062 int GetExperimentalJavaFieldType(const FieldDescriptor* field);
0063
0064 }
0065 }
0066 }
0067 }
0068
0069 #include "google/protobuf/port_undef.inc"
0070 #endif