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 /** | 49 /// Writes out protocol message fields. |
50 * Writes out protocol message fields. | 50 /// |
51 * | 51 /// The common uses of protocol buffers shouldn't need to use this class. |
52 * The common uses of protocol buffers shouldn't need to use this class. | 52 /// @c GPBMessage's provide a @c -data method that will serialize the message |
53 * GPBMessage's provide a -data method that will serialize the message for you. | 53 /// for you. |
54 * | 54 /// |
55 * @note Subclassing of GPBCodedOutputStream is NOT supported. | 55 /// @note Subclassing of GPBCodedOutputStream is NOT supported. |
56 **/ | |
57 @interface GPBCodedOutputStream : NSObject | 56 @interface GPBCodedOutputStream : NSObject |
58 | 57 |
59 /** | 58 /// Creates a stream to fill in the given data. Data must be sized to fit or |
60 * Creates a stream to fill in the given data. Data must be sized to fit or | 59 /// an error will be raised when out of space. |
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 **/ | |
67 + (instancetype)streamWithData:(NSMutableData *)data; | 60 + (instancetype)streamWithData:(NSMutableData *)data; |
68 | 61 |
69 /** | 62 /// Creates a stream to write into the given @c NSOutputStream. |
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 **/ | |
76 + (instancetype)streamWithOutputStream:(NSOutputStream *)output; | 63 + (instancetype)streamWithOutputStream:(NSOutputStream *)output; |
77 | 64 |
78 /** | 65 /// Initializes a stream to fill in the given data. Data must be sized to fit |
79 * Initializes a stream to fill in the given data. Data must be sized to fit | 66 /// or an error will be raised when out of space. |
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 **/ | |
86 - (instancetype)initWithData:(NSMutableData *)data; | 67 - (instancetype)initWithData:(NSMutableData *)data; |
87 | 68 |
88 /** | 69 /// Initializes a stream to write into the given @c NSOutputStream. |
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 **/ | |
95 - (instancetype)initWithOutputStream:(NSOutputStream *)output; | 70 - (instancetype)initWithOutputStream:(NSOutputStream *)output; |
96 | 71 |
97 /** | 72 /// Flush any buffered data out. |
98 * Flush any buffered data out. | |
99 **/ | |
100 - (void)flush; | 73 - (void)flush; |
101 | 74 |
102 /** | 75 /// Write the raw byte out. |
103 * Write the raw byte out. | |
104 * | |
105 * @param value The value to write out. | |
106 **/ | |
107 - (void)writeRawByte:(uint8_t)value; | 76 - (void)writeRawByte:(uint8_t)value; |
108 | 77 |
109 /** | 78 /// Write the tag for the given field number and wire format. |
110 * Write the tag for the given field number and wire format. | 79 /// |
111 * | 80 /// @param fieldNumber The field number. |
112 * @param fieldNumber The field number. | 81 /// @param format The wire format the data for the field will be in. |
113 * @param format The wire format the data for the field will be in. | |
114 **/ | |
115 - (void)writeTag:(uint32_t)fieldNumber format:(GPBWireFormat)format; | 82 - (void)writeTag:(uint32_t)fieldNumber format:(GPBWireFormat)format; |
116 | 83 |
117 /** | 84 /// Write a 32bit value out in little endian format. |
118 * Write a 32bit value out in little endian format. | |
119 * | |
120 * @param value The value to write out. | |
121 **/ | |
122 - (void)writeRawLittleEndian32:(int32_t)value; | 85 - (void)writeRawLittleEndian32:(int32_t)value; |
123 /** | 86 /// Write a 64bit value out in little endian format. |
124 * Write a 64bit value out in little endian format. | |
125 * | |
126 * @param value The value to write out. | |
127 **/ | |
128 - (void)writeRawLittleEndian64:(int64_t)value; | 87 - (void)writeRawLittleEndian64:(int64_t)value; |
129 | 88 |
130 /** | 89 /// Write a 32bit value out in varint format. |
131 * Write a 32bit value out in varint format. | |
132 * | |
133 * @param value The value to write out. | |
134 **/ | |
135 - (void)writeRawVarint32:(int32_t)value; | 90 - (void)writeRawVarint32:(int32_t)value; |
136 /** | 91 /// Write a 64bit value out in varint format. |
137 * Write a 64bit value out in varint format. | |
138 * | |
139 * @param value The value to write out. | |
140 **/ | |
141 - (void)writeRawVarint64:(int64_t)value; | 92 - (void)writeRawVarint64:(int64_t)value; |
142 | 93 |
143 /** | 94 /// Write a size_t out as a 32bit varint value. |
144 * Write a size_t out as a 32bit varint value. | 95 /// |
145 * | 96 /// @note This will truncate 64 bit values to 32. |
146 * @note This will truncate 64 bit values to 32. | |
147 * | |
148 * @param value The value to write out. | |
149 **/ | |
150 - (void)writeRawVarintSizeTAs32:(size_t)value; | 97 - (void)writeRawVarintSizeTAs32:(size_t)value; |
151 | 98 |
152 /** | 99 /// Writes the contents of an @c NSData out. |
153 * Writes the contents of an NSData out. | |
154 * | |
155 * @param data The data to write out. | |
156 **/ | |
157 - (void)writeRawData:(NSData *)data; | 100 - (void)writeRawData:(NSData *)data; |
158 /** | 101 /// Writes out the given data. |
159 * Writes out the given data. | 102 /// |
160 * | 103 /// @param data The data blob to write out. |
161 * @param data The data blob to write out. | 104 /// @param offset The offset into the blob to start writing out. |
162 * @param offset The offset into the blob to start writing out. | 105 /// @param length The number of bytes from the blob to write out. |
163 * @param length The number of bytes from the blob to write out. | |
164 **/ | |
165 - (void)writeRawPtr:(const void *)data | 106 - (void)writeRawPtr:(const void *)data |
166 offset:(size_t)offset | 107 offset:(size_t)offset |
167 length:(size_t)length; | 108 length:(size_t)length; |
168 | 109 |
169 //%PDDM-EXPAND _WRITE_DECLS() | 110 //%PDDM-EXPAND _WRITE_DECLS() |
170 // This block of code is generated, do not edit it directly. | 111 // This block of code is generated, do not edit it directly. |
171 | 112 |
172 /** | 113 /// Write a double for the given field number. |
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 **/ | |
178 - (void)writeDouble:(int32_t)fieldNumber value:(double)value; | 114 - (void)writeDouble:(int32_t)fieldNumber value:(double)value; |
179 /** | 115 /// Write a packed array of double for the given field number. |
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 **/ | |
186 - (void)writeDoubleArray:(int32_t)fieldNumber | 116 - (void)writeDoubleArray:(int32_t)fieldNumber |
187 values:(GPBDoubleArray *)values | 117 values:(GPBDoubleArray *)values |
188 tag:(uint32_t)tag; | 118 tag:(uint32_t)tag; |
189 /** | 119 /// Write a double without any tag. |
190 * Write a double without any tag. | |
191 * | |
192 * @param value The value to write out. | |
193 **/ | |
194 - (void)writeDoubleNoTag:(double)value; | 120 - (void)writeDoubleNoTag:(double)value; |
195 | 121 |
196 /** | 122 /// Write a float for the given field number. |
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 **/ | |
202 - (void)writeFloat:(int32_t)fieldNumber value:(float)value; | 123 - (void)writeFloat:(int32_t)fieldNumber value:(float)value; |
203 /** | 124 /// Write a packed array of float for the given field number. |
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 **/ | |
210 - (void)writeFloatArray:(int32_t)fieldNumber | 125 - (void)writeFloatArray:(int32_t)fieldNumber |
211 values:(GPBFloatArray *)values | 126 values:(GPBFloatArray *)values |
212 tag:(uint32_t)tag; | 127 tag:(uint32_t)tag; |
213 /** | 128 /// Write a float without any tag. |
214 * Write a float without any tag. | |
215 * | |
216 * @param value The value to write out. | |
217 **/ | |
218 - (void)writeFloatNoTag:(float)value; | 129 - (void)writeFloatNoTag:(float)value; |
219 | 130 |
220 /** | 131 /// Write a uint64_t for the given field number. |
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 **/ | |
226 - (void)writeUInt64:(int32_t)fieldNumber value:(uint64_t)value; | 132 - (void)writeUInt64:(int32_t)fieldNumber value:(uint64_t)value; |
227 /** | 133 /// Write a packed array of uint64_t for the given field number. |
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 **/ | |
234 - (void)writeUInt64Array:(int32_t)fieldNumber | 134 - (void)writeUInt64Array:(int32_t)fieldNumber |
235 values:(GPBUInt64Array *)values | 135 values:(GPBUInt64Array *)values |
236 tag:(uint32_t)tag; | 136 tag:(uint32_t)tag; |
237 /** | 137 /// Write a uint64_t without any tag. |
238 * Write a uint64_t without any tag. | |
239 * | |
240 * @param value The value to write out. | |
241 **/ | |
242 - (void)writeUInt64NoTag:(uint64_t)value; | 138 - (void)writeUInt64NoTag:(uint64_t)value; |
243 | 139 |
244 /** | 140 /// Write a int64_t for the given field number. |
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 **/ | |
250 - (void)writeInt64:(int32_t)fieldNumber value:(int64_t)value; | 141 - (void)writeInt64:(int32_t)fieldNumber value:(int64_t)value; |
251 /** | 142 /// Write a packed array of int64_t for the given field number. |
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 **/ | |
258 - (void)writeInt64Array:(int32_t)fieldNumber | 143 - (void)writeInt64Array:(int32_t)fieldNumber |
259 values:(GPBInt64Array *)values | 144 values:(GPBInt64Array *)values |
260 tag:(uint32_t)tag; | 145 tag:(uint32_t)tag; |
261 /** | 146 /// Write a int64_t without any tag. |
262 * Write a int64_t without any tag. | |
263 * | |
264 * @param value The value to write out. | |
265 **/ | |
266 - (void)writeInt64NoTag:(int64_t)value; | 147 - (void)writeInt64NoTag:(int64_t)value; |
267 | 148 |
268 /** | 149 /// Write a int32_t for the given field number. |
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 **/ | |
274 - (void)writeInt32:(int32_t)fieldNumber value:(int32_t)value; | 150 - (void)writeInt32:(int32_t)fieldNumber value:(int32_t)value; |
275 /** | 151 /// Write a packed array of int32_t for the given field number. |
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 **/ | |
282 - (void)writeInt32Array:(int32_t)fieldNumber | 152 - (void)writeInt32Array:(int32_t)fieldNumber |
283 values:(GPBInt32Array *)values | 153 values:(GPBInt32Array *)values |
284 tag:(uint32_t)tag; | 154 tag:(uint32_t)tag; |
285 /** | 155 /// Write a int32_t without any tag. |
286 * Write a int32_t without any tag. | |
287 * | |
288 * @param value The value to write out. | |
289 **/ | |
290 - (void)writeInt32NoTag:(int32_t)value; | 156 - (void)writeInt32NoTag:(int32_t)value; |
291 | 157 |
292 /** | 158 /// Write a uint32_t for the given field number. |
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 **/ | |
298 - (void)writeUInt32:(int32_t)fieldNumber value:(uint32_t)value; | 159 - (void)writeUInt32:(int32_t)fieldNumber value:(uint32_t)value; |
299 /** | 160 /// Write a packed array of uint32_t for the given field number. |
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 **/ | |
306 - (void)writeUInt32Array:(int32_t)fieldNumber | 161 - (void)writeUInt32Array:(int32_t)fieldNumber |
307 values:(GPBUInt32Array *)values | 162 values:(GPBUInt32Array *)values |
308 tag:(uint32_t)tag; | 163 tag:(uint32_t)tag; |
309 /** | 164 /// Write a uint32_t without any tag. |
310 * Write a uint32_t without any tag. | |
311 * | |
312 * @param value The value to write out. | |
313 **/ | |
314 - (void)writeUInt32NoTag:(uint32_t)value; | 165 - (void)writeUInt32NoTag:(uint32_t)value; |
315 | 166 |
316 /** | 167 /// Write a uint64_t for the given field number. |
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 **/ | |
322 - (void)writeFixed64:(int32_t)fieldNumber value:(uint64_t)value; | 168 - (void)writeFixed64:(int32_t)fieldNumber value:(uint64_t)value; |
323 /** | 169 /// Write a packed array of uint64_t for the given field number. |
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 **/ | |
330 - (void)writeFixed64Array:(int32_t)fieldNumber | 170 - (void)writeFixed64Array:(int32_t)fieldNumber |
331 values:(GPBUInt64Array *)values | 171 values:(GPBUInt64Array *)values |
332 tag:(uint32_t)tag; | 172 tag:(uint32_t)tag; |
333 /** | 173 /// Write a uint64_t without any tag. |
334 * Write a uint64_t without any tag. | |
335 * | |
336 * @param value The value to write out. | |
337 **/ | |
338 - (void)writeFixed64NoTag:(uint64_t)value; | 174 - (void)writeFixed64NoTag:(uint64_t)value; |
339 | 175 |
340 /** | 176 /// Write a uint32_t for the given field number. |
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 **/ | |
346 - (void)writeFixed32:(int32_t)fieldNumber value:(uint32_t)value; | 177 - (void)writeFixed32:(int32_t)fieldNumber value:(uint32_t)value; |
347 /** | 178 /// Write a packed array of uint32_t for the given field number. |
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 **/ | |
354 - (void)writeFixed32Array:(int32_t)fieldNumber | 179 - (void)writeFixed32Array:(int32_t)fieldNumber |
355 values:(GPBUInt32Array *)values | 180 values:(GPBUInt32Array *)values |
356 tag:(uint32_t)tag; | 181 tag:(uint32_t)tag; |
357 /** | 182 /// Write a uint32_t without any tag. |
358 * Write a uint32_t without any tag. | |
359 * | |
360 * @param value The value to write out. | |
361 **/ | |
362 - (void)writeFixed32NoTag:(uint32_t)value; | 183 - (void)writeFixed32NoTag:(uint32_t)value; |
363 | 184 |
364 /** | 185 /// Write a int32_t for the given field number. |
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 **/ | |
370 - (void)writeSInt32:(int32_t)fieldNumber value:(int32_t)value; | 186 - (void)writeSInt32:(int32_t)fieldNumber value:(int32_t)value; |
371 /** | 187 /// Write a packed array of int32_t for the given field number. |
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 **/ | |
378 - (void)writeSInt32Array:(int32_t)fieldNumber | 188 - (void)writeSInt32Array:(int32_t)fieldNumber |
379 values:(GPBInt32Array *)values | 189 values:(GPBInt32Array *)values |
380 tag:(uint32_t)tag; | 190 tag:(uint32_t)tag; |
381 /** | 191 /// Write a int32_t without any tag. |
382 * Write a int32_t without any tag. | |
383 * | |
384 * @param value The value to write out. | |
385 **/ | |
386 - (void)writeSInt32NoTag:(int32_t)value; | 192 - (void)writeSInt32NoTag:(int32_t)value; |
387 | 193 |
388 /** | 194 /// Write a int64_t for the given field number. |
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 **/ | |
394 - (void)writeSInt64:(int32_t)fieldNumber value:(int64_t)value; | 195 - (void)writeSInt64:(int32_t)fieldNumber value:(int64_t)value; |
395 /** | 196 /// Write a packed array of int64_t for the given field number. |
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 **/ | |
402 - (void)writeSInt64Array:(int32_t)fieldNumber | 197 - (void)writeSInt64Array:(int32_t)fieldNumber |
403 values:(GPBInt64Array *)values | 198 values:(GPBInt64Array *)values |
404 tag:(uint32_t)tag; | 199 tag:(uint32_t)tag; |
405 /** | 200 /// Write a int64_t without any tag. |
406 * Write a int64_t without any tag. | |
407 * | |
408 * @param value The value to write out. | |
409 **/ | |
410 - (void)writeSInt64NoTag:(int64_t)value; | 201 - (void)writeSInt64NoTag:(int64_t)value; |
411 | 202 |
412 /** | 203 /// Write a int64_t for the given field number. |
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 **/ | |
418 - (void)writeSFixed64:(int32_t)fieldNumber value:(int64_t)value; | 204 - (void)writeSFixed64:(int32_t)fieldNumber value:(int64_t)value; |
419 /** | 205 /// Write a packed array of int64_t for the given field number. |
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 **/ | |
426 - (void)writeSFixed64Array:(int32_t)fieldNumber | 206 - (void)writeSFixed64Array:(int32_t)fieldNumber |
427 values:(GPBInt64Array *)values | 207 values:(GPBInt64Array *)values |
428 tag:(uint32_t)tag; | 208 tag:(uint32_t)tag; |
429 /** | 209 /// Write a int64_t without any tag. |
430 * Write a int64_t without any tag. | |
431 * | |
432 * @param value The value to write out. | |
433 **/ | |
434 - (void)writeSFixed64NoTag:(int64_t)value; | 210 - (void)writeSFixed64NoTag:(int64_t)value; |
435 | 211 |
436 /** | 212 /// Write a int32_t for the given field number. |
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 **/ | |
442 - (void)writeSFixed32:(int32_t)fieldNumber value:(int32_t)value; | 213 - (void)writeSFixed32:(int32_t)fieldNumber value:(int32_t)value; |
443 /** | 214 /// Write a packed array of int32_t for the given field number. |
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 **/ | |
450 - (void)writeSFixed32Array:(int32_t)fieldNumber | 215 - (void)writeSFixed32Array:(int32_t)fieldNumber |
451 values:(GPBInt32Array *)values | 216 values:(GPBInt32Array *)values |
452 tag:(uint32_t)tag; | 217 tag:(uint32_t)tag; |
453 /** | 218 /// Write a int32_t without any tag. |
454 * Write a int32_t without any tag. | |
455 * | |
456 * @param value The value to write out. | |
457 **/ | |
458 - (void)writeSFixed32NoTag:(int32_t)value; | 219 - (void)writeSFixed32NoTag:(int32_t)value; |
459 | 220 |
460 /** | 221 /// Write a BOOL for the given field number. |
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 **/ | |
466 - (void)writeBool:(int32_t)fieldNumber value:(BOOL)value; | 222 - (void)writeBool:(int32_t)fieldNumber value:(BOOL)value; |
467 /** | 223 /// Write a packed array of BOOL for the given field number. |
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 **/ | |
474 - (void)writeBoolArray:(int32_t)fieldNumber | 224 - (void)writeBoolArray:(int32_t)fieldNumber |
475 values:(GPBBoolArray *)values | 225 values:(GPBBoolArray *)values |
476 tag:(uint32_t)tag; | 226 tag:(uint32_t)tag; |
477 /** | 227 /// Write a BOOL without any tag. |
478 * Write a BOOL without any tag. | |
479 * | |
480 * @param value The value to write out. | |
481 **/ | |
482 - (void)writeBoolNoTag:(BOOL)value; | 228 - (void)writeBoolNoTag:(BOOL)value; |
483 | 229 |
484 /** | 230 /// Write a int32_t for the given field number. |
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 **/ | |
490 - (void)writeEnum:(int32_t)fieldNumber value:(int32_t)value; | 231 - (void)writeEnum:(int32_t)fieldNumber value:(int32_t)value; |
491 /** | 232 /// Write a packed array of int32_t for the given field number. |
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 **/ | |
498 - (void)writeEnumArray:(int32_t)fieldNumber | 233 - (void)writeEnumArray:(int32_t)fieldNumber |
499 values:(GPBEnumArray *)values | 234 values:(GPBEnumArray *)values |
500 tag:(uint32_t)tag; | 235 tag:(uint32_t)tag; |
501 /** | 236 /// Write a int32_t without any tag. |
502 * Write a int32_t without any tag. | |
503 * | |
504 * @param value The value to write out. | |
505 **/ | |
506 - (void)writeEnumNoTag:(int32_t)value; | 237 - (void)writeEnumNoTag:(int32_t)value; |
507 | 238 |
508 /** | 239 /// Write a NSString for the given field number. |
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 **/ | |
514 - (void)writeString:(int32_t)fieldNumber value:(NSString *)value; | 240 - (void)writeString:(int32_t)fieldNumber value:(NSString *)value; |
515 /** | 241 /// Write an array of NSString for the given field number. |
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 **/ | |
521 - (void)writeStringArray:(int32_t)fieldNumber values:(NSArray<NSString*> *)value
s; | 242 - (void)writeStringArray:(int32_t)fieldNumber values:(NSArray<NSString*> *)value
s; |
522 /** | 243 /// Write a NSString without any tag. |
523 * Write a NSString without any tag. | |
524 * | |
525 * @param value The value to write out. | |
526 **/ | |
527 - (void)writeStringNoTag:(NSString *)value; | 244 - (void)writeStringNoTag:(NSString *)value; |
528 | 245 |
529 /** | 246 /// Write a GPBMessage for the given field number. |
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 **/ | |
535 - (void)writeMessage:(int32_t)fieldNumber value:(GPBMessage *)value; | 247 - (void)writeMessage:(int32_t)fieldNumber value:(GPBMessage *)value; |
536 /** | 248 /// Write an array of GPBMessage for the given field number. |
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 **/ | |
542 - (void)writeMessageArray:(int32_t)fieldNumber values:(NSArray<GPBMessage*> *)va
lues; | 249 - (void)writeMessageArray:(int32_t)fieldNumber values:(NSArray<GPBMessage*> *)va
lues; |
543 /** | 250 /// Write a GPBMessage without any tag. |
544 * Write a GPBMessage without any tag. | |
545 * | |
546 * @param value The value to write out. | |
547 **/ | |
548 - (void)writeMessageNoTag:(GPBMessage *)value; | 251 - (void)writeMessageNoTag:(GPBMessage *)value; |
549 | 252 |
550 /** | 253 /// Write a NSData for the given field number. |
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 **/ | |
556 - (void)writeBytes:(int32_t)fieldNumber value:(NSData *)value; | 254 - (void)writeBytes:(int32_t)fieldNumber value:(NSData *)value; |
557 /** | 255 /// Write an array of NSData for the given field number. |
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 **/ | |
563 - (void)writeBytesArray:(int32_t)fieldNumber values:(NSArray<NSData*> *)values; | 256 - (void)writeBytesArray:(int32_t)fieldNumber values:(NSArray<NSData*> *)values; |
564 /** | 257 /// Write a NSData without any tag. |
565 * Write a NSData without any tag. | |
566 * | |
567 * @param value The value to write out. | |
568 **/ | |
569 - (void)writeBytesNoTag:(NSData *)value; | 258 - (void)writeBytesNoTag:(NSData *)value; |
570 | 259 |
571 /** | 260 /// Write a GPBMessage for the given field number. |
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 **/ | |
577 - (void)writeGroup:(int32_t)fieldNumber | 261 - (void)writeGroup:(int32_t)fieldNumber |
578 value:(GPBMessage *)value; | 262 value:(GPBMessage *)value; |
579 /** | 263 /// Write an array of GPBMessage for the given field number. |
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 **/ | |
585 - (void)writeGroupArray:(int32_t)fieldNumber values:(NSArray<GPBMessage*> *)valu
es; | 264 - (void)writeGroupArray:(int32_t)fieldNumber values:(NSArray<GPBMessage*> *)valu
es; |
586 /** | 265 /// Write a GPBMessage without any tag (but does write the endGroup tag). |
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 **/ | |
592 - (void)writeGroupNoTag:(int32_t)fieldNumber | 266 - (void)writeGroupNoTag:(int32_t)fieldNumber |
593 value:(GPBMessage *)value; | 267 value:(GPBMessage *)value; |
594 | 268 |
595 /** | 269 /// Write a GPBUnknownFieldSet for the given field number. |
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 **/ | |
601 - (void)writeUnknownGroup:(int32_t)fieldNumber | 270 - (void)writeUnknownGroup:(int32_t)fieldNumber |
602 value:(GPBUnknownFieldSet *)value; | 271 value:(GPBUnknownFieldSet *)value; |
603 /** | 272 /// Write an array of GPBUnknownFieldSet for the given field number. |
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 **/ | |
609 - (void)writeUnknownGroupArray:(int32_t)fieldNumber values:(NSArray<GPBUnknownFi
eldSet*> *)values; | 273 - (void)writeUnknownGroupArray:(int32_t)fieldNumber values:(NSArray<GPBUnknownFi
eldSet*> *)values; |
610 /** | 274 /// Write a GPBUnknownFieldSet without any tag (but does write the endGroup tag)
. |
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 **/ | |
616 - (void)writeUnknownGroupNoTag:(int32_t)fieldNumber | 275 - (void)writeUnknownGroupNoTag:(int32_t)fieldNumber |
617 value:(GPBUnknownFieldSet *)value; | 276 value:(GPBUnknownFieldSet *)value; |
618 | 277 |
619 //%PDDM-EXPAND-END _WRITE_DECLS() | 278 //%PDDM-EXPAND-END _WRITE_DECLS() |
620 | 279 |
621 /** | 280 /// Write a MessageSet extension field to the stream. For historical reasons, |
622 Write a MessageSet extension field to the stream. For historical reasons, | 281 /// the wire format differs from normal fields. |
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 */ | |
628 - (void)writeMessageSetExtension:(int32_t)fieldNumber value:(GPBMessage *)value; | 282 - (void)writeMessageSetExtension:(int32_t)fieldNumber value:(GPBMessage *)value; |
629 | 283 |
630 /** | 284 /// Write an unparsed MessageSet extension field to the stream. For |
631 Write an unparsed MessageSet extension field to the stream. For historical | 285 /// historical reasons, the wire format differs from normal fields. |
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 */ | |
637 - (void)writeRawMessageSetExtension:(int32_t)fieldNumber value:(NSData *)value; | 286 - (void)writeRawMessageSetExtension:(int32_t)fieldNumber value:(NSData *)value; |
638 | 287 |
639 @end | 288 @end |
640 | 289 |
641 NS_ASSUME_NONNULL_END | 290 NS_ASSUME_NONNULL_END |
642 | 291 |
643 // Write methods for types that can be in packed arrays. | 292 // Write methods for types that can be in packed arrays. |
644 //%PDDM-DEFINE _WRITE_PACKABLE_DECLS(NAME, ARRAY_TYPE, TYPE) | 293 //%PDDM-DEFINE _WRITE_PACKABLE_DECLS(NAME, ARRAY_TYPE, TYPE) |
645 //%/** | 294 //%/// Write a TYPE for the given field number. |
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 //% **/ | |
651 //%- (void)write##NAME:(int32_t)fieldNumber value:(TYPE)value; | 295 //%- (void)write##NAME:(int32_t)fieldNumber value:(TYPE)value; |
652 //%/** | 296 //%/// Write a packed array of TYPE for the given field number. |
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 //% **/ | |
659 //%- (void)write##NAME##Array:(int32_t)fieldNumber | 297 //%- (void)write##NAME##Array:(int32_t)fieldNumber |
660 //% NAME$S values:(GPB##ARRAY_TYPE##Array *)values | 298 //% NAME$S values:(GPB##ARRAY_TYPE##Array *)values |
661 //% NAME$S tag:(uint32_t)tag; | 299 //% NAME$S tag:(uint32_t)tag; |
662 //%/** | 300 //%/// Write a TYPE without any tag. |
663 //% * Write a TYPE without any tag. | |
664 //% * | |
665 //% * @param value The value to write out. | |
666 //% **/ | |
667 //%- (void)write##NAME##NoTag:(TYPE)value; | 301 //%- (void)write##NAME##NoTag:(TYPE)value; |
668 //% | 302 //% |
669 // Write methods for types that aren't in packed arrays. | 303 // Write methods for types that aren't in packed arrays. |
670 //%PDDM-DEFINE _WRITE_UNPACKABLE_DECLS(NAME, TYPE) | 304 //%PDDM-DEFINE _WRITE_UNPACKABLE_DECLS(NAME, TYPE) |
671 //%/** | 305 //%/// Write a TYPE for the given field number. |
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 //% **/ | |
677 //%- (void)write##NAME:(int32_t)fieldNumber value:(TYPE *)value; | 306 //%- (void)write##NAME:(int32_t)fieldNumber value:(TYPE *)value; |
678 //%/** | 307 //%/// Write an array of TYPE for the given field number. |
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 //% **/ | |
684 //%- (void)write##NAME##Array:(int32_t)fieldNumber values:(NSArray<##TYPE##*> *)
values; | 308 //%- (void)write##NAME##Array:(int32_t)fieldNumber values:(NSArray<##TYPE##*> *)
values; |
685 //%/** | 309 //%/// Write a TYPE without any tag. |
686 //% * Write a TYPE without any tag. | |
687 //% * | |
688 //% * @param value The value to write out. | |
689 //% **/ | |
690 //%- (void)write##NAME##NoTag:(TYPE *)value; | 310 //%- (void)write##NAME##NoTag:(TYPE *)value; |
691 //% | 311 //% |
692 // Special write methods for Groups. | 312 // Special write methods for Groups. |
693 //%PDDM-DEFINE _WRITE_GROUP_DECLS(NAME, TYPE) | 313 //%PDDM-DEFINE _WRITE_GROUP_DECLS(NAME, TYPE) |
694 //%/** | 314 //%/// Write a TYPE for the given field number. |
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 //% **/ | |
700 //%- (void)write##NAME:(int32_t)fieldNumber | 315 //%- (void)write##NAME:(int32_t)fieldNumber |
701 //% NAME$S value:(TYPE *)value; | 316 //% NAME$S value:(TYPE *)value; |
702 //%/** | 317 //%/// Write an array of TYPE for the given field number. |
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 //% **/ | |
708 //%- (void)write##NAME##Array:(int32_t)fieldNumber values:(NSArray<##TYPE##*> *)
values; | 318 //%- (void)write##NAME##Array:(int32_t)fieldNumber values:(NSArray<##TYPE##*> *)
values; |
709 //%/** | 319 //%/// Write a TYPE without any tag (but does write the endGroup tag). |
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 //% **/ | |
715 //%- (void)write##NAME##NoTag:(int32_t)fieldNumber | 320 //%- (void)write##NAME##NoTag:(int32_t)fieldNumber |
716 //% NAME$S value:(TYPE *)value; | 321 //% NAME$S value:(TYPE *)value; |
717 //% | 322 //% |
718 | 323 |
719 // One macro to hide it all up above. | 324 // One macro to hide it all up above. |
720 //%PDDM-DEFINE _WRITE_DECLS() | 325 //%PDDM-DEFINE _WRITE_DECLS() |
721 //%_WRITE_PACKABLE_DECLS(Double, Double, double) | 326 //%_WRITE_PACKABLE_DECLS(Double, Double, double) |
722 //%_WRITE_PACKABLE_DECLS(Float, Float, float) | 327 //%_WRITE_PACKABLE_DECLS(Float, Float, float) |
723 //%_WRITE_PACKABLE_DECLS(UInt64, UInt64, uint64_t) | 328 //%_WRITE_PACKABLE_DECLS(UInt64, UInt64, uint64_t) |
724 //%_WRITE_PACKABLE_DECLS(Int64, Int64, int64_t) | 329 //%_WRITE_PACKABLE_DECLS(Int64, Int64, int64_t) |
725 //%_WRITE_PACKABLE_DECLS(Int32, Int32, int32_t) | 330 //%_WRITE_PACKABLE_DECLS(Int32, Int32, int32_t) |
726 //%_WRITE_PACKABLE_DECLS(UInt32, UInt32, uint32_t) | 331 //%_WRITE_PACKABLE_DECLS(UInt32, UInt32, uint32_t) |
727 //%_WRITE_PACKABLE_DECLS(Fixed64, UInt64, uint64_t) | 332 //%_WRITE_PACKABLE_DECLS(Fixed64, UInt64, uint64_t) |
728 //%_WRITE_PACKABLE_DECLS(Fixed32, UInt32, uint32_t) | 333 //%_WRITE_PACKABLE_DECLS(Fixed32, UInt32, uint32_t) |
729 //%_WRITE_PACKABLE_DECLS(SInt32, Int32, int32_t) | 334 //%_WRITE_PACKABLE_DECLS(SInt32, Int32, int32_t) |
730 //%_WRITE_PACKABLE_DECLS(SInt64, Int64, int64_t) | 335 //%_WRITE_PACKABLE_DECLS(SInt64, Int64, int64_t) |
731 //%_WRITE_PACKABLE_DECLS(SFixed64, Int64, int64_t) | 336 //%_WRITE_PACKABLE_DECLS(SFixed64, Int64, int64_t) |
732 //%_WRITE_PACKABLE_DECLS(SFixed32, Int32, int32_t) | 337 //%_WRITE_PACKABLE_DECLS(SFixed32, Int32, int32_t) |
733 //%_WRITE_PACKABLE_DECLS(Bool, Bool, BOOL) | 338 //%_WRITE_PACKABLE_DECLS(Bool, Bool, BOOL) |
734 //%_WRITE_PACKABLE_DECLS(Enum, Enum, int32_t) | 339 //%_WRITE_PACKABLE_DECLS(Enum, Enum, int32_t) |
735 //%_WRITE_UNPACKABLE_DECLS(String, NSString) | 340 //%_WRITE_UNPACKABLE_DECLS(String, NSString) |
736 //%_WRITE_UNPACKABLE_DECLS(Message, GPBMessage) | 341 //%_WRITE_UNPACKABLE_DECLS(Message, GPBMessage) |
737 //%_WRITE_UNPACKABLE_DECLS(Bytes, NSData) | 342 //%_WRITE_UNPACKABLE_DECLS(Bytes, NSData) |
738 //%_WRITE_GROUP_DECLS(Group, GPBMessage) | 343 //%_WRITE_GROUP_DECLS(Group, GPBMessage) |
739 //%_WRITE_GROUP_DECLS(UnknownGroup, GPBUnknownFieldSet) | 344 //%_WRITE_GROUP_DECLS(UnknownGroup, GPBUnknownFieldSet) |
OLD | NEW |