protobuf/objectivec/GPBUtilities.h
Go to the documentation of this file.
1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2008 Google Inc. All rights reserved.
3 // https://developers.google.com/protocol-buffers/
4 //
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are
7 // met:
8 //
9 // * Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer.
11 // * Redistributions in binary form must reproduce the above
12 // copyright notice, this list of conditions and the following disclaimer
13 // in the documentation and/or other materials provided with the
14 // distribution.
15 // * Neither the name of Google Inc. nor the names of its
16 // contributors may be used to endorse or promote products derived from
17 // this software without specific prior written permission.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31 #import <Foundation/Foundation.h>
32 
33 #import "GPBArray.h"
34 #import "GPBMessage.h"
35 #import "GPBRuntimeTypes.h"
36 
37 @class GPBOneofDescriptor;
38 
39 CF_EXTERN_C_BEGIN
40 
41 NS_ASSUME_NONNULL_BEGIN
42 
54  NSString * __nullable lineIndent);
55 
66 NSString *GPBTextFormatForUnknownFieldSet(GPBUnknownFieldSet * __nullable unknownSet,
67  NSString * __nullable lineIndent);
68 
78 
88 
96 
103 void GPBClearOneof(GPBMessage *self, GPBOneofDescriptor *oneof);
104 
105 //%PDDM-EXPAND GPB_ACCESSORS()
106 // This block of code is generated, do not edit it directly.
107 // clang-format off
108 
109 
110 //
111 // Get/Set a given field from/to a message.
112 //
113 
114 // Single Fields
115 
123 
132 
140 
149 
157 
166 
174 
183 
191 
200 
208 
217 
225 
234 
242 
251 
259 
268 
276 
285 
293 
302 
315 
326  int32_t value);
327 
338 
349  int32_t value);
350 
351 // Repeated Fields
352 
362 
372  id array);
373 
374 // Map Fields
375 
385 
396  id dictionary);
397 
398 // clang-format on
399 //%PDDM-EXPAND-END GPB_ACCESSORS()
400 
405 NSData *GPBEmptyNSData(void) __attribute__((pure));
406 
411 
412 NS_ASSUME_NONNULL_END
413 
414 CF_EXTERN_C_END
415 
416 
417 //%PDDM-DEFINE GPB_ACCESSORS()
418 //%
419 //%//
420 //%// Get/Set a given field from/to a message.
421 //%//
422 //%
423 //%// Single Fields
424 //%
425 //%GPB_ACCESSOR_SINGLE_FULL(Bytes, NSData, , *)
426 //%GPB_ACCESSOR_SINGLE_FULL(String, NSString, , *)
427 //%GPB_ACCESSOR_SINGLE_FULL(Message, GPBMessage, , *)
428 //%GPB_ACCESSOR_SINGLE_FULL(Group, GPBMessage, , *)
429 //%GPB_ACCESSOR_SINGLE(Bool, BOOL, )
430 //%GPB_ACCESSOR_SINGLE(Int32, int32_t, n)
431 //%GPB_ACCESSOR_SINGLE(UInt32, uint32_t, n)
432 //%GPB_ACCESSOR_SINGLE(Int64, int64_t, n)
433 //%GPB_ACCESSOR_SINGLE(UInt64, uint64_t, n)
434 //%GPB_ACCESSOR_SINGLE(Float, float, )
435 //%GPB_ACCESSOR_SINGLE(Double, double, )
436 //%/**
437 //% * Gets the given enum field of a message. For proto3, if the value isn't a
438 //% * member of the enum, @c kGPBUnrecognizedEnumeratorValue will be returned.
439 //% * GPBGetMessageRawEnumField will bypass the check and return whatever value
440 //% * was set.
441 //% *
442 //% * @param self The message from which to get the field.
443 //% * @param field The field to get.
444 //% *
445 //% * @return The enum value for the given field.
446 //% **/
447 //%int32_t GPBGetMessageEnumField(GPBMessage *self, GPBFieldDescriptor *field);
448 //%
449 //%/**
450 //% * Set the given enum field of a message. You can only set values that are
451 //% * members of the enum.
452 //% *
453 //% * @param self The message into which to set the field.
454 //% * @param field The field to set.
455 //% * @param value The enum value to set in the field.
456 //% **/
457 //%void GPBSetMessageEnumField(GPBMessage *self,
458 //% GPBFieldDescriptor *field,
459 //% int32_t value);
460 //%
461 //%/**
462 //% * Get the given enum field of a message. No check is done to ensure the value
463 //% * was defined in the enum.
464 //% *
465 //% * @param self The message from which to get the field.
466 //% * @param field The field to get.
467 //% *
468 //% * @return The raw enum value for the given field.
469 //% **/
470 //%int32_t GPBGetMessageRawEnumField(GPBMessage *self, GPBFieldDescriptor *field);
471 //%
472 //%/**
473 //% * Set the given enum field of a message. You can set the value to anything,
474 //% * even a value that is not a member of the enum.
475 //% *
476 //% * @param self The message into which to set the field.
477 //% * @param field The field to set.
478 //% * @param value The raw enum value to set in the field.
479 //% **/
480 //%void GPBSetMessageRawEnumField(GPBMessage *self,
481 //% GPBFieldDescriptor *field,
482 //% int32_t value);
483 //%
484 //%// Repeated Fields
485 //%
486 //%/**
487 //% * Gets the value of a repeated field.
488 //% *
489 //% * @param self The message from which to get the field.
490 //% * @param field The repeated field to get.
491 //% *
492 //% * @return A GPB*Array or an NSMutableArray based on the field's type.
493 //% **/
494 //%id GPBGetMessageRepeatedField(GPBMessage *self, GPBFieldDescriptor *field);
495 //%
496 //%/**
497 //% * Sets the value of a repeated field.
498 //% *
499 //% * @param self The message into which to set the field.
500 //% * @param field The field to set.
501 //% * @param array A GPB*Array or NSMutableArray based on the field's type.
502 //% **/
503 //%void GPBSetMessageRepeatedField(GPBMessage *self,
504 //% GPBFieldDescriptor *field,
505 //% id array);
506 //%
507 //%// Map Fields
508 //%
509 //%/**
510 //% * Gets the value of a map<> field.
511 //% *
512 //% * @param self The message from which to get the field.
513 //% * @param field The repeated field to get.
514 //% *
515 //% * @return A GPB*Dictionary or NSMutableDictionary based on the field's type.
516 //% **/
517 //%id GPBGetMessageMapField(GPBMessage *self, GPBFieldDescriptor *field);
518 //%
519 //%/**
520 //% * Sets the value of a map<> field.
521 //% *
522 //% * @param self The message into which to set the field.
523 //% * @param field The field to set.
524 //% * @param dictionary A GPB*Dictionary or NSMutableDictionary based on the
525 //% * field's type.
526 //% **/
527 //%void GPBSetMessageMapField(GPBMessage *self,
528 //% GPBFieldDescriptor *field,
529 //% id dictionary);
530 //%
531 
532 //%PDDM-DEFINE GPB_ACCESSOR_SINGLE(NAME, TYPE, AN)
533 //%GPB_ACCESSOR_SINGLE_FULL(NAME, TYPE, AN, )
534 //%PDDM-DEFINE GPB_ACCESSOR_SINGLE_FULL(NAME, TYPE, AN, TisP)
535 //%/**
536 //% * Gets the value of a##AN NAME$L field.
537 //% *
538 //% * @param self The message from which to get the field.
539 //% * @param field The field to get.
540 //% **/
541 //%TYPE TisP##GPBGetMessage##NAME##Field(GPBMessage *self, GPBFieldDescriptor *field);
542 //%
543 //%/**
544 //% * Sets the value of a##AN NAME$L field.
545 //% *
546 //% * @param self The message into which to set the field.
547 //% * @param field The field to set.
548 //% * @param value The to set in the field.
549 //% **/
550 //%void GPBSetMessage##NAME##Field(GPBMessage *self, GPBFieldDescriptor *field, TYPE TisP##value);
551 //%
GPBSetMessageBytesField
void GPBSetMessageBytesField(GPBMessage *self, GPBFieldDescriptor *field, NSData *value)
GPBSetMessageRawEnumField
void GPBSetMessageRawEnumField(GPBMessage *self, GPBFieldDescriptor *field, int32_t value)
GPBSetMessageUInt64Field
void GPBSetMessageUInt64Field(GPBMessage *self, GPBFieldDescriptor *field, uint64_t value)
GPBOneofDescriptor
Definition: bloaty/third_party/protobuf/objectivec/GPBDescriptor.h:138
GPBGetMessageMessageField
GPBMessage * GPBGetMessageMessageField(GPBMessage *self, GPBFieldDescriptor *field)
GPBSetMessageMessageField
void GPBSetMessageMessageField(GPBMessage *self, GPBFieldDescriptor *field, GPBMessage *value)
GPBSetMessageMapField
void GPBSetMessageMapField(GPBMessage *self, GPBFieldDescriptor *field, id dictionary)
GPBGetMessageInt32Field
int32_t GPBGetMessageInt32Field(GPBMessage *self, GPBFieldDescriptor *field)
GPBGetMessageFloatField
float GPBGetMessageFloatField(GPBMessage *self, GPBFieldDescriptor *field)
GPBSetMessageStringField
void GPBSetMessageStringField(GPBMessage *self, GPBFieldDescriptor *field, NSString *value)
GPBRuntimeTypes.h
GPBTextFormatForUnknownFieldSet
NSString * GPBTextFormatForUnknownFieldSet(GPBUnknownFieldSet *__nullable unknownSet, NSString *__nullable lineIndent)
message
char * message
Definition: libuv/docs/code/tty-gravity/main.c:12
GPBSetMessageFloatField
void GPBSetMessageFloatField(GPBMessage *self, GPBFieldDescriptor *field, float value)
BOOL
int BOOL
Definition: undname.c:46
GPBClearOneof
void GPBClearOneof(GPBMessage *self, GPBOneofDescriptor *oneof)
uint32_t
unsigned int uint32_t
Definition: stdint-msvc2008.h:80
GPBGetMessageUInt64Field
uint64_t GPBGetMessageUInt64Field(GPBMessage *self, GPBFieldDescriptor *field)
GPBSetMessageInt64Field
void GPBSetMessageInt64Field(GPBMessage *self, GPBFieldDescriptor *field, int64_t value)
GPBSetMessageInt32Field
void GPBSetMessageInt32Field(GPBMessage *self, GPBFieldDescriptor *field, int32_t value)
array
Definition: undname.c:101
GPBClearMessageField
void GPBClearMessageField(GPBMessage *self, GPBFieldDescriptor *field)
int64_t
signed __int64 int64_t
Definition: stdint-msvc2008.h:89
GPBGetMessageBoolField
BOOL GPBGetMessageBoolField(GPBMessage *self, GPBFieldDescriptor *field)
GPBGetMessageRawEnumField
int32_t GPBGetMessageRawEnumField(GPBMessage *self, GPBFieldDescriptor *field)
uint64_t
unsigned __int64 uint64_t
Definition: stdint-msvc2008.h:90
__attribute__
__attribute__(void) start
GPBGetMessageEnumField
int32_t GPBGetMessageEnumField(GPBMessage *self, GPBFieldDescriptor *field)
GPBGetMessageGroupField
GPBMessage * GPBGetMessageGroupField(GPBMessage *self, GPBFieldDescriptor *field)
GPBGetMessageInt64Field
int64_t GPBGetMessageInt64Field(GPBMessage *self, GPBFieldDescriptor *field)
GPBGetMessageMapField
id GPBGetMessageMapField(GPBMessage *self, GPBFieldDescriptor *field)
GPBGetMessageDoubleField
double GPBGetMessageDoubleField(GPBMessage *self, GPBFieldDescriptor *field)
GPBArray.h
GPBSetMessageEnumField
void GPBSetMessageEnumField(GPBMessage *self, GPBFieldDescriptor *field, int32_t value)
value
const char * value
Definition: hpack_parser_table.cc:165
GPBMessageHasFieldNumberSet
BOOL GPBMessageHasFieldNumberSet(GPBMessage *self, uint32_t fieldNumber)
GPBEmptyNSData
NSData * GPBEmptyNSData(void) __attribute__((pure))
GPBGetMessageBytesField
NSData * GPBGetMessageBytesField(GPBMessage *self, GPBFieldDescriptor *field)
GPBTextFormatForMessage
CF_EXTERN_C_BEGIN NS_ASSUME_NONNULL_BEGIN NSString * GPBTextFormatForMessage(GPBMessage *message, NSString *__nullable lineIndent)
field
const FieldDescriptor * field
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/parser_unittest.cc:2692
GPBFieldDescriptor
Definition: bloaty/third_party/protobuf/objectivec/GPBDescriptor.h:167
GPBGetMessageUInt32Field
uint32_t GPBGetMessageUInt32Field(GPBMessage *self, GPBFieldDescriptor *field)
GPBMessage
Definition: bloaty/third_party/protobuf/objectivec/GPBMessage.h:83
GPBMessageDropUnknownFieldsRecursively
void GPBMessageDropUnknownFieldsRecursively(GPBMessage *message)
GPBSetMessageUInt32Field
void GPBSetMessageUInt32Field(GPBMessage *self, GPBFieldDescriptor *field, uint32_t value)
GPBSetMessageBoolField
void GPBSetMessageBoolField(GPBMessage *self, GPBFieldDescriptor *field, BOOL value)
GPBSetMessageRepeatedField
void GPBSetMessageRepeatedField(GPBMessage *self, GPBFieldDescriptor *field, id array)
GPBSetMessageGroupField
void GPBSetMessageGroupField(GPBMessage *self, GPBFieldDescriptor *field, GPBMessage *value)
GPBMessageHasFieldSet
BOOL GPBMessageHasFieldSet(GPBMessage *self, GPBFieldDescriptor *field)
GPBUnknownFieldSet
Definition: bloaty/third_party/protobuf/objectivec/GPBUnknownFieldSet.h:43
dictionary
static const char dictionary[]
Definition: bloaty/third_party/zlib/test/example.c:34
GPBSetMessageDoubleField
void GPBSetMessageDoubleField(GPBMessage *self, GPBFieldDescriptor *field, double value)
int32_t
signed int int32_t
Definition: stdint-msvc2008.h:77
GPBGetMessageStringField
NSString * GPBGetMessageStringField(GPBMessage *self, GPBFieldDescriptor *field)
GPBGetMessageRepeatedField
id GPBGetMessageRepeatedField(GPBMessage *self, GPBFieldDescriptor *field)
GPBMessage.h


grpc
Author(s):
autogenerated on Thu Mar 13 2025 02:59:47