Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:13:18

0001 // Protocol Buffers - Google's data interchange format
0002 // Copyright 2023 Google LLC.  All rights reserved.
0003 //
0004 // Use of this source code is governed by a BSD-style
0005 // license that can be found in the LICENSE file or at
0006 // https://developers.google.com/open-source/licenses/bsd
0007 
0008 // IWYU pragma: private, include "upb/reflection/def.h"
0009 
0010 #ifndef UPB_REFLECTION_FIELD_DEF_H_
0011 #define UPB_REFLECTION_FIELD_DEF_H_
0012 
0013 #include <stdint.h>
0014 
0015 #include "upb/base/descriptor_constants.h"
0016 #include "upb/base/string_view.h"
0017 #include "upb/message/value.h"
0018 #include "upb/mini_table/extension.h"
0019 #include "upb/mini_table/field.h"
0020 #include "upb/reflection/common.h"
0021 
0022 // Must be last.
0023 #include "upb/port/def.inc"
0024 
0025 // Maximum field number allowed for FieldDefs.
0026 // This is an inherent limit of the protobuf wire format.
0027 #define kUpb_MaxFieldNumber ((1 << 29) - 1)
0028 
0029 #ifdef __cplusplus
0030 extern "C" {
0031 #endif
0032 
0033 const upb_OneofDef* upb_FieldDef_ContainingOneof(const upb_FieldDef* f);
0034 UPB_API const upb_MessageDef* upb_FieldDef_ContainingType(
0035     const upb_FieldDef* f);
0036 UPB_API upb_CType upb_FieldDef_CType(const upb_FieldDef* f);
0037 UPB_API upb_MessageValue upb_FieldDef_Default(const upb_FieldDef* f);
0038 UPB_API const upb_EnumDef* upb_FieldDef_EnumSubDef(const upb_FieldDef* f);
0039 const upb_MessageDef* upb_FieldDef_ExtensionScope(const upb_FieldDef* f);
0040 UPB_API const upb_FileDef* upb_FieldDef_File(const upb_FieldDef* f);
0041 const char* upb_FieldDef_FullName(const upb_FieldDef* f);
0042 bool upb_FieldDef_HasDefault(const upb_FieldDef* f);
0043 bool upb_FieldDef_HasJsonName(const upb_FieldDef* f);
0044 bool upb_FieldDef_HasOptions(const upb_FieldDef* f);
0045 UPB_API bool upb_FieldDef_HasPresence(const upb_FieldDef* f);
0046 bool upb_FieldDef_HasSubDef(const upb_FieldDef* f);
0047 uint32_t upb_FieldDef_Index(const upb_FieldDef* f);
0048 UPB_API bool upb_FieldDef_IsEnum(const upb_FieldDef* f);
0049 bool upb_FieldDef_IsExtension(const upb_FieldDef* f);
0050 UPB_API bool upb_FieldDef_IsMap(const upb_FieldDef* f);
0051 bool upb_FieldDef_IsOptional(const upb_FieldDef* f);
0052 UPB_API bool upb_FieldDef_IsPacked(const upb_FieldDef* f);
0053 bool upb_FieldDef_IsPrimitive(const upb_FieldDef* f);
0054 UPB_API bool upb_FieldDef_IsRepeated(const upb_FieldDef* f);
0055 bool upb_FieldDef_IsRequired(const upb_FieldDef* f);
0056 bool upb_FieldDef_IsString(const upb_FieldDef* f);
0057 UPB_API bool upb_FieldDef_IsSubMessage(const upb_FieldDef* f);
0058 UPB_API const char* upb_FieldDef_JsonName(const upb_FieldDef* f);
0059 UPB_API upb_Label upb_FieldDef_Label(const upb_FieldDef* f);
0060 uint32_t upb_FieldDef_LayoutIndex(const upb_FieldDef* f);
0061 UPB_API const upb_MessageDef* upb_FieldDef_MessageSubDef(const upb_FieldDef* f);
0062 bool _upb_FieldDef_ValidateUtf8(const upb_FieldDef* f);
0063 bool _upb_FieldDef_IsGroupLike(const upb_FieldDef* f);
0064 
0065 // Creates a mini descriptor string for a field, returns true on success.
0066 bool upb_FieldDef_MiniDescriptorEncode(const upb_FieldDef* f, upb_Arena* a,
0067                                        upb_StringView* out);
0068 
0069 const upb_MiniTableField* upb_FieldDef_MiniTable(const upb_FieldDef* f);
0070 const upb_MiniTableExtension* upb_FieldDef_MiniTableExtension(
0071     const upb_FieldDef* f);
0072 UPB_API const char* upb_FieldDef_Name(const upb_FieldDef* f);
0073 UPB_API uint32_t upb_FieldDef_Number(const upb_FieldDef* f);
0074 const UPB_DESC(FieldOptions) * upb_FieldDef_Options(const upb_FieldDef* f);
0075 const UPB_DESC(FeatureSet) *
0076     upb_FieldDef_ResolvedFeatures(const upb_FieldDef* f);
0077 UPB_API const upb_OneofDef* upb_FieldDef_RealContainingOneof(
0078     const upb_FieldDef* f);
0079 UPB_API upb_FieldType upb_FieldDef_Type(const upb_FieldDef* f);
0080 
0081 #ifdef __cplusplus
0082 } /* extern "C" */
0083 #endif
0084 
0085 #include "upb/port/undef.inc"
0086 
0087 #endif /* UPB_REFLECTION_FIELD_DEF_H_ */