blob: 75759b2334077556e1b7f837214d02e7e5738fa9 [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 Lenten8c889572015-06-16 16:45:14 -040053NSString *GPBTextFormatForMessage(GPBMessage *message,
54 NSString * __nullable lineIndent);
Thomas Van Lenten36650a02016-03-07 12:07:03 -050055
Sergio Campamá32fadc02016-08-08 07:15:02 -070056/**
57 * Generates a string that should be a valid "TextFormat" for the C++ version
58 * of Protocol Buffers.
59 *
60 * @param unknownSet The unknown field set to generate from.
61 * @param lineIndent A string to use as the prefix for all lines generated. Can
62 * be nil if no extra indent is needed.
63 *
64 * @return An NSString with the TextFormat of the unknown field set.
65 **/
Thomas Van Lentenc27833b2015-12-07 10:49:30 -050066NSString *GPBTextFormatForUnknownFieldSet(GPBUnknownFieldSet * __nullable unknownSet,
Thomas Van Lenten8c889572015-06-16 16:45:14 -040067 NSString * __nullable lineIndent);
Thomas Van Lenten30650d82015-05-01 08:57:16 -040068
Sergio Campamá32fadc02016-08-08 07:15:02 -070069/**
70 * Checks if the given field number is set on a message.
71 *
72 * @param self The message to check.
73 * @param fieldNumber The field number to check.
74 *
75 * @return YES if the field number is set on the given message.
76 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -040077BOOL GPBMessageHasFieldNumberSet(GPBMessage *self, uint32_t fieldNumber);
Sergio Campamá32fadc02016-08-08 07:15:02 -070078
79/**
80 * Checks if the given field is set on a message.
81 *
82 * @param self The message to check.
83 * @param field The field to check.
84 *
85 * @return YES if the field is set on the given message.
86 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -040087BOOL GPBMessageHasFieldSet(GPBMessage *self, GPBFieldDescriptor *field);
88
Sergio Campamá32fadc02016-08-08 07:15:02 -070089/**
90 * Clears the given field for the given message.
91 *
92 * @param self The message for which to clear the field.
93 * @param field The field to clear.
94 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -040095void GPBClearMessageField(GPBMessage *self, GPBFieldDescriptor *field);
96
Thomas Van Lenten3c8e9592020-04-13 10:49:16 -040097/**
Thomas Van Lentendddeed22020-04-24 13:40:59 -040098 * Clears the given oneof field for the given message.
Thomas Van Lenten3c8e9592020-04-13 10:49:16 -040099 *
100 * @param self The message for which to clear the field.
101 * @param oneof The oneof to clear.
102 **/
103void GPBClearOneof(GPBMessage *self, GPBOneofDescriptor *oneof);
104
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400105//%PDDM-EXPAND GPB_ACCESSORS()
106// This block of code is generated, do not edit it directly.
Dave MacLachlanab48ecf2020-01-20 13:47:20 -0800107// clang-format off
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400108
109
110//
Sergio Campamá32fadc02016-08-08 07:15:02 -0700111// Get/Set a given field from/to a message.
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400112//
113
114// Single Fields
115
Sergio Campamá32fadc02016-08-08 07:15:02 -0700116/**
117 * Gets the value of a bytes field.
118 *
119 * @param self The message from which to get the field.
120 * @param field The field to get.
121 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400122NSData *GPBGetMessageBytesField(GPBMessage *self, GPBFieldDescriptor *field);
Sergio Campamá32fadc02016-08-08 07:15:02 -0700123
124/**
125 * Sets the value of a bytes field.
126 *
127 * @param self The message into which to set the field.
128 * @param field The field to set.
129 * @param value The to set in the field.
130 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400131void GPBSetMessageBytesField(GPBMessage *self, GPBFieldDescriptor *field, NSData *value);
132
Sergio Campamá32fadc02016-08-08 07:15:02 -0700133/**
134 * Gets the value of a string field.
135 *
136 * @param self The message from which to get the field.
137 * @param field The field to get.
138 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400139NSString *GPBGetMessageStringField(GPBMessage *self, GPBFieldDescriptor *field);
Sergio Campamá32fadc02016-08-08 07:15:02 -0700140
141/**
142 * Sets the value of a string field.
143 *
144 * @param self The message into which to set the field.
145 * @param field The field to set.
146 * @param value The to set in the field.
147 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400148void GPBSetMessageStringField(GPBMessage *self, GPBFieldDescriptor *field, NSString *value);
149
Sergio Campamá32fadc02016-08-08 07:15:02 -0700150/**
151 * Gets the value of a message field.
152 *
153 * @param self The message from which to get the field.
154 * @param field The field to get.
155 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400156GPBMessage *GPBGetMessageMessageField(GPBMessage *self, GPBFieldDescriptor *field);
Sergio Campamá32fadc02016-08-08 07:15:02 -0700157
158/**
159 * Sets the value of a message field.
160 *
161 * @param self The message into which to set the field.
162 * @param field The field to set.
163 * @param value The to set in the field.
164 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400165void GPBSetMessageMessageField(GPBMessage *self, GPBFieldDescriptor *field, GPBMessage *value);
166
Sergio Campamá32fadc02016-08-08 07:15:02 -0700167/**
168 * Gets the value of a group field.
169 *
170 * @param self The message from which to get the field.
171 * @param field The field to get.
172 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400173GPBMessage *GPBGetMessageGroupField(GPBMessage *self, GPBFieldDescriptor *field);
Sergio Campamá32fadc02016-08-08 07:15:02 -0700174
175/**
176 * Sets the value of a group field.
177 *
178 * @param self The message into which to set the field.
179 * @param field The field to set.
180 * @param value The to set in the field.
181 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400182void GPBSetMessageGroupField(GPBMessage *self, GPBFieldDescriptor *field, GPBMessage *value);
183
Sergio Campamá32fadc02016-08-08 07:15:02 -0700184/**
185 * Gets the value of a bool field.
186 *
187 * @param self The message from which to get the field.
188 * @param field The field to get.
189 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400190BOOL GPBGetMessageBoolField(GPBMessage *self, GPBFieldDescriptor *field);
Sergio Campamá32fadc02016-08-08 07:15:02 -0700191
192/**
193 * Sets the value of a bool field.
194 *
195 * @param self The message into which to set the field.
196 * @param field The field to set.
197 * @param value The to set in the field.
198 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400199void GPBSetMessageBoolField(GPBMessage *self, GPBFieldDescriptor *field, BOOL value);
200
Sergio Campamá32fadc02016-08-08 07:15:02 -0700201/**
202 * Gets the value of an int32 field.
203 *
204 * @param self The message from which to get the field.
205 * @param field The field to get.
206 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400207int32_t GPBGetMessageInt32Field(GPBMessage *self, GPBFieldDescriptor *field);
Sergio Campamá32fadc02016-08-08 07:15:02 -0700208
209/**
210 * Sets the value of an int32 field.
211 *
212 * @param self The message into which to set the field.
213 * @param field The field to set.
214 * @param value The to set in the field.
215 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400216void GPBSetMessageInt32Field(GPBMessage *self, GPBFieldDescriptor *field, int32_t value);
217
Sergio Campamá32fadc02016-08-08 07:15:02 -0700218/**
219 * Gets the value of an uint32 field.
220 *
221 * @param self The message from which to get the field.
222 * @param field The field to get.
223 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400224uint32_t GPBGetMessageUInt32Field(GPBMessage *self, GPBFieldDescriptor *field);
Sergio Campamá32fadc02016-08-08 07:15:02 -0700225
226/**
227 * Sets the value of an uint32 field.
228 *
229 * @param self The message into which to set the field.
230 * @param field The field to set.
231 * @param value The to set in the field.
232 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400233void GPBSetMessageUInt32Field(GPBMessage *self, GPBFieldDescriptor *field, uint32_t value);
234
Sergio Campamá32fadc02016-08-08 07:15:02 -0700235/**
236 * Gets the value of an int64 field.
237 *
238 * @param self The message from which to get the field.
239 * @param field The field to get.
240 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400241int64_t GPBGetMessageInt64Field(GPBMessage *self, GPBFieldDescriptor *field);
Sergio Campamá32fadc02016-08-08 07:15:02 -0700242
243/**
244 * Sets the value of an int64 field.
245 *
246 * @param self The message into which to set the field.
247 * @param field The field to set.
248 * @param value The to set in the field.
249 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400250void GPBSetMessageInt64Field(GPBMessage *self, GPBFieldDescriptor *field, int64_t value);
251
Sergio Campamá32fadc02016-08-08 07:15:02 -0700252/**
253 * Gets the value of an uint64 field.
254 *
255 * @param self The message from which to get the field.
256 * @param field The field to get.
257 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400258uint64_t GPBGetMessageUInt64Field(GPBMessage *self, GPBFieldDescriptor *field);
Sergio Campamá32fadc02016-08-08 07:15:02 -0700259
260/**
261 * Sets the value of an uint64 field.
262 *
263 * @param self The message into which to set the field.
264 * @param field The field to set.
265 * @param value The to set in the field.
266 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400267void GPBSetMessageUInt64Field(GPBMessage *self, GPBFieldDescriptor *field, uint64_t value);
268
Sergio Campamá32fadc02016-08-08 07:15:02 -0700269/**
270 * Gets the value of a float field.
271 *
272 * @param self The message from which to get the field.
273 * @param field The field to get.
274 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400275float GPBGetMessageFloatField(GPBMessage *self, GPBFieldDescriptor *field);
Sergio Campamá32fadc02016-08-08 07:15:02 -0700276
277/**
278 * Sets the value of a float field.
279 *
280 * @param self The message into which to set the field.
281 * @param field The field to set.
282 * @param value The to set in the field.
283 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400284void GPBSetMessageFloatField(GPBMessage *self, GPBFieldDescriptor *field, float value);
285
Sergio Campamá32fadc02016-08-08 07:15:02 -0700286/**
287 * Gets the value of a double field.
288 *
289 * @param self The message from which to get the field.
290 * @param field The field to get.
291 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400292double GPBGetMessageDoubleField(GPBMessage *self, GPBFieldDescriptor *field);
Sergio Campamá32fadc02016-08-08 07:15:02 -0700293
294/**
295 * Sets the value of a double field.
296 *
297 * @param self The message into which to set the field.
298 * @param field The field to set.
299 * @param value The to set in the field.
300 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400301void GPBSetMessageDoubleField(GPBMessage *self, GPBFieldDescriptor *field, double value);
302
Sergio Campamá32fadc02016-08-08 07:15:02 -0700303/**
304 * Gets the given enum field of a message. For proto3, if the value isn't a
305 * member of the enum, @c kGPBUnrecognizedEnumeratorValue will be returned.
306 * GPBGetMessageRawEnumField will bypass the check and return whatever value
307 * was set.
308 *
309 * @param self The message from which to get the field.
310 * @param field The field to get.
311 *
312 * @return The enum value for the given field.
313 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400314int32_t GPBGetMessageEnumField(GPBMessage *self, GPBFieldDescriptor *field);
Sergio Campamá32fadc02016-08-08 07:15:02 -0700315
316/**
317 * Set the given enum field of a message. You can only set values that are
318 * members of the enum.
319 *
320 * @param self The message into which to set the field.
321 * @param field The field to set.
322 * @param value The enum value to set in the field.
323 **/
324void GPBSetMessageEnumField(GPBMessage *self,
325 GPBFieldDescriptor *field,
326 int32_t value);
327
328/**
329 * Get the given enum field of a message. No check is done to ensure the value
330 * was defined in the enum.
331 *
332 * @param self The message from which to get the field.
333 * @param field The field to get.
334 *
335 * @return The raw enum value for the given field.
336 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400337int32_t GPBGetMessageRawEnumField(GPBMessage *self, GPBFieldDescriptor *field);
Sergio Campamá32fadc02016-08-08 07:15:02 -0700338
339/**
340 * Set the given enum field of a message. You can set the value to anything,
341 * even a value that is not a member of the enum.
342 *
343 * @param self The message into which to set the field.
344 * @param field The field to set.
345 * @param value The raw enum value to set in the field.
346 **/
347void GPBSetMessageRawEnumField(GPBMessage *self,
348 GPBFieldDescriptor *field,
349 int32_t value);
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400350
351// Repeated Fields
352
Sergio Campamá32fadc02016-08-08 07:15:02 -0700353/**
354 * Gets the value of a repeated field.
355 *
356 * @param self The message from which to get the field.
357 * @param field The repeated field to get.
358 *
359 * @return A GPB*Array or an NSMutableArray based on the field's type.
360 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400361id GPBGetMessageRepeatedField(GPBMessage *self, GPBFieldDescriptor *field);
Sergio Campamá32fadc02016-08-08 07:15:02 -0700362
363/**
364 * Sets the value of a repeated field.
365 *
366 * @param self The message into which to set the field.
367 * @param field The field to set.
368 * @param array A GPB*Array or NSMutableArray based on the field's type.
369 **/
370void GPBSetMessageRepeatedField(GPBMessage *self,
371 GPBFieldDescriptor *field,
372 id array);
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400373
374// Map Fields
375
Sergio Campamá32fadc02016-08-08 07:15:02 -0700376/**
377 * Gets the value of a map<> field.
378 *
379 * @param self The message from which to get the field.
380 * @param field The repeated field to get.
381 *
382 * @return A GPB*Dictionary or NSMutableDictionary based on the field's type.
383 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400384id GPBGetMessageMapField(GPBMessage *self, GPBFieldDescriptor *field);
Sergio Campamá32fadc02016-08-08 07:15:02 -0700385
386/**
387 * Sets the value of a map<> field.
388 *
389 * @param self The message into which to set the field.
390 * @param field The field to set.
391 * @param dictionary A GPB*Dictionary or NSMutableDictionary based on the
392 * field's type.
393 **/
394void GPBSetMessageMapField(GPBMessage *self,
395 GPBFieldDescriptor *field,
396 id dictionary);
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400397
Dave MacLachlanab48ecf2020-01-20 13:47:20 -0800398// clang-format on
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400399//%PDDM-EXPAND-END GPB_ACCESSORS()
400
Sergio Campamá32fadc02016-08-08 07:15:02 -0700401/**
402 * Returns an empty NSData to assign to byte fields when you wish to assign them
403 * to empty. Prevents allocating a lot of little [NSData data] objects.
404 **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400405NSData *GPBEmptyNSData(void) __attribute__((pure));
406
Thomas Van Lentend0717662017-02-23 12:29:00 -0500407/**
408 * Drops the `unknownFields` from the given message and from all sub message.
409 **/
410void GPBMessageDropUnknownFieldsRecursively(GPBMessage *message);
411
Thomas Van Lenten8c889572015-06-16 16:45:14 -0400412NS_ASSUME_NONNULL_END
413
Thomas Van Lenten30650d82015-05-01 08:57:16 -0400414CF_EXTERN_C_END
415
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400416
417//%PDDM-DEFINE GPB_ACCESSORS()
Thomas Van Lenten30650d82015-05-01 08:57:16 -0400418//%
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400419//%//
Sergio Campamá32fadc02016-08-08 07:15:02 -0700420//%// Get/Set a given field from/to a message.
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400421//%//
422//%
423//%// Single Fields
424//%
Thomas Van Lenten36650a02016-03-07 12:07:03 -0500425//%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, )
Sergio Campamá32fadc02016-08-08 07:15:02 -0700436//%/**
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//% **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400447//%int32_t GPBGetMessageEnumField(GPBMessage *self, GPBFieldDescriptor *field);
Sergio Campamá32fadc02016-08-08 07:15:02 -0700448//%
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//% **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400470//%int32_t GPBGetMessageRawEnumField(GPBMessage *self, GPBFieldDescriptor *field);
Sergio Campamá32fadc02016-08-08 07:15:02 -0700471//%
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);
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400483//%
484//%// Repeated Fields
485//%
Sergio Campamá32fadc02016-08-08 07:15:02 -0700486//%/**
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//% **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400494//%id GPBGetMessageRepeatedField(GPBMessage *self, GPBFieldDescriptor *field);
Sergio Campamá32fadc02016-08-08 07:15:02 -0700495//%
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);
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400506//%
507//%// Map Fields
508//%
Sergio Campamá32fadc02016-08-08 07:15:02 -0700509//%/**
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//% **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400517//%id GPBGetMessageMapField(GPBMessage *self, GPBFieldDescriptor *field);
Sergio Campamá32fadc02016-08-08 07:15:02 -0700518//%
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);
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400530//%
531
Thomas Van Lenten36650a02016-03-07 12:07:03 -0500532//%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)
Sergio Campamá32fadc02016-08-08 07:15:02 -0700535//%/**
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//% **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400541//%TYPE TisP##GPBGetMessage##NAME##Field(GPBMessage *self, GPBFieldDescriptor *field);
Sergio Campamá32fadc02016-08-08 07:15:02 -0700542//%
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//% **/
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400550//%void GPBSetMessage##NAME##Field(GPBMessage *self, GPBFieldDescriptor *field, TYPE TisP##value);
551//%