| OLD | NEW |
| 1 // Protocol Buffers - Google's data interchange format | 1 // Protocol Buffers - Google's data interchange format |
| 2 // Copyright 2008 Google Inc. All rights reserved. | 2 // Copyright 2008 Google Inc. All rights reserved. |
| 3 // https://developers.google.com/protocol-buffers/ | 3 // https://developers.google.com/protocol-buffers/ |
| 4 // | 4 // |
| 5 // Redistribution and use in source and binary forms, with or without | 5 // Redistribution and use in source and binary forms, with or without |
| 6 // modification, are permitted provided that the following conditions are | 6 // modification, are permitted provided that the following conditions are |
| 7 // met: | 7 // met: |
| 8 // | 8 // |
| 9 // * Redistributions of source code must retain the above copyright | 9 // * Redistributions of source code must retain the above copyright |
| 10 // notice, this list of conditions and the following disclaimer. | 10 // notice, this list of conditions and the following disclaimer. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 @class GPBFloatArray; | 39 @class GPBFloatArray; |
| 40 @class GPBMessage; | 40 @class GPBMessage; |
| 41 @class GPBInt32Array; | 41 @class GPBInt32Array; |
| 42 @class GPBInt64Array; | 42 @class GPBInt64Array; |
| 43 @class GPBUInt32Array; | 43 @class GPBUInt32Array; |
| 44 @class GPBUInt64Array; | 44 @class GPBUInt64Array; |
| 45 @class GPBUnknownFieldSet; | 45 @class GPBUnknownFieldSet; |
| 46 | 46 |
| 47 NS_ASSUME_NONNULL_BEGIN | 47 NS_ASSUME_NONNULL_BEGIN |
| 48 | 48 |
| 49 /// Writes out protocol message fields. | 49 /** |
| 50 /// | 50 * Writes out protocol message fields. |
| 51 /// The common uses of protocol buffers shouldn't need to use this class. | 51 * |
| 52 /// @c GPBMessage's provide a @c -data method that will serialize the message | 52 * The common uses of protocol buffers shouldn't need to use this class. |
| 53 /// for you. | 53 * GPBMessage's provide a -data method that will serialize the message for you. |
| 54 /// | 54 * |
| 55 /// @note Subclassing of GPBCodedOutputStream is NOT supported. | 55 * @note Subclassing of GPBCodedOutputStream is NOT supported. |
| 56 **/ |
| 56 @interface GPBCodedOutputStream : NSObject | 57 @interface GPBCodedOutputStream : NSObject |
| 57 | 58 |
| 58 /// Creates a stream to fill in the given data. Data must be sized to fit or | 59 /** |
| 59 /// an error will be raised when out of space. | 60 * Creates a stream to fill in the given data. Data must be sized to fit or |
| 61 * an error will be raised when out of space. |
| 62 * |
| 63 * @param data The data where the stream will be written to. |
| 64 * |
| 65 * @return A newly instanced GPBCodedOutputStream. |
| 66 **/ |
| 60 + (instancetype)streamWithData:(NSMutableData *)data; | 67 + (instancetype)streamWithData:(NSMutableData *)data; |
| 61 | 68 |
| 62 /// Creates a stream to write into the given @c NSOutputStream. | 69 /** |
| 70 * Creates a stream to write into the given NSOutputStream. |
| 71 * |
| 72 * @param output The output stream where the stream will be written to. |
| 73 * |
| 74 * @return A newly instanced GPBCodedOutputStream. |
| 75 **/ |
| 63 + (instancetype)streamWithOutputStream:(NSOutputStream *)output; | 76 + (instancetype)streamWithOutputStream:(NSOutputStream *)output; |
| 64 | 77 |
| 65 /// Initializes a stream to fill in the given data. Data must be sized to fit | 78 /** |
| 66 /// or an error will be raised when out of space. | 79 * Initializes a stream to fill in the given data. Data must be sized to fit |
| 80 * or an error will be raised when out of space. |
| 81 * |
| 82 * @param data The data where the stream will be written to. |
| 83 * |
| 84 * @return A newly initialized GPBCodedOutputStream. |
| 85 **/ |
| 67 - (instancetype)initWithData:(NSMutableData *)data; | 86 - (instancetype)initWithData:(NSMutableData *)data; |
| 68 | 87 |
| 69 /// Initializes a stream to write into the given @c NSOutputStream. | 88 /** |
| 89 * Initializes a stream to write into the given @c NSOutputStream. |
| 90 * |
| 91 * @param output The output stream where the stream will be written to. |
| 92 * |
| 93 * @return A newly initialized GPBCodedOutputStream. |
| 94 **/ |
| 70 - (instancetype)initWithOutputStream:(NSOutputStream *)output; | 95 - (instancetype)initWithOutputStream:(NSOutputStream *)output; |
| 71 | 96 |
| 72 /// Flush any buffered data out. | 97 /** |
| 98 * Flush any buffered data out. |
| 99 **/ |
| 73 - (void)flush; | 100 - (void)flush; |
| 74 | 101 |
| 75 /// Write the raw byte out. | 102 /** |
| 103 * Write the raw byte out. |
| 104 * |
| 105 * @param value The value to write out. |
| 106 **/ |
| 76 - (void)writeRawByte:(uint8_t)value; | 107 - (void)writeRawByte:(uint8_t)value; |
| 77 | 108 |
| 78 /// Write the tag for the given field number and wire format. | 109 /** |
| 79 /// | 110 * Write the tag for the given field number and wire format. |
| 80 /// @param fieldNumber The field number. | 111 * |
| 81 /// @param format The wire format the data for the field will be in. | 112 * @param fieldNumber The field number. |
| 113 * @param format The wire format the data for the field will be in. |
| 114 **/ |
| 82 - (void)writeTag:(uint32_t)fieldNumber format:(GPBWireFormat)format; | 115 - (void)writeTag:(uint32_t)fieldNumber format:(GPBWireFormat)format; |
| 83 | 116 |
| 84 /// Write a 32bit value out in little endian format. | 117 /** |
| 118 * Write a 32bit value out in little endian format. |
| 119 * |
| 120 * @param value The value to write out. |
| 121 **/ |
| 85 - (void)writeRawLittleEndian32:(int32_t)value; | 122 - (void)writeRawLittleEndian32:(int32_t)value; |
| 86 /// Write a 64bit value out in little endian format. | 123 /** |
| 124 * Write a 64bit value out in little endian format. |
| 125 * |
| 126 * @param value The value to write out. |
| 127 **/ |
| 87 - (void)writeRawLittleEndian64:(int64_t)value; | 128 - (void)writeRawLittleEndian64:(int64_t)value; |
| 88 | 129 |
| 89 /// Write a 32bit value out in varint format. | 130 /** |
| 131 * Write a 32bit value out in varint format. |
| 132 * |
| 133 * @param value The value to write out. |
| 134 **/ |
| 90 - (void)writeRawVarint32:(int32_t)value; | 135 - (void)writeRawVarint32:(int32_t)value; |
| 91 /// Write a 64bit value out in varint format. | 136 /** |
| 137 * Write a 64bit value out in varint format. |
| 138 * |
| 139 * @param value The value to write out. |
| 140 **/ |
| 92 - (void)writeRawVarint64:(int64_t)value; | 141 - (void)writeRawVarint64:(int64_t)value; |
| 93 | 142 |
| 94 /// Write a size_t out as a 32bit varint value. | 143 /** |
| 95 /// | 144 * Write a size_t out as a 32bit varint value. |
| 96 /// @note This will truncate 64 bit values to 32. | 145 * |
| 146 * @note This will truncate 64 bit values to 32. |
| 147 * |
| 148 * @param value The value to write out. |
| 149 **/ |
| 97 - (void)writeRawVarintSizeTAs32:(size_t)value; | 150 - (void)writeRawVarintSizeTAs32:(size_t)value; |
| 98 | 151 |
| 99 /// Writes the contents of an @c NSData out. | 152 /** |
| 153 * Writes the contents of an NSData out. |
| 154 * |
| 155 * @param data The data to write out. |
| 156 **/ |
| 100 - (void)writeRawData:(NSData *)data; | 157 - (void)writeRawData:(NSData *)data; |
| 101 /// Writes out the given data. | 158 /** |
| 102 /// | 159 * Writes out the given data. |
| 103 /// @param data The data blob to write out. | 160 * |
| 104 /// @param offset The offset into the blob to start writing out. | 161 * @param data The data blob to write out. |
| 105 /// @param length The number of bytes from the blob to write out. | 162 * @param offset The offset into the blob to start writing out. |
| 163 * @param length The number of bytes from the blob to write out. |
| 164 **/ |
| 106 - (void)writeRawPtr:(const void *)data | 165 - (void)writeRawPtr:(const void *)data |
| 107 offset:(size_t)offset | 166 offset:(size_t)offset |
| 108 length:(size_t)length; | 167 length:(size_t)length; |
| 109 | 168 |
| 110 //%PDDM-EXPAND _WRITE_DECLS() | 169 //%PDDM-EXPAND _WRITE_DECLS() |
| 111 // This block of code is generated, do not edit it directly. | 170 // This block of code is generated, do not edit it directly. |
| 112 | 171 |
| 113 /// Write a double for the given field number. | 172 /** |
| 173 * Write a double for the given field number. |
| 174 * |
| 175 * @param fieldNumber The field number assigned to the value. |
| 176 * @param value The value to write out. |
| 177 **/ |
| 114 - (void)writeDouble:(int32_t)fieldNumber value:(double)value; | 178 - (void)writeDouble:(int32_t)fieldNumber value:(double)value; |
| 115 /// Write a packed array of double for the given field number. | 179 /** |
| 180 * Write a packed array of double for the given field number. |
| 181 * |
| 182 * @param fieldNumber The field number assigned to the values. |
| 183 * @param values The values to write out. |
| 184 * @param tag The tag assigned to the values. |
| 185 **/ |
| 116 - (void)writeDoubleArray:(int32_t)fieldNumber | 186 - (void)writeDoubleArray:(int32_t)fieldNumber |
| 117 values:(GPBDoubleArray *)values | 187 values:(GPBDoubleArray *)values |
| 118 tag:(uint32_t)tag; | 188 tag:(uint32_t)tag; |
| 119 /// Write a double without any tag. | 189 /** |
| 190 * Write a double without any tag. |
| 191 * |
| 192 * @param value The value to write out. |
| 193 **/ |
| 120 - (void)writeDoubleNoTag:(double)value; | 194 - (void)writeDoubleNoTag:(double)value; |
| 121 | 195 |
| 122 /// Write a float for the given field number. | 196 /** |
| 197 * Write a float for the given field number. |
| 198 * |
| 199 * @param fieldNumber The field number assigned to the value. |
| 200 * @param value The value to write out. |
| 201 **/ |
| 123 - (void)writeFloat:(int32_t)fieldNumber value:(float)value; | 202 - (void)writeFloat:(int32_t)fieldNumber value:(float)value; |
| 124 /// Write a packed array of float for the given field number. | 203 /** |
| 204 * Write a packed array of float for the given field number. |
| 205 * |
| 206 * @param fieldNumber The field number assigned to the values. |
| 207 * @param values The values to write out. |
| 208 * @param tag The tag assigned to the values. |
| 209 **/ |
| 125 - (void)writeFloatArray:(int32_t)fieldNumber | 210 - (void)writeFloatArray:(int32_t)fieldNumber |
| 126 values:(GPBFloatArray *)values | 211 values:(GPBFloatArray *)values |
| 127 tag:(uint32_t)tag; | 212 tag:(uint32_t)tag; |
| 128 /// Write a float without any tag. | 213 /** |
| 214 * Write a float without any tag. |
| 215 * |
| 216 * @param value The value to write out. |
| 217 **/ |
| 129 - (void)writeFloatNoTag:(float)value; | 218 - (void)writeFloatNoTag:(float)value; |
| 130 | 219 |
| 131 /// Write a uint64_t for the given field number. | 220 /** |
| 221 * Write a uint64_t for the given field number. |
| 222 * |
| 223 * @param fieldNumber The field number assigned to the value. |
| 224 * @param value The value to write out. |
| 225 **/ |
| 132 - (void)writeUInt64:(int32_t)fieldNumber value:(uint64_t)value; | 226 - (void)writeUInt64:(int32_t)fieldNumber value:(uint64_t)value; |
| 133 /// Write a packed array of uint64_t for the given field number. | 227 /** |
| 228 * Write a packed array of uint64_t for the given field number. |
| 229 * |
| 230 * @param fieldNumber The field number assigned to the values. |
| 231 * @param values The values to write out. |
| 232 * @param tag The tag assigned to the values. |
| 233 **/ |
| 134 - (void)writeUInt64Array:(int32_t)fieldNumber | 234 - (void)writeUInt64Array:(int32_t)fieldNumber |
| 135 values:(GPBUInt64Array *)values | 235 values:(GPBUInt64Array *)values |
| 136 tag:(uint32_t)tag; | 236 tag:(uint32_t)tag; |
| 137 /// Write a uint64_t without any tag. | 237 /** |
| 238 * Write a uint64_t without any tag. |
| 239 * |
| 240 * @param value The value to write out. |
| 241 **/ |
| 138 - (void)writeUInt64NoTag:(uint64_t)value; | 242 - (void)writeUInt64NoTag:(uint64_t)value; |
| 139 | 243 |
| 140 /// Write a int64_t for the given field number. | 244 /** |
| 245 * Write a int64_t for the given field number. |
| 246 * |
| 247 * @param fieldNumber The field number assigned to the value. |
| 248 * @param value The value to write out. |
| 249 **/ |
| 141 - (void)writeInt64:(int32_t)fieldNumber value:(int64_t)value; | 250 - (void)writeInt64:(int32_t)fieldNumber value:(int64_t)value; |
| 142 /// Write a packed array of int64_t for the given field number. | 251 /** |
| 252 * Write a packed array of int64_t for the given field number. |
| 253 * |
| 254 * @param fieldNumber The field number assigned to the values. |
| 255 * @param values The values to write out. |
| 256 * @param tag The tag assigned to the values. |
| 257 **/ |
| 143 - (void)writeInt64Array:(int32_t)fieldNumber | 258 - (void)writeInt64Array:(int32_t)fieldNumber |
| 144 values:(GPBInt64Array *)values | 259 values:(GPBInt64Array *)values |
| 145 tag:(uint32_t)tag; | 260 tag:(uint32_t)tag; |
| 146 /// Write a int64_t without any tag. | 261 /** |
| 262 * Write a int64_t without any tag. |
| 263 * |
| 264 * @param value The value to write out. |
| 265 **/ |
| 147 - (void)writeInt64NoTag:(int64_t)value; | 266 - (void)writeInt64NoTag:(int64_t)value; |
| 148 | 267 |
| 149 /// Write a int32_t for the given field number. | 268 /** |
| 269 * Write a int32_t for the given field number. |
| 270 * |
| 271 * @param fieldNumber The field number assigned to the value. |
| 272 * @param value The value to write out. |
| 273 **/ |
| 150 - (void)writeInt32:(int32_t)fieldNumber value:(int32_t)value; | 274 - (void)writeInt32:(int32_t)fieldNumber value:(int32_t)value; |
| 151 /// Write a packed array of int32_t for the given field number. | 275 /** |
| 276 * Write a packed array of int32_t for the given field number. |
| 277 * |
| 278 * @param fieldNumber The field number assigned to the values. |
| 279 * @param values The values to write out. |
| 280 * @param tag The tag assigned to the values. |
| 281 **/ |
| 152 - (void)writeInt32Array:(int32_t)fieldNumber | 282 - (void)writeInt32Array:(int32_t)fieldNumber |
| 153 values:(GPBInt32Array *)values | 283 values:(GPBInt32Array *)values |
| 154 tag:(uint32_t)tag; | 284 tag:(uint32_t)tag; |
| 155 /// Write a int32_t without any tag. | 285 /** |
| 286 * Write a int32_t without any tag. |
| 287 * |
| 288 * @param value The value to write out. |
| 289 **/ |
| 156 - (void)writeInt32NoTag:(int32_t)value; | 290 - (void)writeInt32NoTag:(int32_t)value; |
| 157 | 291 |
| 158 /// Write a uint32_t for the given field number. | 292 /** |
| 293 * Write a uint32_t for the given field number. |
| 294 * |
| 295 * @param fieldNumber The field number assigned to the value. |
| 296 * @param value The value to write out. |
| 297 **/ |
| 159 - (void)writeUInt32:(int32_t)fieldNumber value:(uint32_t)value; | 298 - (void)writeUInt32:(int32_t)fieldNumber value:(uint32_t)value; |
| 160 /// Write a packed array of uint32_t for the given field number. | 299 /** |
| 300 * Write a packed array of uint32_t for the given field number. |
| 301 * |
| 302 * @param fieldNumber The field number assigned to the values. |
| 303 * @param values The values to write out. |
| 304 * @param tag The tag assigned to the values. |
| 305 **/ |
| 161 - (void)writeUInt32Array:(int32_t)fieldNumber | 306 - (void)writeUInt32Array:(int32_t)fieldNumber |
| 162 values:(GPBUInt32Array *)values | 307 values:(GPBUInt32Array *)values |
| 163 tag:(uint32_t)tag; | 308 tag:(uint32_t)tag; |
| 164 /// Write a uint32_t without any tag. | 309 /** |
| 310 * Write a uint32_t without any tag. |
| 311 * |
| 312 * @param value The value to write out. |
| 313 **/ |
| 165 - (void)writeUInt32NoTag:(uint32_t)value; | 314 - (void)writeUInt32NoTag:(uint32_t)value; |
| 166 | 315 |
| 167 /// Write a uint64_t for the given field number. | 316 /** |
| 317 * Write a uint64_t for the given field number. |
| 318 * |
| 319 * @param fieldNumber The field number assigned to the value. |
| 320 * @param value The value to write out. |
| 321 **/ |
| 168 - (void)writeFixed64:(int32_t)fieldNumber value:(uint64_t)value; | 322 - (void)writeFixed64:(int32_t)fieldNumber value:(uint64_t)value; |
| 169 /// Write a packed array of uint64_t for the given field number. | 323 /** |
| 324 * Write a packed array of uint64_t for the given field number. |
| 325 * |
| 326 * @param fieldNumber The field number assigned to the values. |
| 327 * @param values The values to write out. |
| 328 * @param tag The tag assigned to the values. |
| 329 **/ |
| 170 - (void)writeFixed64Array:(int32_t)fieldNumber | 330 - (void)writeFixed64Array:(int32_t)fieldNumber |
| 171 values:(GPBUInt64Array *)values | 331 values:(GPBUInt64Array *)values |
| 172 tag:(uint32_t)tag; | 332 tag:(uint32_t)tag; |
| 173 /// Write a uint64_t without any tag. | 333 /** |
| 334 * Write a uint64_t without any tag. |
| 335 * |
| 336 * @param value The value to write out. |
| 337 **/ |
| 174 - (void)writeFixed64NoTag:(uint64_t)value; | 338 - (void)writeFixed64NoTag:(uint64_t)value; |
| 175 | 339 |
| 176 /// Write a uint32_t for the given field number. | 340 /** |
| 341 * Write a uint32_t for the given field number. |
| 342 * |
| 343 * @param fieldNumber The field number assigned to the value. |
| 344 * @param value The value to write out. |
| 345 **/ |
| 177 - (void)writeFixed32:(int32_t)fieldNumber value:(uint32_t)value; | 346 - (void)writeFixed32:(int32_t)fieldNumber value:(uint32_t)value; |
| 178 /// Write a packed array of uint32_t for the given field number. | 347 /** |
| 348 * Write a packed array of uint32_t for the given field number. |
| 349 * |
| 350 * @param fieldNumber The field number assigned to the values. |
| 351 * @param values The values to write out. |
| 352 * @param tag The tag assigned to the values. |
| 353 **/ |
| 179 - (void)writeFixed32Array:(int32_t)fieldNumber | 354 - (void)writeFixed32Array:(int32_t)fieldNumber |
| 180 values:(GPBUInt32Array *)values | 355 values:(GPBUInt32Array *)values |
| 181 tag:(uint32_t)tag; | 356 tag:(uint32_t)tag; |
| 182 /// Write a uint32_t without any tag. | 357 /** |
| 358 * Write a uint32_t without any tag. |
| 359 * |
| 360 * @param value The value to write out. |
| 361 **/ |
| 183 - (void)writeFixed32NoTag:(uint32_t)value; | 362 - (void)writeFixed32NoTag:(uint32_t)value; |
| 184 | 363 |
| 185 /// Write a int32_t for the given field number. | 364 /** |
| 365 * Write a int32_t for the given field number. |
| 366 * |
| 367 * @param fieldNumber The field number assigned to the value. |
| 368 * @param value The value to write out. |
| 369 **/ |
| 186 - (void)writeSInt32:(int32_t)fieldNumber value:(int32_t)value; | 370 - (void)writeSInt32:(int32_t)fieldNumber value:(int32_t)value; |
| 187 /// Write a packed array of int32_t for the given field number. | 371 /** |
| 372 * Write a packed array of int32_t for the given field number. |
| 373 * |
| 374 * @param fieldNumber The field number assigned to the values. |
| 375 * @param values The values to write out. |
| 376 * @param tag The tag assigned to the values. |
| 377 **/ |
| 188 - (void)writeSInt32Array:(int32_t)fieldNumber | 378 - (void)writeSInt32Array:(int32_t)fieldNumber |
| 189 values:(GPBInt32Array *)values | 379 values:(GPBInt32Array *)values |
| 190 tag:(uint32_t)tag; | 380 tag:(uint32_t)tag; |
| 191 /// Write a int32_t without any tag. | 381 /** |
| 382 * Write a int32_t without any tag. |
| 383 * |
| 384 * @param value The value to write out. |
| 385 **/ |
| 192 - (void)writeSInt32NoTag:(int32_t)value; | 386 - (void)writeSInt32NoTag:(int32_t)value; |
| 193 | 387 |
| 194 /// Write a int64_t for the given field number. | 388 /** |
| 389 * Write a int64_t for the given field number. |
| 390 * |
| 391 * @param fieldNumber The field number assigned to the value. |
| 392 * @param value The value to write out. |
| 393 **/ |
| 195 - (void)writeSInt64:(int32_t)fieldNumber value:(int64_t)value; | 394 - (void)writeSInt64:(int32_t)fieldNumber value:(int64_t)value; |
| 196 /// Write a packed array of int64_t for the given field number. | 395 /** |
| 396 * Write a packed array of int64_t for the given field number. |
| 397 * |
| 398 * @param fieldNumber The field number assigned to the values. |
| 399 * @param values The values to write out. |
| 400 * @param tag The tag assigned to the values. |
| 401 **/ |
| 197 - (void)writeSInt64Array:(int32_t)fieldNumber | 402 - (void)writeSInt64Array:(int32_t)fieldNumber |
| 198 values:(GPBInt64Array *)values | 403 values:(GPBInt64Array *)values |
| 199 tag:(uint32_t)tag; | 404 tag:(uint32_t)tag; |
| 200 /// Write a int64_t without any tag. | 405 /** |
| 406 * Write a int64_t without any tag. |
| 407 * |
| 408 * @param value The value to write out. |
| 409 **/ |
| 201 - (void)writeSInt64NoTag:(int64_t)value; | 410 - (void)writeSInt64NoTag:(int64_t)value; |
| 202 | 411 |
| 203 /// Write a int64_t for the given field number. | 412 /** |
| 413 * Write a int64_t for the given field number. |
| 414 * |
| 415 * @param fieldNumber The field number assigned to the value. |
| 416 * @param value The value to write out. |
| 417 **/ |
| 204 - (void)writeSFixed64:(int32_t)fieldNumber value:(int64_t)value; | 418 - (void)writeSFixed64:(int32_t)fieldNumber value:(int64_t)value; |
| 205 /// Write a packed array of int64_t for the given field number. | 419 /** |
| 420 * Write a packed array of int64_t for the given field number. |
| 421 * |
| 422 * @param fieldNumber The field number assigned to the values. |
| 423 * @param values The values to write out. |
| 424 * @param tag The tag assigned to the values. |
| 425 **/ |
| 206 - (void)writeSFixed64Array:(int32_t)fieldNumber | 426 - (void)writeSFixed64Array:(int32_t)fieldNumber |
| 207 values:(GPBInt64Array *)values | 427 values:(GPBInt64Array *)values |
| 208 tag:(uint32_t)tag; | 428 tag:(uint32_t)tag; |
| 209 /// Write a int64_t without any tag. | 429 /** |
| 430 * Write a int64_t without any tag. |
| 431 * |
| 432 * @param value The value to write out. |
| 433 **/ |
| 210 - (void)writeSFixed64NoTag:(int64_t)value; | 434 - (void)writeSFixed64NoTag:(int64_t)value; |
| 211 | 435 |
| 212 /// Write a int32_t for the given field number. | 436 /** |
| 437 * Write a int32_t for the given field number. |
| 438 * |
| 439 * @param fieldNumber The field number assigned to the value. |
| 440 * @param value The value to write out. |
| 441 **/ |
| 213 - (void)writeSFixed32:(int32_t)fieldNumber value:(int32_t)value; | 442 - (void)writeSFixed32:(int32_t)fieldNumber value:(int32_t)value; |
| 214 /// Write a packed array of int32_t for the given field number. | 443 /** |
| 444 * Write a packed array of int32_t for the given field number. |
| 445 * |
| 446 * @param fieldNumber The field number assigned to the values. |
| 447 * @param values The values to write out. |
| 448 * @param tag The tag assigned to the values. |
| 449 **/ |
| 215 - (void)writeSFixed32Array:(int32_t)fieldNumber | 450 - (void)writeSFixed32Array:(int32_t)fieldNumber |
| 216 values:(GPBInt32Array *)values | 451 values:(GPBInt32Array *)values |
| 217 tag:(uint32_t)tag; | 452 tag:(uint32_t)tag; |
| 218 /// Write a int32_t without any tag. | 453 /** |
| 454 * Write a int32_t without any tag. |
| 455 * |
| 456 * @param value The value to write out. |
| 457 **/ |
| 219 - (void)writeSFixed32NoTag:(int32_t)value; | 458 - (void)writeSFixed32NoTag:(int32_t)value; |
| 220 | 459 |
| 221 /// Write a BOOL for the given field number. | 460 /** |
| 461 * Write a BOOL for the given field number. |
| 462 * |
| 463 * @param fieldNumber The field number assigned to the value. |
| 464 * @param value The value to write out. |
| 465 **/ |
| 222 - (void)writeBool:(int32_t)fieldNumber value:(BOOL)value; | 466 - (void)writeBool:(int32_t)fieldNumber value:(BOOL)value; |
| 223 /// Write a packed array of BOOL for the given field number. | 467 /** |
| 468 * Write a packed array of BOOL for the given field number. |
| 469 * |
| 470 * @param fieldNumber The field number assigned to the values. |
| 471 * @param values The values to write out. |
| 472 * @param tag The tag assigned to the values. |
| 473 **/ |
| 224 - (void)writeBoolArray:(int32_t)fieldNumber | 474 - (void)writeBoolArray:(int32_t)fieldNumber |
| 225 values:(GPBBoolArray *)values | 475 values:(GPBBoolArray *)values |
| 226 tag:(uint32_t)tag; | 476 tag:(uint32_t)tag; |
| 227 /// Write a BOOL without any tag. | 477 /** |
| 478 * Write a BOOL without any tag. |
| 479 * |
| 480 * @param value The value to write out. |
| 481 **/ |
| 228 - (void)writeBoolNoTag:(BOOL)value; | 482 - (void)writeBoolNoTag:(BOOL)value; |
| 229 | 483 |
| 230 /// Write a int32_t for the given field number. | 484 /** |
| 485 * Write a int32_t for the given field number. |
| 486 * |
| 487 * @param fieldNumber The field number assigned to the value. |
| 488 * @param value The value to write out. |
| 489 **/ |
| 231 - (void)writeEnum:(int32_t)fieldNumber value:(int32_t)value; | 490 - (void)writeEnum:(int32_t)fieldNumber value:(int32_t)value; |
| 232 /// Write a packed array of int32_t for the given field number. | 491 /** |
| 492 * Write a packed array of int32_t for the given field number. |
| 493 * |
| 494 * @param fieldNumber The field number assigned to the values. |
| 495 * @param values The values to write out. |
| 496 * @param tag The tag assigned to the values. |
| 497 **/ |
| 233 - (void)writeEnumArray:(int32_t)fieldNumber | 498 - (void)writeEnumArray:(int32_t)fieldNumber |
| 234 values:(GPBEnumArray *)values | 499 values:(GPBEnumArray *)values |
| 235 tag:(uint32_t)tag; | 500 tag:(uint32_t)tag; |
| 236 /// Write a int32_t without any tag. | 501 /** |
| 502 * Write a int32_t without any tag. |
| 503 * |
| 504 * @param value The value to write out. |
| 505 **/ |
| 237 - (void)writeEnumNoTag:(int32_t)value; | 506 - (void)writeEnumNoTag:(int32_t)value; |
| 238 | 507 |
| 239 /// Write a NSString for the given field number. | 508 /** |
| 509 * Write a NSString for the given field number. |
| 510 * |
| 511 * @param fieldNumber The field number assigned to the value. |
| 512 * @param value The value to write out. |
| 513 **/ |
| 240 - (void)writeString:(int32_t)fieldNumber value:(NSString *)value; | 514 - (void)writeString:(int32_t)fieldNumber value:(NSString *)value; |
| 241 /// Write an array of NSString for the given field number. | 515 /** |
| 516 * Write an array of NSString for the given field number. |
| 517 * |
| 518 * @param fieldNumber The field number assigned to the values. |
| 519 * @param values The values to write out. |
| 520 **/ |
| 242 - (void)writeStringArray:(int32_t)fieldNumber values:(NSArray<NSString*> *)value
s; | 521 - (void)writeStringArray:(int32_t)fieldNumber values:(NSArray<NSString*> *)value
s; |
| 243 /// Write a NSString without any tag. | 522 /** |
| 523 * Write a NSString without any tag. |
| 524 * |
| 525 * @param value The value to write out. |
| 526 **/ |
| 244 - (void)writeStringNoTag:(NSString *)value; | 527 - (void)writeStringNoTag:(NSString *)value; |
| 245 | 528 |
| 246 /// Write a GPBMessage for the given field number. | 529 /** |
| 530 * Write a GPBMessage for the given field number. |
| 531 * |
| 532 * @param fieldNumber The field number assigned to the value. |
| 533 * @param value The value to write out. |
| 534 **/ |
| 247 - (void)writeMessage:(int32_t)fieldNumber value:(GPBMessage *)value; | 535 - (void)writeMessage:(int32_t)fieldNumber value:(GPBMessage *)value; |
| 248 /// Write an array of GPBMessage for the given field number. | 536 /** |
| 537 * Write an array of GPBMessage for the given field number. |
| 538 * |
| 539 * @param fieldNumber The field number assigned to the values. |
| 540 * @param values The values to write out. |
| 541 **/ |
| 249 - (void)writeMessageArray:(int32_t)fieldNumber values:(NSArray<GPBMessage*> *)va
lues; | 542 - (void)writeMessageArray:(int32_t)fieldNumber values:(NSArray<GPBMessage*> *)va
lues; |
| 250 /// Write a GPBMessage without any tag. | 543 /** |
| 544 * Write a GPBMessage without any tag. |
| 545 * |
| 546 * @param value The value to write out. |
| 547 **/ |
| 251 - (void)writeMessageNoTag:(GPBMessage *)value; | 548 - (void)writeMessageNoTag:(GPBMessage *)value; |
| 252 | 549 |
| 253 /// Write a NSData for the given field number. | 550 /** |
| 551 * Write a NSData for the given field number. |
| 552 * |
| 553 * @param fieldNumber The field number assigned to the value. |
| 554 * @param value The value to write out. |
| 555 **/ |
| 254 - (void)writeBytes:(int32_t)fieldNumber value:(NSData *)value; | 556 - (void)writeBytes:(int32_t)fieldNumber value:(NSData *)value; |
| 255 /// Write an array of NSData for the given field number. | 557 /** |
| 558 * Write an array of NSData for the given field number. |
| 559 * |
| 560 * @param fieldNumber The field number assigned to the values. |
| 561 * @param values The values to write out. |
| 562 **/ |
| 256 - (void)writeBytesArray:(int32_t)fieldNumber values:(NSArray<NSData*> *)values; | 563 - (void)writeBytesArray:(int32_t)fieldNumber values:(NSArray<NSData*> *)values; |
| 257 /// Write a NSData without any tag. | 564 /** |
| 565 * Write a NSData without any tag. |
| 566 * |
| 567 * @param value The value to write out. |
| 568 **/ |
| 258 - (void)writeBytesNoTag:(NSData *)value; | 569 - (void)writeBytesNoTag:(NSData *)value; |
| 259 | 570 |
| 260 /// Write a GPBMessage for the given field number. | 571 /** |
| 572 * Write a GPBMessage for the given field number. |
| 573 * |
| 574 * @param fieldNumber The field number assigned to the value. |
| 575 * @param value The value to write out. |
| 576 **/ |
| 261 - (void)writeGroup:(int32_t)fieldNumber | 577 - (void)writeGroup:(int32_t)fieldNumber |
| 262 value:(GPBMessage *)value; | 578 value:(GPBMessage *)value; |
| 263 /// Write an array of GPBMessage for the given field number. | 579 /** |
| 580 * Write an array of GPBMessage for the given field number. |
| 581 * |
| 582 * @param fieldNumber The field number assigned to the values. |
| 583 * @param values The values to write out. |
| 584 **/ |
| 264 - (void)writeGroupArray:(int32_t)fieldNumber values:(NSArray<GPBMessage*> *)valu
es; | 585 - (void)writeGroupArray:(int32_t)fieldNumber values:(NSArray<GPBMessage*> *)valu
es; |
| 265 /// Write a GPBMessage without any tag (but does write the endGroup tag). | 586 /** |
| 587 * Write a GPBMessage without any tag (but does write the endGroup tag). |
| 588 * |
| 589 * @param fieldNumber The field number assigned to the value. |
| 590 * @param value The value to write out. |
| 591 **/ |
| 266 - (void)writeGroupNoTag:(int32_t)fieldNumber | 592 - (void)writeGroupNoTag:(int32_t)fieldNumber |
| 267 value:(GPBMessage *)value; | 593 value:(GPBMessage *)value; |
| 268 | 594 |
| 269 /// Write a GPBUnknownFieldSet for the given field number. | 595 /** |
| 596 * Write a GPBUnknownFieldSet for the given field number. |
| 597 * |
| 598 * @param fieldNumber The field number assigned to the value. |
| 599 * @param value The value to write out. |
| 600 **/ |
| 270 - (void)writeUnknownGroup:(int32_t)fieldNumber | 601 - (void)writeUnknownGroup:(int32_t)fieldNumber |
| 271 value:(GPBUnknownFieldSet *)value; | 602 value:(GPBUnknownFieldSet *)value; |
| 272 /// Write an array of GPBUnknownFieldSet for the given field number. | 603 /** |
| 604 * Write an array of GPBUnknownFieldSet for the given field number. |
| 605 * |
| 606 * @param fieldNumber The field number assigned to the values. |
| 607 * @param values The values to write out. |
| 608 **/ |
| 273 - (void)writeUnknownGroupArray:(int32_t)fieldNumber values:(NSArray<GPBUnknownFi
eldSet*> *)values; | 609 - (void)writeUnknownGroupArray:(int32_t)fieldNumber values:(NSArray<GPBUnknownFi
eldSet*> *)values; |
| 274 /// Write a GPBUnknownFieldSet without any tag (but does write the endGroup tag)
. | 610 /** |
| 611 * Write a GPBUnknownFieldSet without any tag (but does write the endGroup tag). |
| 612 * |
| 613 * @param fieldNumber The field number assigned to the value. |
| 614 * @param value The value to write out. |
| 615 **/ |
| 275 - (void)writeUnknownGroupNoTag:(int32_t)fieldNumber | 616 - (void)writeUnknownGroupNoTag:(int32_t)fieldNumber |
| 276 value:(GPBUnknownFieldSet *)value; | 617 value:(GPBUnknownFieldSet *)value; |
| 277 | 618 |
| 278 //%PDDM-EXPAND-END _WRITE_DECLS() | 619 //%PDDM-EXPAND-END _WRITE_DECLS() |
| 279 | 620 |
| 280 /// Write a MessageSet extension field to the stream. For historical reasons, | 621 /** |
| 281 /// the wire format differs from normal fields. | 622 Write a MessageSet extension field to the stream. For historical reasons, |
| 623 the wire format differs from normal fields. |
| 624 |
| 625 @param fieldNumber The extension field number to write out. |
| 626 @param value The message from where to get the extension. |
| 627 */ |
| 282 - (void)writeMessageSetExtension:(int32_t)fieldNumber value:(GPBMessage *)value; | 628 - (void)writeMessageSetExtension:(int32_t)fieldNumber value:(GPBMessage *)value; |
| 283 | 629 |
| 284 /// Write an unparsed MessageSet extension field to the stream. For | 630 /** |
| 285 /// historical reasons, the wire format differs from normal fields. | 631 Write an unparsed MessageSet extension field to the stream. For historical |
| 632 reasons, the wire format differs from normal fields. |
| 633 |
| 634 @param fieldNumber The extension field number to write out. |
| 635 @param value The raw message from where to get the extension. |
| 636 */ |
| 286 - (void)writeRawMessageSetExtension:(int32_t)fieldNumber value:(NSData *)value; | 637 - (void)writeRawMessageSetExtension:(int32_t)fieldNumber value:(NSData *)value; |
| 287 | 638 |
| 288 @end | 639 @end |
| 289 | 640 |
| 290 NS_ASSUME_NONNULL_END | 641 NS_ASSUME_NONNULL_END |
| 291 | 642 |
| 292 // Write methods for types that can be in packed arrays. | 643 // Write methods for types that can be in packed arrays. |
| 293 //%PDDM-DEFINE _WRITE_PACKABLE_DECLS(NAME, ARRAY_TYPE, TYPE) | 644 //%PDDM-DEFINE _WRITE_PACKABLE_DECLS(NAME, ARRAY_TYPE, TYPE) |
| 294 //%/// Write a TYPE for the given field number. | 645 //%/** |
| 646 //% * Write a TYPE for the given field number. |
| 647 //% * |
| 648 //% * @param fieldNumber The field number assigned to the value. |
| 649 //% * @param value The value to write out. |
| 650 //% **/ |
| 295 //%- (void)write##NAME:(int32_t)fieldNumber value:(TYPE)value; | 651 //%- (void)write##NAME:(int32_t)fieldNumber value:(TYPE)value; |
| 296 //%/// Write a packed array of TYPE for the given field number. | 652 //%/** |
| 653 //% * Write a packed array of TYPE for the given field number. |
| 654 //% * |
| 655 //% * @param fieldNumber The field number assigned to the values. |
| 656 //% * @param values The values to write out. |
| 657 //% * @param tag The tag assigned to the values. |
| 658 //% **/ |
| 297 //%- (void)write##NAME##Array:(int32_t)fieldNumber | 659 //%- (void)write##NAME##Array:(int32_t)fieldNumber |
| 298 //% NAME$S values:(GPB##ARRAY_TYPE##Array *)values | 660 //% NAME$S values:(GPB##ARRAY_TYPE##Array *)values |
| 299 //% NAME$S tag:(uint32_t)tag; | 661 //% NAME$S tag:(uint32_t)tag; |
| 300 //%/// Write a TYPE without any tag. | 662 //%/** |
| 663 //% * Write a TYPE without any tag. |
| 664 //% * |
| 665 //% * @param value The value to write out. |
| 666 //% **/ |
| 301 //%- (void)write##NAME##NoTag:(TYPE)value; | 667 //%- (void)write##NAME##NoTag:(TYPE)value; |
| 302 //% | 668 //% |
| 303 // Write methods for types that aren't in packed arrays. | 669 // Write methods for types that aren't in packed arrays. |
| 304 //%PDDM-DEFINE _WRITE_UNPACKABLE_DECLS(NAME, TYPE) | 670 //%PDDM-DEFINE _WRITE_UNPACKABLE_DECLS(NAME, TYPE) |
| 305 //%/// Write a TYPE for the given field number. | 671 //%/** |
| 672 //% * Write a TYPE for the given field number. |
| 673 //% * |
| 674 //% * @param fieldNumber The field number assigned to the value. |
| 675 //% * @param value The value to write out. |
| 676 //% **/ |
| 306 //%- (void)write##NAME:(int32_t)fieldNumber value:(TYPE *)value; | 677 //%- (void)write##NAME:(int32_t)fieldNumber value:(TYPE *)value; |
| 307 //%/// Write an array of TYPE for the given field number. | 678 //%/** |
| 679 //% * Write an array of TYPE for the given field number. |
| 680 //% * |
| 681 //% * @param fieldNumber The field number assigned to the values. |
| 682 //% * @param values The values to write out. |
| 683 //% **/ |
| 308 //%- (void)write##NAME##Array:(int32_t)fieldNumber values:(NSArray<##TYPE##*> *)
values; | 684 //%- (void)write##NAME##Array:(int32_t)fieldNumber values:(NSArray<##TYPE##*> *)
values; |
| 309 //%/// Write a TYPE without any tag. | 685 //%/** |
| 686 //% * Write a TYPE without any tag. |
| 687 //% * |
| 688 //% * @param value The value to write out. |
| 689 //% **/ |
| 310 //%- (void)write##NAME##NoTag:(TYPE *)value; | 690 //%- (void)write##NAME##NoTag:(TYPE *)value; |
| 311 //% | 691 //% |
| 312 // Special write methods for Groups. | 692 // Special write methods for Groups. |
| 313 //%PDDM-DEFINE _WRITE_GROUP_DECLS(NAME, TYPE) | 693 //%PDDM-DEFINE _WRITE_GROUP_DECLS(NAME, TYPE) |
| 314 //%/// Write a TYPE for the given field number. | 694 //%/** |
| 695 //% * Write a TYPE for the given field number. |
| 696 //% * |
| 697 //% * @param fieldNumber The field number assigned to the value. |
| 698 //% * @param value The value to write out. |
| 699 //% **/ |
| 315 //%- (void)write##NAME:(int32_t)fieldNumber | 700 //%- (void)write##NAME:(int32_t)fieldNumber |
| 316 //% NAME$S value:(TYPE *)value; | 701 //% NAME$S value:(TYPE *)value; |
| 317 //%/// Write an array of TYPE for the given field number. | 702 //%/** |
| 703 //% * Write an array of TYPE for the given field number. |
| 704 //% * |
| 705 //% * @param fieldNumber The field number assigned to the values. |
| 706 //% * @param values The values to write out. |
| 707 //% **/ |
| 318 //%- (void)write##NAME##Array:(int32_t)fieldNumber values:(NSArray<##TYPE##*> *)
values; | 708 //%- (void)write##NAME##Array:(int32_t)fieldNumber values:(NSArray<##TYPE##*> *)
values; |
| 319 //%/// Write a TYPE without any tag (but does write the endGroup tag). | 709 //%/** |
| 710 //% * Write a TYPE without any tag (but does write the endGroup tag). |
| 711 //% * |
| 712 //% * @param fieldNumber The field number assigned to the value. |
| 713 //% * @param value The value to write out. |
| 714 //% **/ |
| 320 //%- (void)write##NAME##NoTag:(int32_t)fieldNumber | 715 //%- (void)write##NAME##NoTag:(int32_t)fieldNumber |
| 321 //% NAME$S value:(TYPE *)value; | 716 //% NAME$S value:(TYPE *)value; |
| 322 //% | 717 //% |
| 323 | 718 |
| 324 // One macro to hide it all up above. | 719 // One macro to hide it all up above. |
| 325 //%PDDM-DEFINE _WRITE_DECLS() | 720 //%PDDM-DEFINE _WRITE_DECLS() |
| 326 //%_WRITE_PACKABLE_DECLS(Double, Double, double) | 721 //%_WRITE_PACKABLE_DECLS(Double, Double, double) |
| 327 //%_WRITE_PACKABLE_DECLS(Float, Float, float) | 722 //%_WRITE_PACKABLE_DECLS(Float, Float, float) |
| 328 //%_WRITE_PACKABLE_DECLS(UInt64, UInt64, uint64_t) | 723 //%_WRITE_PACKABLE_DECLS(UInt64, UInt64, uint64_t) |
| 329 //%_WRITE_PACKABLE_DECLS(Int64, Int64, int64_t) | 724 //%_WRITE_PACKABLE_DECLS(Int64, Int64, int64_t) |
| 330 //%_WRITE_PACKABLE_DECLS(Int32, Int32, int32_t) | 725 //%_WRITE_PACKABLE_DECLS(Int32, Int32, int32_t) |
| 331 //%_WRITE_PACKABLE_DECLS(UInt32, UInt32, uint32_t) | 726 //%_WRITE_PACKABLE_DECLS(UInt32, UInt32, uint32_t) |
| 332 //%_WRITE_PACKABLE_DECLS(Fixed64, UInt64, uint64_t) | 727 //%_WRITE_PACKABLE_DECLS(Fixed64, UInt64, uint64_t) |
| 333 //%_WRITE_PACKABLE_DECLS(Fixed32, UInt32, uint32_t) | 728 //%_WRITE_PACKABLE_DECLS(Fixed32, UInt32, uint32_t) |
| 334 //%_WRITE_PACKABLE_DECLS(SInt32, Int32, int32_t) | 729 //%_WRITE_PACKABLE_DECLS(SInt32, Int32, int32_t) |
| 335 //%_WRITE_PACKABLE_DECLS(SInt64, Int64, int64_t) | 730 //%_WRITE_PACKABLE_DECLS(SInt64, Int64, int64_t) |
| 336 //%_WRITE_PACKABLE_DECLS(SFixed64, Int64, int64_t) | 731 //%_WRITE_PACKABLE_DECLS(SFixed64, Int64, int64_t) |
| 337 //%_WRITE_PACKABLE_DECLS(SFixed32, Int32, int32_t) | 732 //%_WRITE_PACKABLE_DECLS(SFixed32, Int32, int32_t) |
| 338 //%_WRITE_PACKABLE_DECLS(Bool, Bool, BOOL) | 733 //%_WRITE_PACKABLE_DECLS(Bool, Bool, BOOL) |
| 339 //%_WRITE_PACKABLE_DECLS(Enum, Enum, int32_t) | 734 //%_WRITE_PACKABLE_DECLS(Enum, Enum, int32_t) |
| 340 //%_WRITE_UNPACKABLE_DECLS(String, NSString) | 735 //%_WRITE_UNPACKABLE_DECLS(String, NSString) |
| 341 //%_WRITE_UNPACKABLE_DECLS(Message, GPBMessage) | 736 //%_WRITE_UNPACKABLE_DECLS(Message, GPBMessage) |
| 342 //%_WRITE_UNPACKABLE_DECLS(Bytes, NSData) | 737 //%_WRITE_UNPACKABLE_DECLS(Bytes, NSData) |
| 343 //%_WRITE_GROUP_DECLS(Group, GPBMessage) | 738 //%_WRITE_GROUP_DECLS(Group, GPBMessage) |
| 344 //%_WRITE_GROUP_DECLS(UnknownGroup, GPBUnknownFieldSet) | 739 //%_WRITE_GROUP_DECLS(UnknownGroup, GPBUnknownFieldSet) |
| OLD | NEW |