blob: e49ada59ab52744e434b4bda88de493d37a324b9 [file] [log] [blame]
Thomas Van Lenten30650d82015-05-01 08:57:16 -04001// 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
Thomas Van Lentend846b0b2015-06-08 16:24:57 -040033#import "GPBArray.h"
Thomas Van Lenten30650d82015-05-01 08:57:16 -040034#import "GPBMessage.h"
Thomas Van Lentend846b0b2015-06-08 16:24:57 -040035#import "GPBRuntimeTypes.h"
Thomas Van Lenten30650d82015-05-01 08:57:16 -040036
Thomas Van Lenten3c8e9592020-04-13 10:49:16 -040037@class GPBOneofDescriptor;
38
Thomas Van Lenten30650d82015-05-01 08:57:16 -040039CF_EXTERN_C_BEGIN
40
Thomas Van Lenten8c889572015-06-16 16:45:14 -040041NS_ASSUME_NONNULL_BEGIN
42
Sergio Campamá32fadc02016-08-08 07:15:02 -070043/**
44 * Generates a string that should be a valid "TextFormat" for the C++ version
45 * of Protocol Buffers.
46 *
47 * @param message The message to generate from.
48 * @param lineIndent A string to use as the prefix for all lines generated. Can
49 * be nil if no extra indent is needed.
50 *
51 * @return An NSString with the TextFormat of the message.
52 **/
Thomas Van Lenten5d0b2172022-09-19 17:20:35 -040053NSString *GPBTextFormatForMessage(GPBMessage *message, NSString *__nullable lineIndent);
Thomas Van Lenten36650a02016-03-07 12:07:03 -050054
Sergio Campamá32fadc02016-08-08 07:15:02 -070055/**
56 * Generates a string that should be a valid "TextFormat" for the C++ version
57 * of Protocol Buffers.
58 *
59 * @param unknownSet The unknown field set to generate from.
60 * @param lineIndent A string to use as the prefix for all lines generated. Can
61 * be nil if no extra indent is needed.
62 *
63 * @return An NSString with the TextFormat of the unknown field set.
64 **/
Thomas Van Lenten5d0b2172022-09-19 17:20:35 -040065NSString *GPBTextFormatForUnknownFieldSet(GPBUnknownFieldSet *__nullable unknownSet,
66 NSString *__nullable lineIndent);
Thomas Van Lenten30650d82015-05-01 08:57:16 -040067
Sergio Campamá32fadc02016-08-08 07:15:02 -070068/**
69 * Checks if the given field number is set on a message.
70 *
71 * @param self The message to check.
72 * @param fieldNumber The field number to check.
73 *
74 * @return YES if the field number is set on the given message.
75 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -040076BOOL GPBMessageHasFieldNumberSet(GPBMessage *self, uint32_t fieldNumber);
Sergio Campamá32fadc02016-08-08 07:15:02 -070077
78/**
79 * Checks if the given field is set on a message.
80 *
81 * @param self The message to check.
82 * @param field The field to check.
83 *
84 * @return YES if the field is set on the given message.
85 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -040086BOOL GPBMessageHasFieldSet(GPBMessage *self, GPBFieldDescriptor *field);
87
Sergio Campamá32fadc02016-08-08 07:15:02 -070088/**
89 * Clears the given field for the given message.
90 *
91 * @param self The message for which to clear the field.
92 * @param field The field to clear.
93 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -040094void GPBClearMessageField(GPBMessage *self, GPBFieldDescriptor *field);
95
Thomas Van Lenten3c8e9592020-04-13 10:49:16 -040096/**
Thomas Van Lentendddeed22020-04-24 13:40:59 -040097 * Clears the given oneof field for the given message.
Thomas Van Lenten3c8e9592020-04-13 10:49:16 -040098 *
99 * @param self The message for which to clear the field.
100 * @param oneof The oneof to clear.
101 **/
102void GPBClearOneof(GPBMessage *self, GPBOneofDescriptor *oneof);
103
Thomas Van Lenten9e069b22022-09-19 13:34:01 -0400104// Disable clang-format for the macros.
105// clang-format off
106
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400107//%PDDM-EXPAND GPB_ACCESSORS()
108// This block of code is generated, do not edit it directly.
109
110
111//
Sergio Campamá32fadc02016-08-08 07:15:02 -0700112// Get/Set a given field from/to a message.
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400113//
114
115// Single Fields
116
Sergio Campamá32fadc02016-08-08 07:15:02 -0700117/**
118 * Gets the value of a bytes field.
119 *
120 * @param self The message from which to get the field.
121 * @param field The field to get.
122 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400123NSData *GPBGetMessageBytesField(GPBMessage *self, GPBFieldDescriptor *field);
Sergio Campamá32fadc02016-08-08 07:15:02 -0700124
125/**
126 * Sets the value of a bytes field.
127 *
128 * @param self The message into which to set the field.
129 * @param field The field to set.
130 * @param value The to set in the field.
131 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400132void GPBSetMessageBytesField(GPBMessage *self, GPBFieldDescriptor *field, NSData *value);
133
Sergio Campamá32fadc02016-08-08 07:15:02 -0700134/**
135 * Gets the value of a string field.
136 *
137 * @param self The message from which to get the field.
138 * @param field The field to get.
139 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400140NSString *GPBGetMessageStringField(GPBMessage *self, GPBFieldDescriptor *field);
Sergio Campamá32fadc02016-08-08 07:15:02 -0700141
142/**
143 * Sets the value of a string field.
144 *
145 * @param self The message into which to set the field.
146 * @param field The field to set.
147 * @param value The to set in the field.
148 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400149void GPBSetMessageStringField(GPBMessage *self, GPBFieldDescriptor *field, NSString *value);
150
Sergio Campamá32fadc02016-08-08 07:15:02 -0700151/**
152 * Gets the value of a message field.
153 *
154 * @param self The message from which to get the field.
155 * @param field The field to get.
156 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400157GPBMessage *GPBGetMessageMessageField(GPBMessage *self, GPBFieldDescriptor *field);
Sergio Campamá32fadc02016-08-08 07:15:02 -0700158
159/**
160 * Sets the value of a message field.
161 *
162 * @param self The message into which to set the field.
163 * @param field The field to set.
164 * @param value The to set in the field.
165 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400166void GPBSetMessageMessageField(GPBMessage *self, GPBFieldDescriptor *field, GPBMessage *value);
167
Sergio Campamá32fadc02016-08-08 07:15:02 -0700168/**
169 * Gets the value of a group field.
170 *
171 * @param self The message from which to get the field.
172 * @param field The field to get.
173 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400174GPBMessage *GPBGetMessageGroupField(GPBMessage *self, GPBFieldDescriptor *field);
Sergio Campamá32fadc02016-08-08 07:15:02 -0700175
176/**
177 * Sets the value of a group field.
178 *
179 * @param self The message into which to set the field.
180 * @param field The field to set.
181 * @param value The to set in the field.
182 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400183void GPBSetMessageGroupField(GPBMessage *self, GPBFieldDescriptor *field, GPBMessage *value);
184
Sergio Campamá32fadc02016-08-08 07:15:02 -0700185/**
186 * Gets the value of a bool field.
187 *
188 * @param self The message from which to get the field.
189 * @param field The field to get.
190 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400191BOOL GPBGetMessageBoolField(GPBMessage *self, GPBFieldDescriptor *field);
Sergio Campamá32fadc02016-08-08 07:15:02 -0700192
193/**
194 * Sets the value of a bool field.
195 *
196 * @param self The message into which to set the field.
197 * @param field The field to set.
198 * @param value The to set in the field.
199 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400200void GPBSetMessageBoolField(GPBMessage *self, GPBFieldDescriptor *field, BOOL value);
201
Sergio Campamá32fadc02016-08-08 07:15:02 -0700202/**
203 * Gets the value of an int32 field.
204 *
205 * @param self The message from which to get the field.
206 * @param field The field to get.
207 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400208int32_t GPBGetMessageInt32Field(GPBMessage *self, GPBFieldDescriptor *field);
Sergio Campamá32fadc02016-08-08 07:15:02 -0700209
210/**
211 * Sets the value of an int32 field.
212 *
213 * @param self The message into which to set the field.
214 * @param field The field to set.
215 * @param value The to set in the field.
216 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400217void GPBSetMessageInt32Field(GPBMessage *self, GPBFieldDescriptor *field, int32_t value);
218
Sergio Campamá32fadc02016-08-08 07:15:02 -0700219/**
220 * Gets the value of an uint32 field.
221 *
222 * @param self The message from which to get the field.
223 * @param field The field to get.
224 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400225uint32_t GPBGetMessageUInt32Field(GPBMessage *self, GPBFieldDescriptor *field);
Sergio Campamá32fadc02016-08-08 07:15:02 -0700226
227/**
228 * Sets the value of an uint32 field.
229 *
230 * @param self The message into which to set the field.
231 * @param field The field to set.
232 * @param value The to set in the field.
233 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400234void GPBSetMessageUInt32Field(GPBMessage *self, GPBFieldDescriptor *field, uint32_t value);
235
Sergio Campamá32fadc02016-08-08 07:15:02 -0700236/**
237 * Gets the value of an int64 field.
238 *
239 * @param self The message from which to get the field.
240 * @param field The field to get.
241 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400242int64_t GPBGetMessageInt64Field(GPBMessage *self, GPBFieldDescriptor *field);
Sergio Campamá32fadc02016-08-08 07:15:02 -0700243
244/**
245 * Sets the value of an int64 field.
246 *
247 * @param self The message into which to set the field.
248 * @param field The field to set.
249 * @param value The to set in the field.
250 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400251void GPBSetMessageInt64Field(GPBMessage *self, GPBFieldDescriptor *field, int64_t value);
252
Sergio Campamá32fadc02016-08-08 07:15:02 -0700253/**
254 * Gets the value of an uint64 field.
255 *
256 * @param self The message from which to get the field.
257 * @param field The field to get.
258 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400259uint64_t GPBGetMessageUInt64Field(GPBMessage *self, GPBFieldDescriptor *field);
Sergio Campamá32fadc02016-08-08 07:15:02 -0700260
261/**
262 * Sets the value of an uint64 field.
263 *
264 * @param self The message into which to set the field.
265 * @param field The field to set.
266 * @param value The to set in the field.
267 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400268void GPBSetMessageUInt64Field(GPBMessage *self, GPBFieldDescriptor *field, uint64_t value);
269
Sergio Campamá32fadc02016-08-08 07:15:02 -0700270/**
271 * Gets the value of a float field.
272 *
273 * @param self The message from which to get the field.
274 * @param field The field to get.
275 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400276float GPBGetMessageFloatField(GPBMessage *self, GPBFieldDescriptor *field);
Sergio Campamá32fadc02016-08-08 07:15:02 -0700277
278/**
279 * Sets the value of a float field.
280 *
281 * @param self The message into which to set the field.
282 * @param field The field to set.
283 * @param value The to set in the field.
284 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400285void GPBSetMessageFloatField(GPBMessage *self, GPBFieldDescriptor *field, float value);
286
Sergio Campamá32fadc02016-08-08 07:15:02 -0700287/**
288 * Gets the value of a double field.
289 *
290 * @param self The message from which to get the field.
291 * @param field The field to get.
292 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400293double GPBGetMessageDoubleField(GPBMessage *self, GPBFieldDescriptor *field);
Sergio Campamá32fadc02016-08-08 07:15:02 -0700294
295/**
296 * Sets the value of a double field.
297 *
298 * @param self The message into which to set the field.
299 * @param field The field to set.
300 * @param value The to set in the field.
301 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400302void GPBSetMessageDoubleField(GPBMessage *self, GPBFieldDescriptor *field, double value);
303
Sergio Campamá32fadc02016-08-08 07:15:02 -0700304/**
305 * Gets the given enum field of a message. For proto3, if the value isn't a
306 * member of the enum, @c kGPBUnrecognizedEnumeratorValue will be returned.
307 * GPBGetMessageRawEnumField will bypass the check and return whatever value
308 * was set.
309 *
310 * @param self The message from which to get the field.
311 * @param field The field to get.
312 *
313 * @return The enum value for the given field.
314 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400315int32_t GPBGetMessageEnumField(GPBMessage *self, GPBFieldDescriptor *field);
Sergio Campamá32fadc02016-08-08 07:15:02 -0700316
317/**
318 * Set the given enum field of a message. You can only set values that are
319 * members of the enum.
320 *
321 * @param self The message into which to set the field.
322 * @param field The field to set.
323 * @param value The enum value to set in the field.
324 **/
325void GPBSetMessageEnumField(GPBMessage *self,
326 GPBFieldDescriptor *field,
327 int32_t value);
328
329/**
330 * Get the given enum field of a message. No check is done to ensure the value
331 * was defined in the enum.
332 *
333 * @param self The message from which to get the field.
334 * @param field The field to get.
335 *
336 * @return The raw enum value for the given field.
337 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400338int32_t GPBGetMessageRawEnumField(GPBMessage *self, GPBFieldDescriptor *field);
Sergio Campamá32fadc02016-08-08 07:15:02 -0700339
340/**
341 * Set the given enum field of a message. You can set the value to anything,
342 * even a value that is not a member of the enum.
343 *
344 * @param self The message into which to set the field.
345 * @param field The field to set.
346 * @param value The raw enum value to set in the field.
347 **/
348void GPBSetMessageRawEnumField(GPBMessage *self,
349 GPBFieldDescriptor *field,
350 int32_t value);
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400351
352// Repeated Fields
353
Sergio Campamá32fadc02016-08-08 07:15:02 -0700354/**
355 * Gets the value of a repeated field.
356 *
357 * @param self The message from which to get the field.
358 * @param field The repeated field to get.
359 *
360 * @return A GPB*Array or an NSMutableArray based on the field's type.
361 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400362id GPBGetMessageRepeatedField(GPBMessage *self, GPBFieldDescriptor *field);
Sergio Campamá32fadc02016-08-08 07:15:02 -0700363
364/**
365 * Sets the value of a repeated field.
366 *
367 * @param self The message into which to set the field.
368 * @param field The field to set.
369 * @param array A GPB*Array or NSMutableArray based on the field's type.
370 **/
371void GPBSetMessageRepeatedField(GPBMessage *self,
372 GPBFieldDescriptor *field,
373 id array);
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400374
375// Map Fields
376
Sergio Campamá32fadc02016-08-08 07:15:02 -0700377/**
378 * Gets the value of a map<> field.
379 *
380 * @param self The message from which to get the field.
381 * @param field The repeated field to get.
382 *
383 * @return A GPB*Dictionary or NSMutableDictionary based on the field's type.
384 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400385id GPBGetMessageMapField(GPBMessage *self, GPBFieldDescriptor *field);
Sergio Campamá32fadc02016-08-08 07:15:02 -0700386
387/**
388 * Sets the value of a map<> field.
389 *
390 * @param self The message into which to set the field.
391 * @param field The field to set.
392 * @param dictionary A GPB*Dictionary or NSMutableDictionary based on the
393 * field's type.
394 **/
395void GPBSetMessageMapField(GPBMessage *self,
396 GPBFieldDescriptor *field,
397 id dictionary);
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400398
399//%PDDM-EXPAND-END GPB_ACCESSORS()
400
Thomas Van Lenten9e069b22022-09-19 13:34:01 -0400401// clang-format on
402
Sergio Campamá32fadc02016-08-08 07:15:02 -0700403/**
404 * Returns an empty NSData to assign to byte fields when you wish to assign them
405 * to empty. Prevents allocating a lot of little [NSData data] objects.
406 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400407NSData *GPBEmptyNSData(void) __attribute__((pure));
408
Thomas Van Lentend0717662017-02-23 12:29:00 -0500409/**
410 * Drops the `unknownFields` from the given message and from all sub message.
411 **/
412void GPBMessageDropUnknownFieldsRecursively(GPBMessage *message);
413
Thomas Van Lenten8c889572015-06-16 16:45:14 -0400414NS_ASSUME_NONNULL_END
415
Thomas Van Lenten30650d82015-05-01 08:57:16 -0400416CF_EXTERN_C_END
417
Thomas Van Lenten9e069b22022-09-19 13:34:01 -0400418// Disable clang-format for the macros.
419// clang-format off
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400420
421//%PDDM-DEFINE GPB_ACCESSORS()
Thomas Van Lenten30650d82015-05-01 08:57:16 -0400422//%
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400423//%//
Sergio Campamá32fadc02016-08-08 07:15:02 -0700424//%// Get/Set a given field from/to a message.
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400425//%//
426//%
427//%// Single Fields
428//%
Thomas Van Lenten36650a02016-03-07 12:07:03 -0500429//%GPB_ACCESSOR_SINGLE_FULL(Bytes, NSData, , *)
430//%GPB_ACCESSOR_SINGLE_FULL(String, NSString, , *)
431//%GPB_ACCESSOR_SINGLE_FULL(Message, GPBMessage, , *)
432//%GPB_ACCESSOR_SINGLE_FULL(Group, GPBMessage, , *)
433//%GPB_ACCESSOR_SINGLE(Bool, BOOL, )
434//%GPB_ACCESSOR_SINGLE(Int32, int32_t, n)
435//%GPB_ACCESSOR_SINGLE(UInt32, uint32_t, n)
436//%GPB_ACCESSOR_SINGLE(Int64, int64_t, n)
437//%GPB_ACCESSOR_SINGLE(UInt64, uint64_t, n)
438//%GPB_ACCESSOR_SINGLE(Float, float, )
439//%GPB_ACCESSOR_SINGLE(Double, double, )
Sergio Campamá32fadc02016-08-08 07:15:02 -0700440//%/**
441//% * Gets the given enum field of a message. For proto3, if the value isn't a
442//% * member of the enum, @c kGPBUnrecognizedEnumeratorValue will be returned.
443//% * GPBGetMessageRawEnumField will bypass the check and return whatever value
444//% * was set.
445//% *
446//% * @param self The message from which to get the field.
447//% * @param field The field to get.
448//% *
449//% * @return The enum value for the given field.
450//% **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400451//%int32_t GPBGetMessageEnumField(GPBMessage *self, GPBFieldDescriptor *field);
Sergio Campamá32fadc02016-08-08 07:15:02 -0700452//%
453//%/**
454//% * Set the given enum field of a message. You can only set values that are
455//% * members of the enum.
456//% *
457//% * @param self The message into which to set the field.
458//% * @param field The field to set.
459//% * @param value The enum value to set in the field.
460//% **/
461//%void GPBSetMessageEnumField(GPBMessage *self,
462//% GPBFieldDescriptor *field,
463//% int32_t value);
464//%
465//%/**
466//% * Get the given enum field of a message. No check is done to ensure the value
467//% * was defined in the enum.
468//% *
469//% * @param self The message from which to get the field.
470//% * @param field The field to get.
471//% *
472//% * @return The raw enum value for the given field.
473//% **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400474//%int32_t GPBGetMessageRawEnumField(GPBMessage *self, GPBFieldDescriptor *field);
Sergio Campamá32fadc02016-08-08 07:15:02 -0700475//%
476//%/**
477//% * Set the given enum field of a message. You can set the value to anything,
478//% * even a value that is not a member of the enum.
479//% *
480//% * @param self The message into which to set the field.
481//% * @param field The field to set.
482//% * @param value The raw enum value to set in the field.
483//% **/
484//%void GPBSetMessageRawEnumField(GPBMessage *self,
485//% GPBFieldDescriptor *field,
486//% int32_t value);
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400487//%
488//%// Repeated Fields
489//%
Sergio Campamá32fadc02016-08-08 07:15:02 -0700490//%/**
491//% * Gets the value of a repeated field.
492//% *
493//% * @param self The message from which to get the field.
494//% * @param field The repeated field to get.
495//% *
496//% * @return A GPB*Array or an NSMutableArray based on the field's type.
497//% **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400498//%id GPBGetMessageRepeatedField(GPBMessage *self, GPBFieldDescriptor *field);
Sergio Campamá32fadc02016-08-08 07:15:02 -0700499//%
500//%/**
501//% * Sets the value of a repeated field.
502//% *
503//% * @param self The message into which to set the field.
504//% * @param field The field to set.
505//% * @param array A GPB*Array or NSMutableArray based on the field's type.
506//% **/
507//%void GPBSetMessageRepeatedField(GPBMessage *self,
508//% GPBFieldDescriptor *field,
509//% id array);
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400510//%
511//%// Map Fields
512//%
Sergio Campamá32fadc02016-08-08 07:15:02 -0700513//%/**
514//% * Gets the value of a map<> field.
515//% *
516//% * @param self The message from which to get the field.
517//% * @param field The repeated field to get.
518//% *
519//% * @return A GPB*Dictionary or NSMutableDictionary based on the field's type.
520//% **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400521//%id GPBGetMessageMapField(GPBMessage *self, GPBFieldDescriptor *field);
Sergio Campamá32fadc02016-08-08 07:15:02 -0700522//%
523//%/**
524//% * Sets the value of a map<> field.
525//% *
526//% * @param self The message into which to set the field.
527//% * @param field The field to set.
528//% * @param dictionary A GPB*Dictionary or NSMutableDictionary based on the
529//% * field's type.
530//% **/
531//%void GPBSetMessageMapField(GPBMessage *self,
532//% GPBFieldDescriptor *field,
533//% id dictionary);
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400534//%
535
Thomas Van Lenten36650a02016-03-07 12:07:03 -0500536//%PDDM-DEFINE GPB_ACCESSOR_SINGLE(NAME, TYPE, AN)
537//%GPB_ACCESSOR_SINGLE_FULL(NAME, TYPE, AN, )
538//%PDDM-DEFINE GPB_ACCESSOR_SINGLE_FULL(NAME, TYPE, AN, TisP)
Sergio Campamá32fadc02016-08-08 07:15:02 -0700539//%/**
540//% * Gets the value of a##AN NAME$L field.
541//% *
542//% * @param self The message from which to get the field.
543//% * @param field The field to get.
544//% **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400545//%TYPE TisP##GPBGetMessage##NAME##Field(GPBMessage *self, GPBFieldDescriptor *field);
Sergio Campamá32fadc02016-08-08 07:15:02 -0700546//%
547//%/**
548//% * Sets the value of a##AN NAME$L field.
549//% *
550//% * @param self The message into which to set the field.
551//% * @param field The field to set.
552//% * @param value The to set in the field.
553//% **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400554//%void GPBSetMessage##NAME##Field(GPBMessage *self, GPBFieldDescriptor *field, TYPE TisP##value);
555//%
Thomas Van Lenten9e069b22022-09-19 13:34:01 -0400556
557// clang-format on