bloaty/third_party/protobuf/objectivec/GPBCodedOutputStream.h
Go to the documentation of this file.
1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2008 Google Inc. All rights reserved.
3 // https://developers.google.com/protocol-buffers/
4 //
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are
7 // met:
8 //
9 // * Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer.
11 // * Redistributions in binary form must reproduce the above
12 // copyright notice, this list of conditions and the following disclaimer
13 // in the documentation and/or other materials provided with the
14 // distribution.
15 // * Neither the name of Google Inc. nor the names of its
16 // contributors may be used to endorse or promote products derived from
17 // this software without specific prior written permission.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31 #import <Foundation/Foundation.h>
32 
33 #import "GPBRuntimeTypes.h"
34 #import "GPBWireFormat.h"
35 
36 @class GPBBoolArray;
37 @class GPBDoubleArray;
38 @class GPBEnumArray;
39 @class GPBFloatArray;
40 @class GPBMessage;
41 @class GPBInt32Array;
42 @class GPBInt64Array;
43 @class GPBUInt32Array;
44 @class GPBUInt64Array;
45 @class GPBUnknownFieldSet;
46 
47 NS_ASSUME_NONNULL_BEGIN
48 
52 extern NSString *const GPBCodedOutputStreamException_OutOfSpace;
53 extern NSString *const GPBCodedOutputStreamException_WriteFailed;
54 
66 @interface GPBCodedOutputStream : NSObject
67 
76 + (instancetype)streamWithData:(NSMutableData *)data;
77 
85 + (instancetype)streamWithOutputStream:(NSOutputStream *)output;
86 
95 - (instancetype)initWithData:(NSMutableData *)data;
96 
104 - (instancetype)initWithOutputStream:(NSOutputStream *)output;
105 
109 - (void)flush;
110 
116 - (void)writeRawByte:(uint8_t)value;
117 
124 - (void)writeTag:(uint32_t)fieldNumber format:(GPBWireFormat)format;
125 
131 - (void)writeRawLittleEndian32:(int32_t)value;
137 - (void)writeRawLittleEndian64:(int64_t)value;
138 
144 - (void)writeRawVarint32:(int32_t)value;
150 - (void)writeRawVarint64:(int64_t)value;
151 
159 - (void)writeRawVarintSizeTAs32:(size_t)value;
160 
166 - (void)writeRawData:(NSData *)data;
174 - (void)writeRawPtr:(const void *)data
175  offset:(size_t)offset
176  length:(size_t)length;
177 
178 //%PDDM-EXPAND _WRITE_DECLS()
179 // This block of code is generated, do not edit it directly.
180 
187 - (void)writeDouble:(int32_t)fieldNumber value:(double)value;
195 - (void)writeDoubleArray:(int32_t)fieldNumber
196  values:(GPBDoubleArray *)values
197  tag:(uint32_t)tag;
203 - (void)writeDoubleNoTag:(double)value;
204 
211 - (void)writeFloat:(int32_t)fieldNumber value:(float)value;
219 - (void)writeFloatArray:(int32_t)fieldNumber
220  values:(GPBFloatArray *)values
221  tag:(uint32_t)tag;
227 - (void)writeFloatNoTag:(float)value;
228 
235 - (void)writeUInt64:(int32_t)fieldNumber value:(uint64_t)value;
243 - (void)writeUInt64Array:(int32_t)fieldNumber
244  values:(GPBUInt64Array *)values
245  tag:(uint32_t)tag;
251 - (void)writeUInt64NoTag:(uint64_t)value;
252 
259 - (void)writeInt64:(int32_t)fieldNumber value:(int64_t)value;
267 - (void)writeInt64Array:(int32_t)fieldNumber
268  values:(GPBInt64Array *)values
269  tag:(uint32_t)tag;
275 - (void)writeInt64NoTag:(int64_t)value;
276 
283 - (void)writeInt32:(int32_t)fieldNumber value:(int32_t)value;
291 - (void)writeInt32Array:(int32_t)fieldNumber
292  values:(GPBInt32Array *)values
293  tag:(uint32_t)tag;
299 - (void)writeInt32NoTag:(int32_t)value;
300 
307 - (void)writeUInt32:(int32_t)fieldNumber value:(uint32_t)value;
315 - (void)writeUInt32Array:(int32_t)fieldNumber
316  values:(GPBUInt32Array *)values
317  tag:(uint32_t)tag;
323 - (void)writeUInt32NoTag:(uint32_t)value;
324 
331 - (void)writeFixed64:(int32_t)fieldNumber value:(uint64_t)value;
339 - (void)writeFixed64Array:(int32_t)fieldNumber
340  values:(GPBUInt64Array *)values
341  tag:(uint32_t)tag;
347 - (void)writeFixed64NoTag:(uint64_t)value;
348 
355 - (void)writeFixed32:(int32_t)fieldNumber value:(uint32_t)value;
363 - (void)writeFixed32Array:(int32_t)fieldNumber
364  values:(GPBUInt32Array *)values
365  tag:(uint32_t)tag;
371 - (void)writeFixed32NoTag:(uint32_t)value;
372 
379 - (void)writeSInt32:(int32_t)fieldNumber value:(int32_t)value;
387 - (void)writeSInt32Array:(int32_t)fieldNumber
388  values:(GPBInt32Array *)values
389  tag:(uint32_t)tag;
395 - (void)writeSInt32NoTag:(int32_t)value;
396 
403 - (void)writeSInt64:(int32_t)fieldNumber value:(int64_t)value;
411 - (void)writeSInt64Array:(int32_t)fieldNumber
412  values:(GPBInt64Array *)values
413  tag:(uint32_t)tag;
419 - (void)writeSInt64NoTag:(int64_t)value;
420 
427 - (void)writeSFixed64:(int32_t)fieldNumber value:(int64_t)value;
435 - (void)writeSFixed64Array:(int32_t)fieldNumber
436  values:(GPBInt64Array *)values
437  tag:(uint32_t)tag;
443 - (void)writeSFixed64NoTag:(int64_t)value;
444 
451 - (void)writeSFixed32:(int32_t)fieldNumber value:(int32_t)value;
459 - (void)writeSFixed32Array:(int32_t)fieldNumber
460  values:(GPBInt32Array *)values
461  tag:(uint32_t)tag;
467 - (void)writeSFixed32NoTag:(int32_t)value;
468 
475 - (void)writeBool:(int32_t)fieldNumber value:(BOOL)value;
483 - (void)writeBoolArray:(int32_t)fieldNumber
484  values:(GPBBoolArray *)values
485  tag:(uint32_t)tag;
491 - (void)writeBoolNoTag:(BOOL)value;
492 
499 - (void)writeEnum:(int32_t)fieldNumber value:(int32_t)value;
507 - (void)writeEnumArray:(int32_t)fieldNumber
508  values:(GPBEnumArray *)values
509  tag:(uint32_t)tag;
515 - (void)writeEnumNoTag:(int32_t)value;
516 
523 - (void)writeString:(int32_t)fieldNumber value:(NSString *)value;
530 - (void)writeStringArray:(int32_t)fieldNumber values:(NSArray<NSString*> *)values;
536 - (void)writeStringNoTag:(NSString *)value;
537 
544 - (void)writeMessage:(int32_t)fieldNumber value:(GPBMessage *)value;
551 - (void)writeMessageArray:(int32_t)fieldNumber values:(NSArray<GPBMessage*> *)values;
557 - (void)writeMessageNoTag:(GPBMessage *)value;
558 
565 - (void)writeBytes:(int32_t)fieldNumber value:(NSData *)value;
572 - (void)writeBytesArray:(int32_t)fieldNumber values:(NSArray<NSData*> *)values;
578 - (void)writeBytesNoTag:(NSData *)value;
579 
586 - (void)writeGroup:(int32_t)fieldNumber
587  value:(GPBMessage *)value;
594 - (void)writeGroupArray:(int32_t)fieldNumber values:(NSArray<GPBMessage*> *)values;
601 - (void)writeGroupNoTag:(int32_t)fieldNumber
602  value:(GPBMessage *)value;
603 
610 - (void)writeUnknownGroup:(int32_t)fieldNumber
611  value:(GPBUnknownFieldSet *)value;
618 - (void)writeUnknownGroupArray:(int32_t)fieldNumber values:(NSArray<GPBUnknownFieldSet*> *)values;
625 - (void)writeUnknownGroupNoTag:(int32_t)fieldNumber
626  value:(GPBUnknownFieldSet *)value;
627 
628 //%PDDM-EXPAND-END _WRITE_DECLS()
629 
637 - (void)writeMessageSetExtension:(int32_t)fieldNumber value:(GPBMessage *)value;
638 
646 - (void)writeRawMessageSetExtension:(int32_t)fieldNumber value:(NSData *)value;
647 
648 @end
649 
650 NS_ASSUME_NONNULL_END
651 
652 // Write methods for types that can be in packed arrays.
653 //%PDDM-DEFINE _WRITE_PACKABLE_DECLS(NAME, ARRAY_TYPE, TYPE)
654 //%/**
655 //% * Write a TYPE for the given field number.
656 //% *
657 //% * @param fieldNumber The field number assigned to the value.
658 //% * @param value The value to write out.
659 //% **/
660 //%- (void)write##NAME:(int32_t)fieldNumber value:(TYPE)value;
661 //%/**
662 //% * Write a packed array of TYPE for the given field number.
663 //% *
664 //% * @param fieldNumber The field number assigned to the values.
665 //% * @param values The values to write out.
666 //% * @param tag The tag assigned to the values.
667 //% **/
668 //%- (void)write##NAME##Array:(int32_t)fieldNumber
669 //% NAME$S values:(GPB##ARRAY_TYPE##Array *)values
670 //% NAME$S tag:(uint32_t)tag;
671 //%/**
672 //% * Write a TYPE without any tag.
673 //% *
674 //% * @param value The value to write out.
675 //% **/
676 //%- (void)write##NAME##NoTag:(TYPE)value;
677 //%
678 // Write methods for types that aren't in packed arrays.
679 //%PDDM-DEFINE _WRITE_UNPACKABLE_DECLS(NAME, TYPE)
680 //%/**
681 //% * Write a TYPE for the given field number.
682 //% *
683 //% * @param fieldNumber The field number assigned to the value.
684 //% * @param value The value to write out.
685 //% **/
686 //%- (void)write##NAME:(int32_t)fieldNumber value:(TYPE *)value;
687 //%/**
688 //% * Write an array of TYPE for the given field number.
689 //% *
690 //% * @param fieldNumber The field number assigned to the values.
691 //% * @param values The values to write out.
692 //% **/
693 //%- (void)write##NAME##Array:(int32_t)fieldNumber values:(NSArray<##TYPE##*> *)values;
694 //%/**
695 //% * Write a TYPE without any tag.
696 //% *
697 //% * @param value The value to write out.
698 //% **/
699 //%- (void)write##NAME##NoTag:(TYPE *)value;
700 //%
701 // Special write methods for Groups.
702 //%PDDM-DEFINE _WRITE_GROUP_DECLS(NAME, TYPE)
703 //%/**
704 //% * Write a TYPE for the given field number.
705 //% *
706 //% * @param fieldNumber The field number assigned to the value.
707 //% * @param value The value to write out.
708 //% **/
709 //%- (void)write##NAME:(int32_t)fieldNumber
710 //% NAME$S value:(TYPE *)value;
711 //%/**
712 //% * Write an array of TYPE for the given field number.
713 //% *
714 //% * @param fieldNumber The field number assigned to the values.
715 //% * @param values The values to write out.
716 //% **/
717 //%- (void)write##NAME##Array:(int32_t)fieldNumber values:(NSArray<##TYPE##*> *)values;
718 //%/**
719 //% * Write a TYPE without any tag (but does write the endGroup tag).
720 //% *
721 //% * @param fieldNumber The field number assigned to the value.
722 //% * @param value The value to write out.
723 //% **/
724 //%- (void)write##NAME##NoTag:(int32_t)fieldNumber
725 //% NAME$S value:(TYPE *)value;
726 //%
727 
728 // One macro to hide it all up above.
729 //%PDDM-DEFINE _WRITE_DECLS()
730 //%_WRITE_PACKABLE_DECLS(Double, Double, double)
731 //%_WRITE_PACKABLE_DECLS(Float, Float, float)
732 //%_WRITE_PACKABLE_DECLS(UInt64, UInt64, uint64_t)
733 //%_WRITE_PACKABLE_DECLS(Int64, Int64, int64_t)
734 //%_WRITE_PACKABLE_DECLS(Int32, Int32, int32_t)
735 //%_WRITE_PACKABLE_DECLS(UInt32, UInt32, uint32_t)
736 //%_WRITE_PACKABLE_DECLS(Fixed64, UInt64, uint64_t)
737 //%_WRITE_PACKABLE_DECLS(Fixed32, UInt32, uint32_t)
738 //%_WRITE_PACKABLE_DECLS(SInt32, Int32, int32_t)
739 //%_WRITE_PACKABLE_DECLS(SInt64, Int64, int64_t)
740 //%_WRITE_PACKABLE_DECLS(SFixed64, Int64, int64_t)
741 //%_WRITE_PACKABLE_DECLS(SFixed32, Int32, int32_t)
742 //%_WRITE_PACKABLE_DECLS(Bool, Bool, BOOL)
743 //%_WRITE_PACKABLE_DECLS(Enum, Enum, int32_t)
744 //%_WRITE_UNPACKABLE_DECLS(String, NSString)
745 //%_WRITE_UNPACKABLE_DECLS(Message, GPBMessage)
746 //%_WRITE_UNPACKABLE_DECLS(Bytes, NSData)
747 //%_WRITE_GROUP_DECLS(Group, GPBMessage)
748 //%_WRITE_GROUP_DECLS(UnknownGroup, GPBUnknownFieldSet)
GPBInt64Array
Definition: bloaty/third_party/protobuf/objectivec/GPBArray.h:392
GPBBoolArray
Definition: bloaty/third_party/protobuf/objectivec/GPBArray.h:1080
Json::writeString
std::string JSON_API writeString(StreamWriter::Factory const &factory, Value const &root)
Write into stringstream, then return string, for convenience. A StreamWriter will be created from the...
Definition: bloaty/third_party/protobuf/conformance/third_party/jsoncpp/jsoncpp.cpp:5169
const
#define const
Definition: bloaty/third_party/zlib/zconf.h:230
GPBCodedOutputStreamException_WriteFailed
NSString *const GPBCodedOutputStreamException_WriteFailed
uint8_t
unsigned char uint8_t
Definition: stdint-msvc2008.h:78
BOOL
int BOOL
Definition: undname.c:46
uint32_t
unsigned int uint32_t
Definition: stdint-msvc2008.h:80
int64_t
signed __int64 int64_t
Definition: stdint-msvc2008.h:89
GPBEnumArray
Definition: bloaty/third_party/protobuf/objectivec/GPBArray.h:1252
uint64_t
unsigned __int64 uint64_t
Definition: stdint-msvc2008.h:90
GPBFloatArray
Definition: bloaty/third_party/protobuf/objectivec/GPBArray.h:736
GPBUInt32Array
Definition: bloaty/third_party/protobuf/objectivec/GPBArray.h:220
GPBRuntimeTypes.h
GPBCodedOutputStream
Definition: bloaty/third_party/protobuf/objectivec/GPBCodedOutputStream.h:66
GPBCodedOutputStreamException_OutOfSpace
NS_ASSUME_NONNULL_BEGIN NSString *const GPBCodedOutputStreamException_OutOfSpace
GPBWireFormat.h
GPBDoubleArray
Definition: bloaty/third_party/protobuf/objectivec/GPBArray.h:908
GPBMessage
Definition: bloaty/third_party/protobuf/objectivec/GPBMessage.h:83
GPBUInt64Array
Definition: bloaty/third_party/protobuf/objectivec/GPBArray.h:564
-[GPBCodedOutputStream flush]
void flush()
GPBUnknownFieldSet
Definition: bloaty/third_party/protobuf/objectivec/GPBUnknownFieldSet.h:43
GPBWireFormat
GPBWireFormat
Definition: bloaty/third_party/protobuf/objectivec/GPBWireFormat.h:37
GPBInt32Array
Definition: bloaty/third_party/protobuf/objectivec/GPBArray.h:48
int32_t
signed int int32_t
Definition: stdint-msvc2008.h:77


grpc
Author(s):
autogenerated on Fri May 16 2025 02:58:43