#import <GPBDescriptor.h>
Describes a proto enum.
Definition at line 216 of file GPBDescriptor.h.
◆ allocDescriptorForName:valueNames:values:count:enumVerifier:
+ (instancetype) allocDescriptorForName: |
|
(NSString *) |
name |
valueNames: |
|
(const char *) |
valueNames |
values: |
|
(const int32_t *) |
values |
count: |
|
(uint32_t) |
valueCount |
enumVerifier: |
|
(GPBEnumValidationFunc) |
enumVerifier |
|
|
| |
|
implementation |
◆ allocDescriptorForName:valueNames:values:count:enumVerifier:extraTextFormatInfo:
+ (instancetype) allocDescriptorForName: |
|
(NSString *) |
name |
valueNames: |
|
(const char *) |
valueNames |
values: |
|
(const int32_t *) |
values |
count: |
|
(uint32_t) |
valueCount |
enumVerifier: |
|
(GPBEnumValidationFunc) |
enumVerifier |
extraTextFormatInfo: |
|
(const char *) |
extraTextFormatInfo |
|
|
| |
|
implementation |
◆ enumNameForValue:
- (nullable NSString *) enumNameForValue: |
|
(int32_t) |
number |
|
Returns the enum value name for the given raw enum.
Note that there can be more than one name corresponding to a given value if the allow_alias option is used.
- Parameters
-
number | The raw enum value. |
- Returns
- The first name that matches the enum value passed, or nil if not valid.
◆ getEnumNameForIndex:
- (nullable NSString *) getEnumNameForIndex: |
|
(uint32_t) |
index |
|
Gets the enum name corresponding to the given index.
- Parameters
-
index | Index into the available names. The defined range is from 0 to self.enumNameCount - 1. |
- Returns
- The enum name at the given index, or nil if the index is out of range.
◆ getEnumTextFormatNameForIndex:
- (nullable NSString *) getEnumTextFormatNameForIndex: |
|
(uint32_t) |
index |
|
Gets the enum text format name corresponding to the given index.
- Parameters
-
index | Index into the available names. The defined range is from 0 to self.enumNameCount - 1. |
- Returns
- The text format name at the given index, or nil if the index is out of range.
◆ getValue:forEnumName:
- (BOOL) getValue: |
|
(nullable int32_t *) |
outValue |
forEnumName: |
|
(NSString *) |
name |
|
|
| |
Gets the enum raw value for the given enum name.
- Parameters
-
outValue | A pointer where the value will be set. |
name | The enum name for which to get the raw value. |
- Returns
- YES if a value was copied into the pointer, NO otherwise.
◆ getValue:forEnumTextFormatName:
- (BOOL) getValue: |
|
(nullable int32_t *) |
outValue |
forEnumTextFormatName: |
|
(NSString *) |
textFormatName |
|
|
| |
Gets the enum raw value for the given text format name.
- Parameters
-
outValue | A pointer where the value will be set. |
textFormatName | The text format name for which to get the raw value. |
- Returns
- YES if a value was copied into the pointer, NO otherwise.
◆ initWithName:valueNames:values:count:enumVerifier:
- (instancetype) initWithName: |
|
(NSString *) |
name |
valueNames: |
|
(const char *) |
valueNames |
values: |
|
(const int32_t *) |
values |
count: |
|
(uint32_t) |
valueCount |
enumVerifier: |
|
(GPBEnumValidationFunc) |
enumVerifier |
|
|
| |
|
implementation |
◆ textFormatNameForValue:
- (nullable NSString *) textFormatNameForValue: |
|
(int32_t) |
number |
|
Returns the text format for the given raw enum value.
- Parameters
-
number | The raw enum value. |
- Returns
- The first text format name which matches the enum value, or nil if not valid.
◆ enumNameCount
- (uint32_t) enumNameCount |
|
readnonatomicassign |
Gets the number of defined enum names.
- Returns
- Count of the number of enum names, including any aliases.
Definition at line 269 of file GPBDescriptor.h.
◆ enumVerifier
Function that validates that raw values are valid enum values.
Definition at line 221 of file GPBDescriptor.h.
◆ name
The documentation for this class was generated from the following file: