2015-05-01 12:57:16 +00:00
|
|
|
// Protocol Buffers - Google's data interchange format
|
|
|
|
// Copyright 2008 Google Inc. All rights reserved.
|
|
|
|
// https://developers.google.com/protocol-buffers/
|
|
|
|
//
|
|
|
|
// Redistribution and use in source and binary forms, with or without
|
|
|
|
// modification, are permitted provided that the following conditions are
|
|
|
|
// met:
|
|
|
|
//
|
|
|
|
// * Redistributions of source code must retain the above copyright
|
|
|
|
// notice, this list of conditions and the following disclaimer.
|
|
|
|
// * Redistributions in binary form must reproduce the above
|
|
|
|
// copyright notice, this list of conditions and the following disclaimer
|
|
|
|
// in the documentation and/or other materials provided with the
|
|
|
|
// distribution.
|
|
|
|
// * Neither the name of Google Inc. nor the names of its
|
|
|
|
// contributors may be used to endorse or promote products derived from
|
|
|
|
// this software without specific prior written permission.
|
|
|
|
//
|
|
|
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
|
|
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
|
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
|
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
|
2015-06-08 20:24:57 +00:00
|
|
|
#import "GPBRuntimeTypes.h"
|
2015-05-01 12:57:16 +00:00
|
|
|
#import "GPBWireFormat.h"
|
|
|
|
|
|
|
|
@class GPBBoolArray;
|
|
|
|
@class GPBDoubleArray;
|
|
|
|
@class GPBEnumArray;
|
|
|
|
@class GPBFloatArray;
|
|
|
|
@class GPBMessage;
|
|
|
|
@class GPBInt32Array;
|
|
|
|
@class GPBInt64Array;
|
|
|
|
@class GPBUInt32Array;
|
|
|
|
@class GPBUInt64Array;
|
|
|
|
@class GPBUnknownFieldSet;
|
|
|
|
|
2015-06-16 20:45:14 +00:00
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
2017-06-19 14:21:33 +00:00
|
|
|
/**
|
|
|
|
* @c GPBCodedOutputStream exception names.
|
|
|
|
**/
|
|
|
|
extern NSString *const GPBCodedOutputStreamException_OutOfSpace;
|
|
|
|
extern NSString *const GPBCodedOutputStreamException_WriteFailed;
|
|
|
|
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Writes out protocol message fields.
|
|
|
|
*
|
|
|
|
* The common uses of protocol buffers shouldn't need to use this class.
|
|
|
|
* GPBMessage's provide a -data method that will serialize the message for you.
|
|
|
|
*
|
2017-06-19 14:21:33 +00:00
|
|
|
* @note Any -write* api can raise the GPBCodedOutputStreamException_*
|
|
|
|
* exceptions.
|
|
|
|
*
|
2016-08-08 14:15:02 +00:00
|
|
|
* @note Subclassing of GPBCodedOutputStream is NOT supported.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
@interface GPBCodedOutputStream : NSObject
|
|
|
|
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Creates a stream to fill in the given data. Data must be sized to fit or
|
|
|
|
* an error will be raised when out of space.
|
|
|
|
*
|
|
|
|
* @param data The data where the stream will be written to.
|
|
|
|
*
|
|
|
|
* @return A newly instanced GPBCodedOutputStream.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
+ (instancetype)streamWithData:(NSMutableData *)data;
|
2016-03-07 17:07:03 +00:00
|
|
|
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Creates a stream to write into the given NSOutputStream.
|
|
|
|
*
|
|
|
|
* @param output The output stream where the stream will be written to.
|
|
|
|
*
|
|
|
|
* @return A newly instanced GPBCodedOutputStream.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
+ (instancetype)streamWithOutputStream:(NSOutputStream *)output;
|
|
|
|
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Initializes a stream to fill in the given data. Data must be sized to fit
|
|
|
|
* or an error will be raised when out of space.
|
|
|
|
*
|
|
|
|
* @param data The data where the stream will be written to.
|
|
|
|
*
|
|
|
|
* @return A newly initialized GPBCodedOutputStream.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (instancetype)initWithData:(NSMutableData *)data;
|
2016-03-07 17:07:03 +00:00
|
|
|
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Initializes a stream to write into the given @c NSOutputStream.
|
|
|
|
*
|
|
|
|
* @param output The output stream where the stream will be written to.
|
|
|
|
*
|
|
|
|
* @return A newly initialized GPBCodedOutputStream.
|
|
|
|
**/
|
2015-06-16 20:45:14 +00:00
|
|
|
- (instancetype)initWithOutputStream:(NSOutputStream *)output;
|
2015-05-01 12:57:16 +00:00
|
|
|
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Flush any buffered data out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)flush;
|
|
|
|
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write the raw byte out.
|
|
|
|
*
|
|
|
|
* @param value The value to write out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeRawByte:(uint8_t)value;
|
|
|
|
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write the tag for the given field number and wire format.
|
|
|
|
*
|
|
|
|
* @param fieldNumber The field number.
|
|
|
|
* @param format The wire format the data for the field will be in.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeTag:(uint32_t)fieldNumber format:(GPBWireFormat)format;
|
|
|
|
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a 32bit value out in little endian format.
|
|
|
|
*
|
|
|
|
* @param value The value to write out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeRawLittleEndian32:(int32_t)value;
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a 64bit value out in little endian format.
|
|
|
|
*
|
|
|
|
* @param value The value to write out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeRawLittleEndian64:(int64_t)value;
|
|
|
|
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a 32bit value out in varint format.
|
|
|
|
*
|
|
|
|
* @param value The value to write out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeRawVarint32:(int32_t)value;
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a 64bit value out in varint format.
|
|
|
|
*
|
|
|
|
* @param value The value to write out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeRawVarint64:(int64_t)value;
|
|
|
|
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a size_t out as a 32bit varint value.
|
|
|
|
*
|
|
|
|
* @note This will truncate 64 bit values to 32.
|
|
|
|
*
|
|
|
|
* @param value The value to write out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeRawVarintSizeTAs32:(size_t)value;
|
|
|
|
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Writes the contents of an NSData out.
|
|
|
|
*
|
|
|
|
* @param data The data to write out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeRawData:(NSData *)data;
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Writes out the given data.
|
|
|
|
*
|
|
|
|
* @param data The data blob to write out.
|
|
|
|
* @param offset The offset into the blob to start writing out.
|
|
|
|
* @param length The number of bytes from the blob to write out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeRawPtr:(const void *)data
|
|
|
|
offset:(size_t)offset
|
|
|
|
length:(size_t)length;
|
|
|
|
|
|
|
|
//%PDDM-EXPAND _WRITE_DECLS()
|
|
|
|
// This block of code is generated, do not edit it directly.
|
2020-01-20 21:47:20 +00:00
|
|
|
// clang-format off
|
2015-05-01 12:57:16 +00:00
|
|
|
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a double for the given field number.
|
|
|
|
*
|
|
|
|
* @param fieldNumber The field number assigned to the value.
|
|
|
|
* @param value The value to write out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeDouble:(int32_t)fieldNumber value:(double)value;
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a packed array of double for the given field number.
|
|
|
|
*
|
|
|
|
* @param fieldNumber The field number assigned to the values.
|
|
|
|
* @param values The values to write out.
|
|
|
|
* @param tag The tag assigned to the values.
|
|
|
|
**/
|
2015-06-08 20:24:57 +00:00
|
|
|
- (void)writeDoubleArray:(int32_t)fieldNumber
|
|
|
|
values:(GPBDoubleArray *)values
|
|
|
|
tag:(uint32_t)tag;
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a double without any tag.
|
|
|
|
*
|
|
|
|
* @param value The value to write out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeDoubleNoTag:(double)value;
|
|
|
|
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a float for the given field number.
|
|
|
|
*
|
|
|
|
* @param fieldNumber The field number assigned to the value.
|
|
|
|
* @param value The value to write out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeFloat:(int32_t)fieldNumber value:(float)value;
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a packed array of float for the given field number.
|
|
|
|
*
|
|
|
|
* @param fieldNumber The field number assigned to the values.
|
|
|
|
* @param values The values to write out.
|
|
|
|
* @param tag The tag assigned to the values.
|
|
|
|
**/
|
2015-06-08 20:24:57 +00:00
|
|
|
- (void)writeFloatArray:(int32_t)fieldNumber
|
|
|
|
values:(GPBFloatArray *)values
|
|
|
|
tag:(uint32_t)tag;
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a float without any tag.
|
|
|
|
*
|
|
|
|
* @param value The value to write out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeFloatNoTag:(float)value;
|
|
|
|
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a uint64_t for the given field number.
|
|
|
|
*
|
|
|
|
* @param fieldNumber The field number assigned to the value.
|
|
|
|
* @param value The value to write out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeUInt64:(int32_t)fieldNumber value:(uint64_t)value;
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a packed array of uint64_t for the given field number.
|
|
|
|
*
|
|
|
|
* @param fieldNumber The field number assigned to the values.
|
|
|
|
* @param values The values to write out.
|
|
|
|
* @param tag The tag assigned to the values.
|
|
|
|
**/
|
2015-06-08 20:24:57 +00:00
|
|
|
- (void)writeUInt64Array:(int32_t)fieldNumber
|
|
|
|
values:(GPBUInt64Array *)values
|
|
|
|
tag:(uint32_t)tag;
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a uint64_t without any tag.
|
|
|
|
*
|
|
|
|
* @param value The value to write out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeUInt64NoTag:(uint64_t)value;
|
|
|
|
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a int64_t for the given field number.
|
|
|
|
*
|
|
|
|
* @param fieldNumber The field number assigned to the value.
|
|
|
|
* @param value The value to write out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeInt64:(int32_t)fieldNumber value:(int64_t)value;
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a packed array of int64_t for the given field number.
|
|
|
|
*
|
|
|
|
* @param fieldNumber The field number assigned to the values.
|
|
|
|
* @param values The values to write out.
|
|
|
|
* @param tag The tag assigned to the values.
|
|
|
|
**/
|
2015-06-08 20:24:57 +00:00
|
|
|
- (void)writeInt64Array:(int32_t)fieldNumber
|
|
|
|
values:(GPBInt64Array *)values
|
|
|
|
tag:(uint32_t)tag;
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a int64_t without any tag.
|
|
|
|
*
|
|
|
|
* @param value The value to write out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeInt64NoTag:(int64_t)value;
|
|
|
|
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a int32_t for the given field number.
|
|
|
|
*
|
|
|
|
* @param fieldNumber The field number assigned to the value.
|
|
|
|
* @param value The value to write out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeInt32:(int32_t)fieldNumber value:(int32_t)value;
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a packed array of int32_t for the given field number.
|
|
|
|
*
|
|
|
|
* @param fieldNumber The field number assigned to the values.
|
|
|
|
* @param values The values to write out.
|
|
|
|
* @param tag The tag assigned to the values.
|
|
|
|
**/
|
2015-06-08 20:24:57 +00:00
|
|
|
- (void)writeInt32Array:(int32_t)fieldNumber
|
|
|
|
values:(GPBInt32Array *)values
|
|
|
|
tag:(uint32_t)tag;
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a int32_t without any tag.
|
|
|
|
*
|
|
|
|
* @param value The value to write out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeInt32NoTag:(int32_t)value;
|
|
|
|
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a uint32_t for the given field number.
|
|
|
|
*
|
|
|
|
* @param fieldNumber The field number assigned to the value.
|
|
|
|
* @param value The value to write out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeUInt32:(int32_t)fieldNumber value:(uint32_t)value;
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a packed array of uint32_t for the given field number.
|
|
|
|
*
|
|
|
|
* @param fieldNumber The field number assigned to the values.
|
|
|
|
* @param values The values to write out.
|
|
|
|
* @param tag The tag assigned to the values.
|
|
|
|
**/
|
2015-06-08 20:24:57 +00:00
|
|
|
- (void)writeUInt32Array:(int32_t)fieldNumber
|
|
|
|
values:(GPBUInt32Array *)values
|
|
|
|
tag:(uint32_t)tag;
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a uint32_t without any tag.
|
|
|
|
*
|
|
|
|
* @param value The value to write out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeUInt32NoTag:(uint32_t)value;
|
|
|
|
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a uint64_t for the given field number.
|
|
|
|
*
|
|
|
|
* @param fieldNumber The field number assigned to the value.
|
|
|
|
* @param value The value to write out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeFixed64:(int32_t)fieldNumber value:(uint64_t)value;
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a packed array of uint64_t for the given field number.
|
|
|
|
*
|
|
|
|
* @param fieldNumber The field number assigned to the values.
|
|
|
|
* @param values The values to write out.
|
|
|
|
* @param tag The tag assigned to the values.
|
|
|
|
**/
|
2015-06-08 20:24:57 +00:00
|
|
|
- (void)writeFixed64Array:(int32_t)fieldNumber
|
|
|
|
values:(GPBUInt64Array *)values
|
|
|
|
tag:(uint32_t)tag;
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a uint64_t without any tag.
|
|
|
|
*
|
|
|
|
* @param value The value to write out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeFixed64NoTag:(uint64_t)value;
|
|
|
|
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a uint32_t for the given field number.
|
|
|
|
*
|
|
|
|
* @param fieldNumber The field number assigned to the value.
|
|
|
|
* @param value The value to write out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeFixed32:(int32_t)fieldNumber value:(uint32_t)value;
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a packed array of uint32_t for the given field number.
|
|
|
|
*
|
|
|
|
* @param fieldNumber The field number assigned to the values.
|
|
|
|
* @param values The values to write out.
|
|
|
|
* @param tag The tag assigned to the values.
|
|
|
|
**/
|
2015-06-08 20:24:57 +00:00
|
|
|
- (void)writeFixed32Array:(int32_t)fieldNumber
|
|
|
|
values:(GPBUInt32Array *)values
|
|
|
|
tag:(uint32_t)tag;
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a uint32_t without any tag.
|
|
|
|
*
|
|
|
|
* @param value The value to write out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeFixed32NoTag:(uint32_t)value;
|
|
|
|
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a int32_t for the given field number.
|
|
|
|
*
|
|
|
|
* @param fieldNumber The field number assigned to the value.
|
|
|
|
* @param value The value to write out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeSInt32:(int32_t)fieldNumber value:(int32_t)value;
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a packed array of int32_t for the given field number.
|
|
|
|
*
|
|
|
|
* @param fieldNumber The field number assigned to the values.
|
|
|
|
* @param values The values to write out.
|
|
|
|
* @param tag The tag assigned to the values.
|
|
|
|
**/
|
2015-06-08 20:24:57 +00:00
|
|
|
- (void)writeSInt32Array:(int32_t)fieldNumber
|
|
|
|
values:(GPBInt32Array *)values
|
|
|
|
tag:(uint32_t)tag;
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a int32_t without any tag.
|
|
|
|
*
|
|
|
|
* @param value The value to write out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeSInt32NoTag:(int32_t)value;
|
|
|
|
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a int64_t for the given field number.
|
|
|
|
*
|
|
|
|
* @param fieldNumber The field number assigned to the value.
|
|
|
|
* @param value The value to write out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeSInt64:(int32_t)fieldNumber value:(int64_t)value;
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a packed array of int64_t for the given field number.
|
|
|
|
*
|
|
|
|
* @param fieldNumber The field number assigned to the values.
|
|
|
|
* @param values The values to write out.
|
|
|
|
* @param tag The tag assigned to the values.
|
|
|
|
**/
|
2015-06-08 20:24:57 +00:00
|
|
|
- (void)writeSInt64Array:(int32_t)fieldNumber
|
|
|
|
values:(GPBInt64Array *)values
|
|
|
|
tag:(uint32_t)tag;
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a int64_t without any tag.
|
|
|
|
*
|
|
|
|
* @param value The value to write out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeSInt64NoTag:(int64_t)value;
|
|
|
|
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a int64_t for the given field number.
|
|
|
|
*
|
|
|
|
* @param fieldNumber The field number assigned to the value.
|
|
|
|
* @param value The value to write out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeSFixed64:(int32_t)fieldNumber value:(int64_t)value;
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a packed array of int64_t for the given field number.
|
|
|
|
*
|
|
|
|
* @param fieldNumber The field number assigned to the values.
|
|
|
|
* @param values The values to write out.
|
|
|
|
* @param tag The tag assigned to the values.
|
|
|
|
**/
|
2015-06-08 20:24:57 +00:00
|
|
|
- (void)writeSFixed64Array:(int32_t)fieldNumber
|
|
|
|
values:(GPBInt64Array *)values
|
|
|
|
tag:(uint32_t)tag;
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a int64_t without any tag.
|
|
|
|
*
|
|
|
|
* @param value The value to write out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeSFixed64NoTag:(int64_t)value;
|
|
|
|
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a int32_t for the given field number.
|
|
|
|
*
|
|
|
|
* @param fieldNumber The field number assigned to the value.
|
|
|
|
* @param value The value to write out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeSFixed32:(int32_t)fieldNumber value:(int32_t)value;
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a packed array of int32_t for the given field number.
|
|
|
|
*
|
|
|
|
* @param fieldNumber The field number assigned to the values.
|
|
|
|
* @param values The values to write out.
|
|
|
|
* @param tag The tag assigned to the values.
|
|
|
|
**/
|
2015-06-08 20:24:57 +00:00
|
|
|
- (void)writeSFixed32Array:(int32_t)fieldNumber
|
|
|
|
values:(GPBInt32Array *)values
|
|
|
|
tag:(uint32_t)tag;
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a int32_t without any tag.
|
|
|
|
*
|
|
|
|
* @param value The value to write out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeSFixed32NoTag:(int32_t)value;
|
|
|
|
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a BOOL for the given field number.
|
|
|
|
*
|
|
|
|
* @param fieldNumber The field number assigned to the value.
|
|
|
|
* @param value The value to write out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeBool:(int32_t)fieldNumber value:(BOOL)value;
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a packed array of BOOL for the given field number.
|
|
|
|
*
|
|
|
|
* @param fieldNumber The field number assigned to the values.
|
|
|
|
* @param values The values to write out.
|
|
|
|
* @param tag The tag assigned to the values.
|
|
|
|
**/
|
2015-06-08 20:24:57 +00:00
|
|
|
- (void)writeBoolArray:(int32_t)fieldNumber
|
|
|
|
values:(GPBBoolArray *)values
|
|
|
|
tag:(uint32_t)tag;
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a BOOL without any tag.
|
|
|
|
*
|
|
|
|
* @param value The value to write out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeBoolNoTag:(BOOL)value;
|
|
|
|
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a int32_t for the given field number.
|
|
|
|
*
|
|
|
|
* @param fieldNumber The field number assigned to the value.
|
|
|
|
* @param value The value to write out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeEnum:(int32_t)fieldNumber value:(int32_t)value;
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a packed array of int32_t for the given field number.
|
|
|
|
*
|
|
|
|
* @param fieldNumber The field number assigned to the values.
|
|
|
|
* @param values The values to write out.
|
|
|
|
* @param tag The tag assigned to the values.
|
|
|
|
**/
|
2015-06-08 20:24:57 +00:00
|
|
|
- (void)writeEnumArray:(int32_t)fieldNumber
|
|
|
|
values:(GPBEnumArray *)values
|
|
|
|
tag:(uint32_t)tag;
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a int32_t without any tag.
|
|
|
|
*
|
|
|
|
* @param value The value to write out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeEnumNoTag:(int32_t)value;
|
|
|
|
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a NSString for the given field number.
|
|
|
|
*
|
|
|
|
* @param fieldNumber The field number assigned to the value.
|
|
|
|
* @param value The value to write out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeString:(int32_t)fieldNumber value:(NSString *)value;
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write an array of NSString for the given field number.
|
|
|
|
*
|
|
|
|
* @param fieldNumber The field number assigned to the values.
|
|
|
|
* @param values The values to write out.
|
|
|
|
**/
|
2020-01-20 21:47:20 +00:00
|
|
|
- (void)writeStringArray:(int32_t)fieldNumber
|
|
|
|
values:(NSArray<NSString*> *)values;
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a NSString without any tag.
|
|
|
|
*
|
|
|
|
* @param value The value to write out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeStringNoTag:(NSString *)value;
|
|
|
|
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a GPBMessage for the given field number.
|
|
|
|
*
|
|
|
|
* @param fieldNumber The field number assigned to the value.
|
|
|
|
* @param value The value to write out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeMessage:(int32_t)fieldNumber value:(GPBMessage *)value;
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write an array of GPBMessage for the given field number.
|
|
|
|
*
|
|
|
|
* @param fieldNumber The field number assigned to the values.
|
|
|
|
* @param values The values to write out.
|
|
|
|
**/
|
2020-01-20 21:47:20 +00:00
|
|
|
- (void)writeMessageArray:(int32_t)fieldNumber
|
|
|
|
values:(NSArray<GPBMessage*> *)values;
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a GPBMessage without any tag.
|
|
|
|
*
|
|
|
|
* @param value The value to write out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeMessageNoTag:(GPBMessage *)value;
|
|
|
|
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a NSData for the given field number.
|
|
|
|
*
|
|
|
|
* @param fieldNumber The field number assigned to the value.
|
|
|
|
* @param value The value to write out.
|
|
|
|
**/
|
2015-06-08 20:24:57 +00:00
|
|
|
- (void)writeBytes:(int32_t)fieldNumber value:(NSData *)value;
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write an array of NSData for the given field number.
|
|
|
|
*
|
|
|
|
* @param fieldNumber The field number assigned to the values.
|
|
|
|
* @param values The values to write out.
|
|
|
|
**/
|
2020-01-20 21:47:20 +00:00
|
|
|
- (void)writeBytesArray:(int32_t)fieldNumber
|
|
|
|
values:(NSArray<NSData*> *)values;
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a NSData without any tag.
|
|
|
|
*
|
|
|
|
* @param value The value to write out.
|
|
|
|
**/
|
2015-06-08 20:24:57 +00:00
|
|
|
- (void)writeBytesNoTag:(NSData *)value;
|
2015-05-01 12:57:16 +00:00
|
|
|
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a GPBMessage for the given field number.
|
|
|
|
*
|
|
|
|
* @param fieldNumber The field number assigned to the value.
|
|
|
|
* @param value The value to write out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeGroup:(int32_t)fieldNumber
|
|
|
|
value:(GPBMessage *)value;
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write an array of GPBMessage for the given field number.
|
|
|
|
*
|
|
|
|
* @param fieldNumber The field number assigned to the values.
|
|
|
|
* @param values The values to write out.
|
|
|
|
**/
|
2020-01-20 21:47:20 +00:00
|
|
|
- (void)writeGroupArray:(int32_t)fieldNumber
|
|
|
|
values:(NSArray<GPBMessage*> *)values;
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a GPBMessage without any tag (but does write the endGroup tag).
|
|
|
|
*
|
|
|
|
* @param fieldNumber The field number assigned to the value.
|
|
|
|
* @param value The value to write out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeGroupNoTag:(int32_t)fieldNumber
|
|
|
|
value:(GPBMessage *)value;
|
|
|
|
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a GPBUnknownFieldSet for the given field number.
|
|
|
|
*
|
|
|
|
* @param fieldNumber The field number assigned to the value.
|
|
|
|
* @param value The value to write out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeUnknownGroup:(int32_t)fieldNumber
|
|
|
|
value:(GPBUnknownFieldSet *)value;
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write an array of GPBUnknownFieldSet for the given field number.
|
|
|
|
*
|
|
|
|
* @param fieldNumber The field number assigned to the values.
|
|
|
|
* @param values The values to write out.
|
|
|
|
**/
|
2020-01-20 21:47:20 +00:00
|
|
|
- (void)writeUnknownGroupArray:(int32_t)fieldNumber
|
|
|
|
values:(NSArray<GPBUnknownFieldSet*> *)values;
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
* Write a GPBUnknownFieldSet without any tag (but does write the endGroup tag).
|
|
|
|
*
|
|
|
|
* @param fieldNumber The field number assigned to the value.
|
|
|
|
* @param value The value to write out.
|
|
|
|
**/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeUnknownGroupNoTag:(int32_t)fieldNumber
|
|
|
|
value:(GPBUnknownFieldSet *)value;
|
|
|
|
|
2020-01-20 21:47:20 +00:00
|
|
|
// clang-format on
|
2015-05-01 12:57:16 +00:00
|
|
|
//%PDDM-EXPAND-END _WRITE_DECLS()
|
|
|
|
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
Write a MessageSet extension field to the stream. For historical reasons,
|
|
|
|
the wire format differs from normal fields.
|
|
|
|
|
|
|
|
@param fieldNumber The extension field number to write out.
|
|
|
|
@param value The message from where to get the extension.
|
|
|
|
*/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeMessageSetExtension:(int32_t)fieldNumber value:(GPBMessage *)value;
|
|
|
|
|
2016-08-08 14:15:02 +00:00
|
|
|
/**
|
|
|
|
Write an unparsed MessageSet extension field to the stream. For historical
|
|
|
|
reasons, the wire format differs from normal fields.
|
|
|
|
|
|
|
|
@param fieldNumber The extension field number to write out.
|
|
|
|
@param value The raw message from where to get the extension.
|
|
|
|
*/
|
2015-05-01 12:57:16 +00:00
|
|
|
- (void)writeRawMessageSetExtension:(int32_t)fieldNumber value:(NSData *)value;
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
2015-06-16 20:45:14 +00:00
|
|
|
NS_ASSUME_NONNULL_END
|
|
|
|
|
2015-05-01 12:57:16 +00:00
|
|
|
// Write methods for types that can be in packed arrays.
|
|
|
|
//%PDDM-DEFINE _WRITE_PACKABLE_DECLS(NAME, ARRAY_TYPE, TYPE)
|
2016-08-08 14:15:02 +00:00
|
|
|
//%/**
|
|
|
|
//% * Write a TYPE for the given field number.
|
|
|
|
//% *
|
|
|
|
//% * @param fieldNumber The field number assigned to the value.
|
|
|
|
//% * @param value The value to write out.
|
|
|
|
//% **/
|
2015-05-01 12:57:16 +00:00
|
|
|
//%- (void)write##NAME:(int32_t)fieldNumber value:(TYPE)value;
|
2016-08-08 14:15:02 +00:00
|
|
|
//%/**
|
|
|
|
//% * Write a packed array of TYPE for the given field number.
|
|
|
|
//% *
|
|
|
|
//% * @param fieldNumber The field number assigned to the values.
|
|
|
|
//% * @param values The values to write out.
|
|
|
|
//% * @param tag The tag assigned to the values.
|
|
|
|
//% **/
|
2015-06-08 20:24:57 +00:00
|
|
|
//%- (void)write##NAME##Array:(int32_t)fieldNumber
|
|
|
|
//% NAME$S values:(GPB##ARRAY_TYPE##Array *)values
|
|
|
|
//% NAME$S tag:(uint32_t)tag;
|
2016-08-08 14:15:02 +00:00
|
|
|
//%/**
|
|
|
|
//% * Write a TYPE without any tag.
|
|
|
|
//% *
|
|
|
|
//% * @param value The value to write out.
|
|
|
|
//% **/
|
2015-05-01 12:57:16 +00:00
|
|
|
//%- (void)write##NAME##NoTag:(TYPE)value;
|
|
|
|
//%
|
|
|
|
// Write methods for types that aren't in packed arrays.
|
|
|
|
//%PDDM-DEFINE _WRITE_UNPACKABLE_DECLS(NAME, TYPE)
|
2016-08-08 14:15:02 +00:00
|
|
|
//%/**
|
|
|
|
//% * Write a TYPE for the given field number.
|
|
|
|
//% *
|
|
|
|
//% * @param fieldNumber The field number assigned to the value.
|
|
|
|
//% * @param value The value to write out.
|
|
|
|
//% **/
|
2015-11-30 19:38:04 +00:00
|
|
|
//%- (void)write##NAME:(int32_t)fieldNumber value:(TYPE *)value;
|
2016-08-08 14:15:02 +00:00
|
|
|
//%/**
|
|
|
|
//% * Write an array of TYPE for the given field number.
|
|
|
|
//% *
|
|
|
|
//% * @param fieldNumber The field number assigned to the values.
|
|
|
|
//% * @param values The values to write out.
|
|
|
|
//% **/
|
2020-01-20 21:47:20 +00:00
|
|
|
//%- (void)write##NAME##Array:(int32_t)fieldNumber
|
|
|
|
//% NAME$S values:(NSArray<##TYPE##*> *)values;
|
2016-08-08 14:15:02 +00:00
|
|
|
//%/**
|
|
|
|
//% * Write a TYPE without any tag.
|
|
|
|
//% *
|
|
|
|
//% * @param value The value to write out.
|
|
|
|
//% **/
|
2015-11-30 19:38:04 +00:00
|
|
|
//%- (void)write##NAME##NoTag:(TYPE *)value;
|
2015-05-01 12:57:16 +00:00
|
|
|
//%
|
|
|
|
// Special write methods for Groups.
|
|
|
|
//%PDDM-DEFINE _WRITE_GROUP_DECLS(NAME, TYPE)
|
2016-08-08 14:15:02 +00:00
|
|
|
//%/**
|
|
|
|
//% * Write a TYPE for the given field number.
|
|
|
|
//% *
|
|
|
|
//% * @param fieldNumber The field number assigned to the value.
|
|
|
|
//% * @param value The value to write out.
|
|
|
|
//% **/
|
2015-05-01 12:57:16 +00:00
|
|
|
//%- (void)write##NAME:(int32_t)fieldNumber
|
2015-11-30 19:38:04 +00:00
|
|
|
//% NAME$S value:(TYPE *)value;
|
2016-08-08 14:15:02 +00:00
|
|
|
//%/**
|
|
|
|
//% * Write an array of TYPE for the given field number.
|
|
|
|
//% *
|
|
|
|
//% * @param fieldNumber The field number assigned to the values.
|
|
|
|
//% * @param values The values to write out.
|
|
|
|
//% **/
|
2020-01-20 21:47:20 +00:00
|
|
|
//%- (void)write##NAME##Array:(int32_t)fieldNumber
|
|
|
|
//% NAME$S values:(NSArray<##TYPE##*> *)values;
|
2016-08-08 14:15:02 +00:00
|
|
|
//%/**
|
|
|
|
//% * Write a TYPE without any tag (but does write the endGroup tag).
|
|
|
|
//% *
|
|
|
|
//% * @param fieldNumber The field number assigned to the value.
|
|
|
|
//% * @param value The value to write out.
|
|
|
|
//% **/
|
2015-05-01 12:57:16 +00:00
|
|
|
//%- (void)write##NAME##NoTag:(int32_t)fieldNumber
|
2015-11-30 19:38:04 +00:00
|
|
|
//% NAME$S value:(TYPE *)value;
|
2015-05-01 12:57:16 +00:00
|
|
|
//%
|
|
|
|
|
|
|
|
// One macro to hide it all up above.
|
|
|
|
//%PDDM-DEFINE _WRITE_DECLS()
|
|
|
|
//%_WRITE_PACKABLE_DECLS(Double, Double, double)
|
|
|
|
//%_WRITE_PACKABLE_DECLS(Float, Float, float)
|
|
|
|
//%_WRITE_PACKABLE_DECLS(UInt64, UInt64, uint64_t)
|
|
|
|
//%_WRITE_PACKABLE_DECLS(Int64, Int64, int64_t)
|
|
|
|
//%_WRITE_PACKABLE_DECLS(Int32, Int32, int32_t)
|
|
|
|
//%_WRITE_PACKABLE_DECLS(UInt32, UInt32, uint32_t)
|
|
|
|
//%_WRITE_PACKABLE_DECLS(Fixed64, UInt64, uint64_t)
|
|
|
|
//%_WRITE_PACKABLE_DECLS(Fixed32, UInt32, uint32_t)
|
|
|
|
//%_WRITE_PACKABLE_DECLS(SInt32, Int32, int32_t)
|
|
|
|
//%_WRITE_PACKABLE_DECLS(SInt64, Int64, int64_t)
|
|
|
|
//%_WRITE_PACKABLE_DECLS(SFixed64, Int64, int64_t)
|
|
|
|
//%_WRITE_PACKABLE_DECLS(SFixed32, Int32, int32_t)
|
|
|
|
//%_WRITE_PACKABLE_DECLS(Bool, Bool, BOOL)
|
|
|
|
//%_WRITE_PACKABLE_DECLS(Enum, Enum, int32_t)
|
2015-11-30 19:38:04 +00:00
|
|
|
//%_WRITE_UNPACKABLE_DECLS(String, NSString)
|
|
|
|
//%_WRITE_UNPACKABLE_DECLS(Message, GPBMessage)
|
|
|
|
//%_WRITE_UNPACKABLE_DECLS(Bytes, NSData)
|
|
|
|
//%_WRITE_GROUP_DECLS(Group, GPBMessage)
|
|
|
|
//%_WRITE_GROUP_DECLS(UnknownGroup, GPBUnknownFieldSet)
|