#import <Foundation/Foundation.h>
#import "GPBArray.h"
#import "GPBMessage.h"
#import "GPBRuntimeTypes.h"
Go to the source code of this file.
|
void | GPBClearMessageField (GPBMessage *self, GPBFieldDescriptor *field) |
|
void | GPBClearOneof (GPBMessage *self, GPBOneofDescriptor *oneof) |
|
NSData * | GPBEmptyNSData (void) __attribute__((pure)) |
|
BOOL | GPBGetMessageBoolField (GPBMessage *self, GPBFieldDescriptor *field) |
|
NSData * | GPBGetMessageBytesField (GPBMessage *self, GPBFieldDescriptor *field) |
|
double | GPBGetMessageDoubleField (GPBMessage *self, GPBFieldDescriptor *field) |
|
int32_t | GPBGetMessageEnumField (GPBMessage *self, GPBFieldDescriptor *field) |
|
float | GPBGetMessageFloatField (GPBMessage *self, GPBFieldDescriptor *field) |
|
GPBMessage * | GPBGetMessageGroupField (GPBMessage *self, GPBFieldDescriptor *field) |
|
int32_t | GPBGetMessageInt32Field (GPBMessage *self, GPBFieldDescriptor *field) |
|
int64_t | GPBGetMessageInt64Field (GPBMessage *self, GPBFieldDescriptor *field) |
|
id | GPBGetMessageMapField (GPBMessage *self, GPBFieldDescriptor *field) |
|
GPBMessage * | GPBGetMessageMessageField (GPBMessage *self, GPBFieldDescriptor *field) |
|
int32_t | GPBGetMessageRawEnumField (GPBMessage *self, GPBFieldDescriptor *field) |
|
id | GPBGetMessageRepeatedField (GPBMessage *self, GPBFieldDescriptor *field) |
|
NSString * | GPBGetMessageStringField (GPBMessage *self, GPBFieldDescriptor *field) |
|
uint32_t | GPBGetMessageUInt32Field (GPBMessage *self, GPBFieldDescriptor *field) |
|
uint64_t | GPBGetMessageUInt64Field (GPBMessage *self, GPBFieldDescriptor *field) |
|
void | GPBMessageDropUnknownFieldsRecursively (GPBMessage *message) |
|
BOOL | GPBMessageHasFieldNumberSet (GPBMessage *self, uint32_t fieldNumber) |
|
BOOL | GPBMessageHasFieldSet (GPBMessage *self, GPBFieldDescriptor *field) |
|
void | GPBSetMessageBoolField (GPBMessage *self, GPBFieldDescriptor *field, BOOL value) |
|
void | GPBSetMessageBytesField (GPBMessage *self, GPBFieldDescriptor *field, NSData *value) |
|
void | GPBSetMessageDoubleField (GPBMessage *self, GPBFieldDescriptor *field, double value) |
|
void | GPBSetMessageEnumField (GPBMessage *self, GPBFieldDescriptor *field, int32_t value) |
|
void | GPBSetMessageFloatField (GPBMessage *self, GPBFieldDescriptor *field, float value) |
|
void | GPBSetMessageGroupField (GPBMessage *self, GPBFieldDescriptor *field, GPBMessage *value) |
|
void | GPBSetMessageInt32Field (GPBMessage *self, GPBFieldDescriptor *field, int32_t value) |
|
void | GPBSetMessageInt64Field (GPBMessage *self, GPBFieldDescriptor *field, int64_t value) |
|
void | GPBSetMessageMapField (GPBMessage *self, GPBFieldDescriptor *field, id dictionary) |
|
void | GPBSetMessageMessageField (GPBMessage *self, GPBFieldDescriptor *field, GPBMessage *value) |
|
void | GPBSetMessageRawEnumField (GPBMessage *self, GPBFieldDescriptor *field, int32_t value) |
|
void | GPBSetMessageRepeatedField (GPBMessage *self, GPBFieldDescriptor *field, id array) |
|
void | GPBSetMessageStringField (GPBMessage *self, GPBFieldDescriptor *field, NSString *value) |
|
void | GPBSetMessageUInt32Field (GPBMessage *self, GPBFieldDescriptor *field, uint32_t value) |
|
void | GPBSetMessageUInt64Field (GPBMessage *self, GPBFieldDescriptor *field, uint64_t value) |
|
CF_EXTERN_C_BEGIN NS_ASSUME_NONNULL_BEGIN NSString * | GPBTextFormatForMessage (GPBMessage *message, NSString *__nullable lineIndent) |
|
NSString * | GPBTextFormatForUnknownFieldSet (GPBUnknownFieldSet *__nullable unknownSet, NSString *__nullable lineIndent) |
|
◆ GPBClearMessageField()
Clears the given field for the given message.
- Parameters
-
self | The message for which to clear the field. |
field | The field to clear. |
◆ GPBClearOneof()
Clears the given oneof field for the given message.
- Parameters
-
self | The message for which to clear the field. |
oneof | The oneof to clear. |
◆ GPBEmptyNSData()
NSData* GPBEmptyNSData |
( |
void |
| ) |
|
Returns an empty NSData to assign to byte fields when you wish to assign them to empty. Prevents allocating a lot of little [NSData data] objects.
◆ GPBGetMessageBoolField()
Gets the value of a bool field.
- Parameters
-
self | The message from which to get the field. |
field | The field to get. |
◆ GPBGetMessageBytesField()
Gets the value of a bytes field.
- Parameters
-
self | The message from which to get the field. |
field | The field to get. |
◆ GPBGetMessageDoubleField()
Gets the value of a double field.
- Parameters
-
self | The message from which to get the field. |
field | The field to get. |
◆ GPBGetMessageEnumField()
Gets the given enum field of a message. For proto3, if the value isn't a member of the enum, kGPBUnrecognizedEnumeratorValue
will be returned. GPBGetMessageRawEnumField will bypass the check and return whatever value was set.
- Parameters
-
self | The message from which to get the field. |
field | The field to get. |
- Returns
- The enum value for the given field.
◆ GPBGetMessageFloatField()
Gets the value of a float field.
- Parameters
-
self | The message from which to get the field. |
field | The field to get. |
◆ GPBGetMessageGroupField()
Gets the value of a group field.
- Parameters
-
self | The message from which to get the field. |
field | The field to get. |
◆ GPBGetMessageInt32Field()
Gets the value of an int32 field.
- Parameters
-
self | The message from which to get the field. |
field | The field to get. |
◆ GPBGetMessageInt64Field()
Gets the value of an int64 field.
- Parameters
-
self | The message from which to get the field. |
field | The field to get. |
◆ GPBGetMessageMapField()
Gets the value of a map<> field.
- Parameters
-
self | The message from which to get the field. |
field | The repeated field to get. |
- Returns
- A GPB*Dictionary or NSMutableDictionary based on the field's type.
◆ GPBGetMessageMessageField()
Gets the value of a message field.
- Parameters
-
self | The message from which to get the field. |
field | The field to get. |
◆ GPBGetMessageRawEnumField()
Get the given enum field of a message. No check is done to ensure the value was defined in the enum.
- Parameters
-
self | The message from which to get the field. |
field | The field to get. |
- Returns
- The raw enum value for the given field.
◆ GPBGetMessageRepeatedField()
Gets the value of a repeated field.
- Parameters
-
self | The message from which to get the field. |
field | The repeated field to get. |
- Returns
- A GPB*Array or an NSMutableArray based on the field's type.
◆ GPBGetMessageStringField()
Gets the value of a string field.
- Parameters
-
self | The message from which to get the field. |
field | The field to get. |
◆ GPBGetMessageUInt32Field()
Gets the value of an uint32 field.
- Parameters
-
self | The message from which to get the field. |
field | The field to get. |
◆ GPBGetMessageUInt64Field()
Gets the value of an uint64 field.
- Parameters
-
self | The message from which to get the field. |
field | The field to get. |
◆ GPBMessageDropUnknownFieldsRecursively()
void GPBMessageDropUnknownFieldsRecursively |
( |
GPBMessage * |
message | ) |
|
Drops the unknownFields
from the given message and from all sub message.
◆ GPBMessageHasFieldNumberSet()
Checks if the given field number is set on a message.
- Parameters
-
self | The message to check. |
fieldNumber | The field number to check. |
- Returns
- YES if the field number is set on the given message.
◆ GPBMessageHasFieldSet()
Checks if the given field is set on a message.
- Parameters
-
self | The message to check. |
field | The field to check. |
- Returns
- YES if the field is set on the given message.
◆ GPBSetMessageBoolField()
Sets the value of a bool field.
- Parameters
-
self | The message into which to set the field. |
field | The field to set. |
value | The to set in the field. |
◆ GPBSetMessageBytesField()
Sets the value of a bytes field.
- Parameters
-
self | The message into which to set the field. |
field | The field to set. |
value | The to set in the field. |
◆ GPBSetMessageDoubleField()
Sets the value of a double field.
- Parameters
-
self | The message into which to set the field. |
field | The field to set. |
value | The to set in the field. |
◆ GPBSetMessageEnumField()
Set the given enum field of a message. You can only set values that are members of the enum.
- Parameters
-
self | The message into which to set the field. |
field | The field to set. |
value | The enum value to set in the field. |
◆ GPBSetMessageFloatField()
Sets the value of a float field.
- Parameters
-
self | The message into which to set the field. |
field | The field to set. |
value | The to set in the field. |
◆ GPBSetMessageGroupField()
Sets the value of a group field.
- Parameters
-
self | The message into which to set the field. |
field | The field to set. |
value | The to set in the field. |
◆ GPBSetMessageInt32Field()
Sets the value of an int32 field.
- Parameters
-
self | The message into which to set the field. |
field | The field to set. |
value | The to set in the field. |
◆ GPBSetMessageInt64Field()
Sets the value of an int64 field.
- Parameters
-
self | The message into which to set the field. |
field | The field to set. |
value | The to set in the field. |
◆ GPBSetMessageMapField()
Sets the value of a map<> field.
- Parameters
-
self | The message into which to set the field. |
field | The field to set. |
dictionary | A GPB*Dictionary or NSMutableDictionary based on the field's type. |
◆ GPBSetMessageMessageField()
Sets the value of a message field.
- Parameters
-
self | The message into which to set the field. |
field | The field to set. |
value | The to set in the field. |
◆ GPBSetMessageRawEnumField()
Set the given enum field of a message. You can set the value to anything, even a value that is not a member of the enum.
- Parameters
-
self | The message into which to set the field. |
field | The field to set. |
value | The raw enum value to set in the field. |
◆ GPBSetMessageRepeatedField()
Sets the value of a repeated field.
- Parameters
-
self | The message into which to set the field. |
field | The field to set. |
array | A GPB*Array or NSMutableArray based on the field's type. |
◆ GPBSetMessageStringField()
Sets the value of a string field.
- Parameters
-
self | The message into which to set the field. |
field | The field to set. |
value | The to set in the field. |
◆ GPBSetMessageUInt32Field()
Sets the value of an uint32 field.
- Parameters
-
self | The message into which to set the field. |
field | The field to set. |
value | The to set in the field. |
◆ GPBSetMessageUInt64Field()
Sets the value of an uint64 field.
- Parameters
-
self | The message into which to set the field. |
field | The field to set. |
value | The to set in the field. |
◆ GPBTextFormatForMessage()
CF_EXTERN_C_BEGIN NS_ASSUME_NONNULL_BEGIN NSString* GPBTextFormatForMessage |
( |
GPBMessage * |
message, |
|
|
NSString *__nullable |
lineIndent |
|
) |
| |
Generates a string that should be a valid "TextFormat" for the C++ version of Protocol Buffers.
- Parameters
-
message | The message to generate from. |
lineIndent | A string to use as the prefix for all lines generated. Can be nil if no extra indent is needed. |
- Returns
- An NSString with the TextFormat of the message.
◆ GPBTextFormatForUnknownFieldSet()
NSString* GPBTextFormatForUnknownFieldSet |
( |
GPBUnknownFieldSet *__nullable |
unknownSet, |
|
|
NSString *__nullable |
lineIndent |
|
) |
| |
Generates a string that should be a valid "TextFormat" for the C++ version of Protocol Buffers.
- Parameters
-
unknownSet | The unknown field set to generate from. |
lineIndent | A string to use as the prefix for all lines generated. Can be nil if no extra indent is needed. |
- Returns
- An NSString with the TextFormat of the unknown field set.