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_ENUM_DEF_H_
0011 #define UPB_REFLECTION_ENUM_DEF_H_
0012 
0013 #include "upb/base/string_view.h"
0014 #include "upb/reflection/common.h"
0015 
0016 // Must be last.
0017 #include "upb/port/def.inc"
0018 
0019 #ifdef __cplusplus
0020 extern "C" {
0021 #endif
0022 
0023 bool upb_EnumDef_CheckNumber(const upb_EnumDef* e, int32_t num);
0024 const upb_MessageDef* upb_EnumDef_ContainingType(const upb_EnumDef* e);
0025 int32_t upb_EnumDef_Default(const upb_EnumDef* e);
0026 UPB_API const upb_FileDef* upb_EnumDef_File(const upb_EnumDef* e);
0027 const upb_EnumValueDef* upb_EnumDef_FindValueByName(const upb_EnumDef* e,
0028                                                     const char* name);
0029 UPB_API const upb_EnumValueDef* upb_EnumDef_FindValueByNameWithSize(
0030     const upb_EnumDef* e, const char* name, size_t size);
0031 UPB_API const upb_EnumValueDef* upb_EnumDef_FindValueByNumber(
0032     const upb_EnumDef* e, int32_t num);
0033 UPB_API const char* upb_EnumDef_FullName(const upb_EnumDef* e);
0034 bool upb_EnumDef_HasOptions(const upb_EnumDef* e);
0035 bool upb_EnumDef_IsClosed(const upb_EnumDef* e);
0036 bool upb_EnumDef_IsSpecifiedAsClosed(const upb_EnumDef* e);
0037 
0038 // Creates a mini descriptor string for an enum, returns true on success.
0039 bool upb_EnumDef_MiniDescriptorEncode(const upb_EnumDef* e, upb_Arena* a,
0040                                       upb_StringView* out);
0041 
0042 const char* upb_EnumDef_Name(const upb_EnumDef* e);
0043 const UPB_DESC(EnumOptions) * upb_EnumDef_Options(const upb_EnumDef* e);
0044 const UPB_DESC(FeatureSet) * upb_EnumDef_ResolvedFeatures(const upb_EnumDef* e);
0045 
0046 upb_StringView upb_EnumDef_ReservedName(const upb_EnumDef* e, int i);
0047 int upb_EnumDef_ReservedNameCount(const upb_EnumDef* e);
0048 
0049 const upb_EnumReservedRange* upb_EnumDef_ReservedRange(const upb_EnumDef* e,
0050                                                        int i);
0051 int upb_EnumDef_ReservedRangeCount(const upb_EnumDef* e);
0052 
0053 UPB_API const upb_EnumValueDef* upb_EnumDef_Value(const upb_EnumDef* e, int i);
0054 UPB_API int upb_EnumDef_ValueCount(const upb_EnumDef* e);
0055 
0056 #ifdef __cplusplus
0057 } /* extern "C" */
0058 #endif
0059 
0060 #include "upb/port/undef.inc"
0061 
0062 #endif /* UPB_REFLECTION_ENUM_DEF_H_ */