Thomas Van Lenten | 30650d8 | 2015-05-01 08:57:16 -0400 | [diff] [blame] | 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 | |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 33 | #import "GPBArray.h" |
Thomas Van Lenten | 30650d8 | 2015-05-01 08:57:16 -0400 | [diff] [blame] | 34 | #import "GPBMessage.h" |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 35 | #import "GPBRuntimeTypes.h" |
Thomas Van Lenten | 30650d8 | 2015-05-01 08:57:16 -0400 | [diff] [blame] | 36 | |
| 37 | CF_EXTERN_C_BEGIN |
| 38 | |
Thomas Van Lenten | 8c88957 | 2015-06-16 16:45:14 -0400 | [diff] [blame] | 39 | NS_ASSUME_NONNULL_BEGIN |
| 40 | |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 41 | /// Generates a string that should be a valid "Text Format" for the C++ version |
| 42 | /// of Protocol Buffers. |
| 43 | /// |
| 44 | /// @param message The message to generate from. |
| 45 | /// @param lineIndent A string to use as the prefix for all lines generated. Can |
| 46 | /// be nil if no extra indent is needed. |
| 47 | /// |
| 48 | /// @return A @c NSString with the Text Format of the message. |
Thomas Van Lenten | 8c88957 | 2015-06-16 16:45:14 -0400 | [diff] [blame] | 49 | NSString *GPBTextFormatForMessage(GPBMessage *message, |
| 50 | NSString * __nullable lineIndent); |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 51 | |
| 52 | /// Generates a string that should be a valid "Text Format" for the C++ version |
| 53 | /// of Protocol Buffers. |
| 54 | /// |
| 55 | /// @param unknownSet The unknown field set to generate from. |
| 56 | /// @param lineIndent A string to use as the prefix for all lines generated. Can |
| 57 | /// be nil if no extra indent is needed. |
| 58 | /// |
| 59 | /// @return A @c NSString with the Text Format of the unknown field set. |
Thomas Van Lenten | c27833b | 2015-12-07 10:49:30 -0500 | [diff] [blame] | 60 | NSString *GPBTextFormatForUnknownFieldSet(GPBUnknownFieldSet * __nullable unknownSet, |
Thomas Van Lenten | 8c88957 | 2015-06-16 16:45:14 -0400 | [diff] [blame] | 61 | NSString * __nullable lineIndent); |
Thomas Van Lenten | 30650d8 | 2015-05-01 08:57:16 -0400 | [diff] [blame] | 62 | |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 63 | /// Test if the given field is set on a message. |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 64 | BOOL GPBMessageHasFieldNumberSet(GPBMessage *self, uint32_t fieldNumber); |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 65 | /// Test if the given field is set on a message. |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 66 | BOOL GPBMessageHasFieldSet(GPBMessage *self, GPBFieldDescriptor *field); |
| 67 | |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 68 | /// Clear the given field of a message. |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 69 | void GPBClearMessageField(GPBMessage *self, GPBFieldDescriptor *field); |
| 70 | |
| 71 | //%PDDM-EXPAND GPB_ACCESSORS() |
| 72 | // This block of code is generated, do not edit it directly. |
| 73 | |
| 74 | |
| 75 | // |
| 76 | // Get/Set the given field of a message. |
| 77 | // |
| 78 | |
| 79 | // Single Fields |
| 80 | |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 81 | /// Gets the value of a bytes field. |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 82 | NSData *GPBGetMessageBytesField(GPBMessage *self, GPBFieldDescriptor *field); |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 83 | /// Sets the value of a bytes field. |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 84 | void GPBSetMessageBytesField(GPBMessage *self, GPBFieldDescriptor *field, NSData *value); |
| 85 | |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 86 | /// Gets the value of a string field. |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 87 | NSString *GPBGetMessageStringField(GPBMessage *self, GPBFieldDescriptor *field); |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 88 | /// Sets the value of a string field. |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 89 | void GPBSetMessageStringField(GPBMessage *self, GPBFieldDescriptor *field, NSString *value); |
| 90 | |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 91 | /// Gets the value of a message field. |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 92 | GPBMessage *GPBGetMessageMessageField(GPBMessage *self, GPBFieldDescriptor *field); |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 93 | /// Sets the value of a message field. |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 94 | void GPBSetMessageMessageField(GPBMessage *self, GPBFieldDescriptor *field, GPBMessage *value); |
| 95 | |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 96 | /// Gets the value of a group field. |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 97 | GPBMessage *GPBGetMessageGroupField(GPBMessage *self, GPBFieldDescriptor *field); |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 98 | /// Sets the value of a group field. |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 99 | void GPBSetMessageGroupField(GPBMessage *self, GPBFieldDescriptor *field, GPBMessage *value); |
| 100 | |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 101 | /// Gets the value of a bool field. |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 102 | BOOL GPBGetMessageBoolField(GPBMessage *self, GPBFieldDescriptor *field); |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 103 | /// Sets the value of a bool field. |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 104 | void GPBSetMessageBoolField(GPBMessage *self, GPBFieldDescriptor *field, BOOL value); |
| 105 | |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 106 | /// Gets the value of an int32 field. |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 107 | int32_t GPBGetMessageInt32Field(GPBMessage *self, GPBFieldDescriptor *field); |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 108 | /// Sets the value of an int32 field. |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 109 | void GPBSetMessageInt32Field(GPBMessage *self, GPBFieldDescriptor *field, int32_t value); |
| 110 | |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 111 | /// Gets the value of an uint32 field. |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 112 | uint32_t GPBGetMessageUInt32Field(GPBMessage *self, GPBFieldDescriptor *field); |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 113 | /// Sets the value of an uint32 field. |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 114 | void GPBSetMessageUInt32Field(GPBMessage *self, GPBFieldDescriptor *field, uint32_t value); |
| 115 | |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 116 | /// Gets the value of an int64 field. |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 117 | int64_t GPBGetMessageInt64Field(GPBMessage *self, GPBFieldDescriptor *field); |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 118 | /// Sets the value of an int64 field. |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 119 | void GPBSetMessageInt64Field(GPBMessage *self, GPBFieldDescriptor *field, int64_t value); |
| 120 | |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 121 | /// Gets the value of an uint64 field. |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 122 | uint64_t GPBGetMessageUInt64Field(GPBMessage *self, GPBFieldDescriptor *field); |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 123 | /// Sets the value of an uint64 field. |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 124 | void GPBSetMessageUInt64Field(GPBMessage *self, GPBFieldDescriptor *field, uint64_t value); |
| 125 | |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 126 | /// Gets the value of a float field. |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 127 | float GPBGetMessageFloatField(GPBMessage *self, GPBFieldDescriptor *field); |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 128 | /// Sets the value of a float field. |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 129 | void GPBSetMessageFloatField(GPBMessage *self, GPBFieldDescriptor *field, float value); |
| 130 | |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 131 | /// Gets the value of a double field. |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 132 | double GPBGetMessageDoubleField(GPBMessage *self, GPBFieldDescriptor *field); |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 133 | /// Sets the value of a double field. |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 134 | void GPBSetMessageDoubleField(GPBMessage *self, GPBFieldDescriptor *field, double value); |
| 135 | |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 136 | /// Get the given enum field of a message. For proto3, if the value isn't a |
| 137 | /// member of the enum, @c kGPBUnrecognizedEnumeratorValue will be returned. |
| 138 | /// GPBGetMessageRawEnumField will bypass the check and return whatever value |
| 139 | /// was set. |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 140 | int32_t GPBGetMessageEnumField(GPBMessage *self, GPBFieldDescriptor *field); |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 141 | /// Set the given enum field of a message. You can only set values that are |
| 142 | /// members of the enum. |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 143 | void GPBSetMessageEnumField(GPBMessage *self, GPBFieldDescriptor *field, int32_t value); |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 144 | /// Get the given enum field of a message. No check is done to ensure the value |
| 145 | /// was defined in the enum. |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 146 | int32_t GPBGetMessageRawEnumField(GPBMessage *self, GPBFieldDescriptor *field); |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 147 | /// Set the given enum field of a message. You can set the value to anything, |
| 148 | /// even a value that is not a member of the enum. |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 149 | void GPBSetMessageRawEnumField(GPBMessage *self, GPBFieldDescriptor *field, int32_t value); |
| 150 | |
| 151 | // Repeated Fields |
| 152 | |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 153 | /// Gets the value of a repeated field. |
| 154 | /// |
| 155 | /// The result will be @c GPB*Array or @c NSMutableArray based on the |
| 156 | /// field's type. |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 157 | id GPBGetMessageRepeatedField(GPBMessage *self, GPBFieldDescriptor *field); |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 158 | /// Sets the value of a repeated field. |
| 159 | /// |
| 160 | /// The value should be @c GPB*Array or @c NSMutableArray based on the |
| 161 | /// field's type. |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 162 | void GPBSetMessageRepeatedField(GPBMessage *self, GPBFieldDescriptor *field, id array); |
| 163 | |
| 164 | // Map Fields |
| 165 | |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 166 | /// Gets the value of a map<> field. |
| 167 | /// |
| 168 | /// The result will be @c GPB*Dictionary or @c NSMutableDictionary based on |
| 169 | /// the field's type. |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 170 | id GPBGetMessageMapField(GPBMessage *self, GPBFieldDescriptor *field); |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 171 | /// Sets the value of a map<> field. |
| 172 | /// |
| 173 | /// The object should be @c GPB*Dictionary or @c NSMutableDictionary based |
| 174 | /// on the field's type. |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 175 | void GPBSetMessageMapField(GPBMessage *self, GPBFieldDescriptor *field, id dictionary); |
| 176 | |
| 177 | //%PDDM-EXPAND-END GPB_ACCESSORS() |
| 178 | |
| 179 | // Returns an empty NSData to assign to byte fields when you wish |
| 180 | // to assign them to empty. Prevents allocating a lot of little [NSData data] |
| 181 | // objects. |
| 182 | NSData *GPBEmptyNSData(void) __attribute__((pure)); |
| 183 | |
Thomas Van Lenten | 8c88957 | 2015-06-16 16:45:14 -0400 | [diff] [blame] | 184 | NS_ASSUME_NONNULL_END |
| 185 | |
Thomas Van Lenten | 30650d8 | 2015-05-01 08:57:16 -0400 | [diff] [blame] | 186 | CF_EXTERN_C_END |
| 187 | |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 188 | |
| 189 | //%PDDM-DEFINE GPB_ACCESSORS() |
Thomas Van Lenten | 30650d8 | 2015-05-01 08:57:16 -0400 | [diff] [blame] | 190 | //% |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 191 | //%// |
| 192 | //%// Get/Set the given field of a message. |
| 193 | //%// |
| 194 | //% |
| 195 | //%// Single Fields |
| 196 | //% |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 197 | //%GPB_ACCESSOR_SINGLE_FULL(Bytes, NSData, , *) |
| 198 | //%GPB_ACCESSOR_SINGLE_FULL(String, NSString, , *) |
| 199 | //%GPB_ACCESSOR_SINGLE_FULL(Message, GPBMessage, , *) |
| 200 | //%GPB_ACCESSOR_SINGLE_FULL(Group, GPBMessage, , *) |
| 201 | //%GPB_ACCESSOR_SINGLE(Bool, BOOL, ) |
| 202 | //%GPB_ACCESSOR_SINGLE(Int32, int32_t, n) |
| 203 | //%GPB_ACCESSOR_SINGLE(UInt32, uint32_t, n) |
| 204 | //%GPB_ACCESSOR_SINGLE(Int64, int64_t, n) |
| 205 | //%GPB_ACCESSOR_SINGLE(UInt64, uint64_t, n) |
| 206 | //%GPB_ACCESSOR_SINGLE(Float, float, ) |
| 207 | //%GPB_ACCESSOR_SINGLE(Double, double, ) |
| 208 | //%/// Get the given enum field of a message. For proto3, if the value isn't a |
| 209 | //%/// member of the enum, @c kGPBUnrecognizedEnumeratorValue will be returned. |
| 210 | //%/// GPBGetMessageRawEnumField will bypass the check and return whatever value |
| 211 | //%/// was set. |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 212 | //%int32_t GPBGetMessageEnumField(GPBMessage *self, GPBFieldDescriptor *field); |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 213 | //%/// Set the given enum field of a message. You can only set values that are |
| 214 | //%/// members of the enum. |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 215 | //%void GPBSetMessageEnumField(GPBMessage *self, GPBFieldDescriptor *field, int32_t value); |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 216 | //%/// Get the given enum field of a message. No check is done to ensure the value |
| 217 | //%/// was defined in the enum. |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 218 | //%int32_t GPBGetMessageRawEnumField(GPBMessage *self, GPBFieldDescriptor *field); |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 219 | //%/// Set the given enum field of a message. You can set the value to anything, |
| 220 | //%/// even a value that is not a member of the enum. |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 221 | //%void GPBSetMessageRawEnumField(GPBMessage *self, GPBFieldDescriptor *field, int32_t value); |
| 222 | //% |
| 223 | //%// Repeated Fields |
| 224 | //% |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 225 | //%/// Gets the value of a repeated field. |
| 226 | //%/// |
| 227 | //%/// The result will be @c GPB*Array or @c NSMutableArray based on the |
| 228 | //%/// field's type. |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 229 | //%id GPBGetMessageRepeatedField(GPBMessage *self, GPBFieldDescriptor *field); |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 230 | //%/// Sets the value of a repeated field. |
| 231 | //%/// |
| 232 | //%/// The value should be @c GPB*Array or @c NSMutableArray based on the |
| 233 | //%/// field's type. |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 234 | //%void GPBSetMessageRepeatedField(GPBMessage *self, GPBFieldDescriptor *field, id array); |
| 235 | //% |
| 236 | //%// Map Fields |
| 237 | //% |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 238 | //%/// Gets the value of a map<> field. |
| 239 | //%/// |
| 240 | //%/// The result will be @c GPB*Dictionary or @c NSMutableDictionary based on |
| 241 | //%/// the field's type. |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 242 | //%id GPBGetMessageMapField(GPBMessage *self, GPBFieldDescriptor *field); |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 243 | //%/// Sets the value of a map<> field. |
| 244 | //%/// |
| 245 | //%/// The object should be @c GPB*Dictionary or @c NSMutableDictionary based |
| 246 | //%/// on the field's type. |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 247 | //%void GPBSetMessageMapField(GPBMessage *self, GPBFieldDescriptor *field, id dictionary); |
| 248 | //% |
| 249 | |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 250 | //%PDDM-DEFINE GPB_ACCESSOR_SINGLE(NAME, TYPE, AN) |
| 251 | //%GPB_ACCESSOR_SINGLE_FULL(NAME, TYPE, AN, ) |
| 252 | //%PDDM-DEFINE GPB_ACCESSOR_SINGLE_FULL(NAME, TYPE, AN, TisP) |
| 253 | //%/// Gets the value of a##AN NAME$L field. |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 254 | //%TYPE TisP##GPBGetMessage##NAME##Field(GPBMessage *self, GPBFieldDescriptor *field); |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 255 | //%/// Sets the value of a##AN NAME$L field. |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 256 | //%void GPBSetMessage##NAME##Field(GPBMessage *self, GPBFieldDescriptor *field, TYPE TisP##value); |
| 257 | //% |