Download include/google/protobuf/compiler/java/internal_helpers.h from Shenghong/dai_env: direct link, hf CLI and curl.
- Browser
- Download file 2.63 kB
-
https://huggingface.co/Shenghong/dai_env/resolve/main/include/google/protobuf/compiler/java/internal_helpers.h
- Command line
-
hf download hf://Shenghong/dai_env/include/google/protobuf/compiler/java/internal_helpers.h
-
curl -L -o internal_helpers.h https://huggingface.co/Shenghong/dai_env/resolve/main/include/google/protobuf/compiler/java/internal_helpers.h
2.63 kB
| // Protocol Buffers - Google's data interchange format | |
| // Copyright 2008 Google Inc. All rights reserved. | |
| // | |
| // Use of this source code is governed by a BSD-style | |
| // license that can be found in the LICENSE file or at | |
| // https://developers.google.com/open-source/licenses/bsd | |
| // Author: kenton@google.com (Kenton Varda) | |
| // Based on original Protocol Buffers design by | |
| // Sanjay Ghemawat, Jeff Dean, and others. | |
| // Must be last. | |
| namespace google { | |
| namespace protobuf { | |
| namespace compiler { | |
| namespace java { | |
| // Whether unknown enum values are kept (i.e., not stored in UnknownFieldSet | |
| // but in the message and can be queried using additional getters that return | |
| // ints. | |
| inline bool SupportUnknownEnumValue(const FieldDescriptor* field) { | |
| if (JavaGenerator::GetResolvedSourceFeatures(*field) | |
| .GetExtension(pb::java) | |
| .legacy_closed_enum()) { | |
| return false; | |
| } | |
| return field->enum_type() != nullptr && !field->enum_type()->is_closed(); | |
| } | |
| inline bool CheckUtf8(const FieldDescriptor* descriptor) { | |
| if (JavaGenerator::GetResolvedSourceFeatures(*descriptor) | |
| .GetExtension(pb::java) | |
| .utf8_validation() == pb::JavaFeatures::VERIFY) { | |
| return true; | |
| } | |
| return JavaGenerator::GetResolvedSourceFeatures(*descriptor) | |
| .utf8_validation() == FeatureSet::VERIFY || | |
| // For legacy syntax. This is not allowed under Editions. | |
| descriptor->file()->options().java_string_check_utf8(); | |
| } | |
| // Only the lowest two bytes of the return value are used. The lowest byte | |
| // is the integer value of a j/c/g/protobuf/FieldType enum. For the other | |
| // byte: | |
| // bit 0: whether the field is required. | |
| // bit 1: whether the field requires UTF-8 validation. | |
| // bit 2: whether the field needs isInitialized check. | |
| // bit 3: whether the field is a closed enum. | |
| // bits 4-7: unused | |
| int GetExperimentalJavaFieldType(const FieldDescriptor* field); | |
| } // namespace java | |
| } // namespace compiler | |
| } // namespace protobuf | |
| } // namespace google | |