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 CF_EXTERN_C_BEGIN
38 
39 NS_ASSUME_NONNULL_BEGIN
40 
52  NSString * __nullable lineIndent);
53 
64 NSString *GPBTextFormatForUnknownFieldSet(GPBUnknownFieldSet * __nullable unknownSet,
65  NSString * __nullable lineIndent);
66 
75 BOOL GPBMessageHasFieldNumberSet(GPBMessage *self, uint32_t fieldNumber);
76 
86 
94 
95 //%PDDM-EXPAND GPB_ACCESSORS()
96 // This block of code is generated, do not edit it directly.
97 
98 
99 //
100 // Get/Set a given field from/to a message.
101 //
102 
103 // Single Fields
104 
112 
121 
129 
138 
146 
155 
163 
172 
180 
189 
197 
206 
214 
223 
231 
240 
248 
257 
265 
274 
282 
291 
304 
315  int32_t value);
316 
327 
338  int32_t value);
339 
340 // Repeated Fields
341 
351 
361  id array);
362 
363 // Map Fields
364 
374 
385  id dictionary);
386 
387 //%PDDM-EXPAND-END GPB_ACCESSORS()
388 
393 NSData *GPBEmptyNSData(void) __attribute__((pure));
394 
399 
400 NS_ASSUME_NONNULL_END
401 
402 CF_EXTERN_C_END
403 
404 
405 //%PDDM-DEFINE GPB_ACCESSORS()
406 //%
407 //%//
408 //%// Get/Set a given field from/to a message.
409 //%//
410 //%
411 //%// Single Fields
412 //%
413 //%GPB_ACCESSOR_SINGLE_FULL(Bytes, NSData, , *)
414 //%GPB_ACCESSOR_SINGLE_FULL(String, NSString, , *)
415 //%GPB_ACCESSOR_SINGLE_FULL(Message, GPBMessage, , *)
416 //%GPB_ACCESSOR_SINGLE_FULL(Group, GPBMessage, , *)
417 //%GPB_ACCESSOR_SINGLE(Bool, BOOL, )
418 //%GPB_ACCESSOR_SINGLE(Int32, int32_t, n)
419 //%GPB_ACCESSOR_SINGLE(UInt32, uint32_t, n)
420 //%GPB_ACCESSOR_SINGLE(Int64, int64_t, n)
421 //%GPB_ACCESSOR_SINGLE(UInt64, uint64_t, n)
422 //%GPB_ACCESSOR_SINGLE(Float, float, )
423 //%GPB_ACCESSOR_SINGLE(Double, double, )
424 //%/**
425 //% * Gets the given enum field of a message. For proto3, if the value isn't a
426 //% * member of the enum, @c kGPBUnrecognizedEnumeratorValue will be returned.
427 //% * GPBGetMessageRawEnumField will bypass the check and return whatever value
428 //% * was set.
429 //% *
430 //% * @param self The message from which to get the field.
431 //% * @param field The field to get.
432 //% *
433 //% * @return The enum value for the given field.
434 //% **/
435 //%int32_t GPBGetMessageEnumField(GPBMessage *self, GPBFieldDescriptor *field);
436 //%
437 //%/**
438 //% * Set the given enum field of a message. You can only set values that are
439 //% * members of the enum.
440 //% *
441 //% * @param self The message into which to set the field.
442 //% * @param field The field to set.
443 //% * @param value The enum value to set in the field.
444 //% **/
445 //%void GPBSetMessageEnumField(GPBMessage *self,
446 //% GPBFieldDescriptor *field,
447 //% int32_t value);
448 //%
449 //%/**
450 //% * Get the given enum field of a message. No check is done to ensure the value
451 //% * was defined in the enum.
452 //% *
453 //% * @param self The message from which to get the field.
454 //% * @param field The field to get.
455 //% *
456 //% * @return The raw enum value for the given field.
457 //% **/
458 //%int32_t GPBGetMessageRawEnumField(GPBMessage *self, GPBFieldDescriptor *field);
459 //%
460 //%/**
461 //% * Set the given enum field of a message. You can set the value to anything,
462 //% * even a value that is not a member of the enum.
463 //% *
464 //% * @param self The message into which to set the field.
465 //% * @param field The field to set.
466 //% * @param value The raw enum value to set in the field.
467 //% **/
468 //%void GPBSetMessageRawEnumField(GPBMessage *self,
469 //% GPBFieldDescriptor *field,
470 //% int32_t value);
471 //%
472 //%// Repeated Fields
473 //%
474 //%/**
475 //% * Gets the value of a repeated field.
476 //% *
477 //% * @param self The message from which to get the field.
478 //% * @param field The repeated field to get.
479 //% *
480 //% * @return A GPB*Array or an NSMutableArray based on the field's type.
481 //% **/
482 //%id GPBGetMessageRepeatedField(GPBMessage *self, GPBFieldDescriptor *field);
483 //%
484 //%/**
485 //% * Sets the value of a repeated field.
486 //% *
487 //% * @param self The message into which to set the field.
488 //% * @param field The field to set.
489 //% * @param array A GPB*Array or NSMutableArray based on the field's type.
490 //% **/
491 //%void GPBSetMessageRepeatedField(GPBMessage *self,
492 //% GPBFieldDescriptor *field,
493 //% id array);
494 //%
495 //%// Map Fields
496 //%
497 //%/**
498 //% * Gets the value of a map<> field.
499 //% *
500 //% * @param self The message from which to get the field.
501 //% * @param field The repeated field to get.
502 //% *
503 //% * @return A GPB*Dictionary or NSMutableDictionary based on the field's type.
504 //% **/
505 //%id GPBGetMessageMapField(GPBMessage *self, GPBFieldDescriptor *field);
506 //%
507 //%/**
508 //% * Sets the value of a map<> field.
509 //% *
510 //% * @param self The message into which to set the field.
511 //% * @param field The field to set.
512 //% * @param dictionary A GPB*Dictionary or NSMutableDictionary based on the
513 //% * field's type.
514 //% **/
515 //%void GPBSetMessageMapField(GPBMessage *self,
516 //% GPBFieldDescriptor *field,
517 //% id dictionary);
518 //%
519 
520 //%PDDM-DEFINE GPB_ACCESSOR_SINGLE(NAME, TYPE, AN)
521 //%GPB_ACCESSOR_SINGLE_FULL(NAME, TYPE, AN, )
522 //%PDDM-DEFINE GPB_ACCESSOR_SINGLE_FULL(NAME, TYPE, AN, TisP)
523 //%/**
524 //% * Gets the value of a##AN NAME$L field.
525 //% *
526 //% * @param self The message from which to get the field.
527 //% * @param field The field to get.
528 //% **/
529 //%TYPE TisP##GPBGetMessage##NAME##Field(GPBMessage *self, GPBFieldDescriptor *field);
530 //%
531 //%/**
532 //% * Sets the value of a##AN NAME$L field.
533 //% *
534 //% * @param self The message into which to set the field.
535 //% * @param field The field to set.
536 //% * @param value The to set in the field.
537 //% **/
538 //%void GPBSetMessage##NAME##Field(GPBMessage *self, GPBFieldDescriptor *field, TYPE TisP##value);
539 //%
GPBSetMessageDoubleField
void GPBSetMessageDoubleField(GPBMessage *self, GPBFieldDescriptor *field, double value)
GPBGetMessageRepeatedField
id GPBGetMessageRepeatedField(GPBMessage *self, GPBFieldDescriptor *field)
GPBClearMessageField
void GPBClearMessageField(GPBMessage *self, GPBFieldDescriptor *field)
GPBSetMessageRawEnumField
void GPBSetMessageRawEnumField(GPBMessage *self, GPBFieldDescriptor *field, int32_t value)
GPBMessageHasFieldNumberSet
BOOL GPBMessageHasFieldNumberSet(GPBMessage *self, uint32_t fieldNumber)
GPBSetMessageBoolField
void GPBSetMessageBoolField(GPBMessage *self, GPBFieldDescriptor *field, BOOL value)
GPBSetMessageBytesField
void GPBSetMessageBytesField(GPBMessage *self, GPBFieldDescriptor *field, NSData *value)
GPBSetMessageFloatField
void GPBSetMessageFloatField(GPBMessage *self, GPBFieldDescriptor *field, float value)
GPBGetMessageStringField
NSString * GPBGetMessageStringField(GPBMessage *self, GPBFieldDescriptor *field)
GPBGetMessageUInt64Field
uint64_t GPBGetMessageUInt64Field(GPBMessage *self, GPBFieldDescriptor *field)
GPBGetMessageInt32Field
int32_t GPBGetMessageInt32Field(GPBMessage *self, GPBFieldDescriptor *field)
GPBGetMessageEnumField
int32_t GPBGetMessageEnumField(GPBMessage *self, GPBFieldDescriptor *field)
GPBGetMessageUInt32Field
uint32_t GPBGetMessageUInt32Field(GPBMessage *self, GPBFieldDescriptor *field)
GPBSetMessageEnumField
void GPBSetMessageEnumField(GPBMessage *self, GPBFieldDescriptor *field, int32_t value)
GPBGetMessageBoolField
BOOL GPBGetMessageBoolField(GPBMessage *self, GPBFieldDescriptor *field)
GPBGetMessageGroupField
GPBMessage * GPBGetMessageGroupField(GPBMessage *self, GPBFieldDescriptor *field)
GPBGetMessageMessageField
GPBMessage * GPBGetMessageMessageField(GPBMessage *self, GPBFieldDescriptor *field)
GPBGetMessageFloatField
float GPBGetMessageFloatField(GPBMessage *self, GPBFieldDescriptor *field)
GPBSetMessageInt32Field
void GPBSetMessageInt32Field(GPBMessage *self, GPBFieldDescriptor *field, int32_t value)
GPBRuntimeTypes.h
GPBTextFormatForMessage
CF_EXTERN_C_BEGIN NS_ASSUME_NONNULL_BEGIN NSString * GPBTextFormatForMessage(GPBMessage *message, NSString *__nullable lineIndent)
GPBSetMessageRepeatedField
void GPBSetMessageRepeatedField(GPBMessage *self, GPBFieldDescriptor *field, id array)
GPBEmptyNSData
NSData * GPBEmptyNSData(void) __attribute__((pure))
GPBSetMessageGroupField
void GPBSetMessageGroupField(GPBMessage *self, GPBFieldDescriptor *field, GPBMessage *value)
field
const FieldDescriptor * field
Definition: parser_unittest.cc:2694
GPBArray.h
GPBGetMessageInt64Field
int64_t GPBGetMessageInt64Field(GPBMessage *self, GPBFieldDescriptor *field)
GPBGetMessageBytesField
NSData * GPBGetMessageBytesField(GPBMessage *self, GPBFieldDescriptor *field)
GPBFieldDescriptor
Definition: GPBDescriptor.h:167
GPBSetMessageUInt64Field
void GPBSetMessageUInt64Field(GPBMessage *self, GPBFieldDescriptor *field, uint64_t value)
GPBSetMessageMapField
void GPBSetMessageMapField(GPBMessage *self, GPBFieldDescriptor *field, id dictionary)
GPBMessage
Definition: GPBMessage.h:83
GPBSetMessageInt64Field
void GPBSetMessageInt64Field(GPBMessage *self, GPBFieldDescriptor *field, int64_t value)
GPBTextFormatForUnknownFieldSet
NSString * GPBTextFormatForUnknownFieldSet(GPBUnknownFieldSet *__nullable unknownSet, NSString *__nullable lineIndent)
GPBMessageHasFieldSet
BOOL GPBMessageHasFieldSet(GPBMessage *self, GPBFieldDescriptor *field)
GPBSetMessageStringField
void GPBSetMessageStringField(GPBMessage *self, GPBFieldDescriptor *field, NSString *value)
GPBSetMessageMessageField
void GPBSetMessageMessageField(GPBMessage *self, GPBFieldDescriptor *field, GPBMessage *value)
GPBGetMessageMapField
id GPBGetMessageMapField(GPBMessage *self, GPBFieldDescriptor *field)
GPBUnknownFieldSet
Definition: GPBUnknownFieldSet.h:43
value
GLsizei const GLfloat * value
Definition: glcorearb.h:3093
GPBGetMessageRawEnumField
int32_t GPBGetMessageRawEnumField(GPBMessage *self, GPBFieldDescriptor *field)
GPBSetMessageUInt32Field
void GPBSetMessageUInt32Field(GPBMessage *self, GPBFieldDescriptor *field, uint32_t value)
GPBMessageDropUnknownFieldsRecursively
void GPBMessageDropUnknownFieldsRecursively(GPBMessage *message)
GPBGetMessageDoubleField
double GPBGetMessageDoubleField(GPBMessage *self, GPBFieldDescriptor *field)
message
GLenum GLuint GLenum GLsizei const GLchar * message
Definition: glcorearb.h:2695
array
PHP_PROTO_OBJECT_FREE_END PHP_PROTO_OBJECT_DTOR_END intern array
Definition: array.c:111
GPBMessage.h


libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:53