@@ -37,125 +37,194 @@ NS_ASSUME_NONNULL_BEGIN
37
37
38
38
CF_EXTERN_C_BEGIN
39
39
40
- // / GPBCodedInputStream exception name. Exceptions raised from
41
- // / GPBCodedInputStream contain an underlying error in the userInfo dictionary
42
- // / under the GPBCodedInputStreamUnderlyingErrorKey key.
40
+ /* *
41
+ * @c GPBCodedInputStream exception name. Exceptions raised from
42
+ * @c GPBCodedInputStream contain an underlying error in the userInfo dictionary
43
+ * under the GPBCodedInputStreamUnderlyingErrorKey key.
44
+ **/
43
45
extern NSString *const GPBCodedInputStreamException;
44
46
45
- // / The key under which the underlying NSError from the exception is stored.
47
+ /* * The key under which the underlying NSError from the exception is stored. */
46
48
extern NSString *const GPBCodedInputStreamUnderlyingErrorKey;
47
49
48
- // / NSError domain used for GPBCodedInputStream errors.
50
+ /* * NSError domain used for @c GPBCodedInputStream errors. */
49
51
extern NSString *const GPBCodedInputStreamErrorDomain;
50
52
51
- // / Error code for NSError with GPBCodedInputStreamErrorDomain.
53
+ /* *
54
+ * Error code for NSError with @c GPBCodedInputStreamErrorDomain.
55
+ **/
52
56
typedef NS_ENUM (NSInteger , GPBCodedInputStreamErrorCode) {
53
- // / The size does not fit in the remaining bytes to be read.
57
+ /* * The size does not fit in the remaining bytes to be read. */
54
58
GPBCodedInputStreamErrorInvalidSize = -100 ,
55
- // / Attempted to read beyond the subsection limit.
59
+ /* * Attempted to read beyond the subsection limit. */
56
60
GPBCodedInputStreamErrorSubsectionLimitReached = -101 ,
57
- // / The requested subsection limit is invalid.
61
+ /* * The requested subsection limit is invalid. */
58
62
GPBCodedInputStreamErrorInvalidSubsectionLimit = -102 ,
59
- // / Invalid tag read.
63
+ /* * Invalid tag read. */
60
64
GPBCodedInputStreamErrorInvalidTag = -103 ,
61
- // / Invalid UTF-8 character in a string.
65
+ /* * Invalid UTF-8 character in a string. */
62
66
GPBCodedInputStreamErrorInvalidUTF8 = -104 ,
63
- // / Invalid VarInt read.
67
+ /* * Invalid VarInt read. */
64
68
GPBCodedInputStreamErrorInvalidVarInt = -105 ,
65
- // / The maximum recursion depth of messages was exceeded.
69
+ /* * The maximum recursion depth of messages was exceeded. */
66
70
GPBCodedInputStreamErrorRecursionDepthExceeded = -106 ,
67
71
};
68
72
69
73
CF_EXTERN_C_END
70
74
71
- // / Reads and decodes protocol message fields.
72
- // /
73
- // / The common uses of protocol buffers shouldn't need to use this class.
74
- // / @c GPBMessage's provide a @c +parseFromData:error: and @c
75
- // / +parseFromData:extensionRegistry:error: method that will decode a
76
- // / message for you.
77
- // /
78
- // / @note Subclassing of GPBCodedInputStream is NOT supported.
75
+ /* *
76
+ * Reads and decodes protocol message fields.
77
+ *
78
+ * The common uses of protocol buffers shouldn't need to use this class.
79
+ * @c GPBMessage's provide a @c +parseFromData:error: and
80
+ * @c +parseFromData:extensionRegistry:error: method that will decode a
81
+ * message for you.
82
+ *
83
+ * @note Subclassing of @c GPBCodedInputStream is NOT supported.
84
+ **/
79
85
@interface GPBCodedInputStream : NSObject
80
86
81
- // / Creates a new stream wrapping some data.
87
+ /* *
88
+ * Creates a new stream wrapping some data.
89
+ *
90
+ * @param data The data to wrap inside the stream.
91
+ *
92
+ * @return A newly instanced GPBCodedInputStream.
93
+ **/
82
94
+ (instancetype )streamWithData : (NSData *)data ;
83
95
84
- // / Initializes a stream wrapping some data.
96
+ /* *
97
+ * Initializes a stream wrapping some data.
98
+ *
99
+ * @param data The data to wrap inside the stream.
100
+ *
101
+ * @return A newly initialized GPBCodedInputStream.
102
+ **/
85
103
- (instancetype )initWithData : (NSData *)data ;
86
104
87
- // / Attempt to read a field tag, returning zero if we have reached EOF.
88
- // / Protocol message parsers use this to read tags, since a protocol message
89
- // / may legally end wherever a tag occurs, and zero is not a valid tag number.
105
+ /* *
106
+ * Attempts to read a field tag, returning zero if we have reached EOF.
107
+ * Protocol message parsers use this to read tags, since a protocol message
108
+ * may legally end wherever a tag occurs, and zero is not a valid tag number.
109
+ *
110
+ * @return The field tag, or zero if EOF was reached.
111
+ **/
90
112
- (int32_t )readTag ;
91
113
92
- // / Read and return a double.
114
+ /* *
115
+ * @return A double read from the stream.
116
+ **/
93
117
- (double )readDouble ;
94
- // / Read and return a float.
118
+ /* *
119
+ * @return A float read from the stream.
120
+ **/
95
121
- (float )readFloat ;
96
- // / Read and return a uint64.
122
+ /* *
123
+ * @return A uint64 read from the stream.
124
+ **/
97
125
- (uint64_t )readUInt64 ;
98
- // / Read and return a uint32.
126
+ /* *
127
+ * @return A uint32 read from the stream.
128
+ **/
99
129
- (uint32_t )readUInt32 ;
100
- // / Read and return an int64.
130
+ /* *
131
+ * @return An int64 read from the stream.
132
+ **/
101
133
- (int64_t )readInt64 ;
102
- // / Read and return an int32.
134
+ /* *
135
+ * @return An int32 read from the stream.
136
+ **/
103
137
- (int32_t )readInt32 ;
104
- // / Read and return a fixed64.
138
+ /* *
139
+ * @return A fixed64 read from the stream.
140
+ **/
105
141
- (uint64_t )readFixed64 ;
106
- // / Read and return a fixed32.
142
+ /* *
143
+ * @return A fixed32 read from the stream.
144
+ **/
107
145
- (uint32_t )readFixed32 ;
108
- // / Read and return an enum (int).
146
+ /* *
147
+ * @return An enum read from the stream.
148
+ **/
109
149
- (int32_t )readEnum ;
110
- // / Read and return a sfixed32.
150
+ /* *
151
+ * @return A sfixed32 read from the stream.
152
+ **/
111
153
- (int32_t )readSFixed32 ;
112
- // / Read and return a sfixed64.
154
+ /* *
155
+ * @return A fixed64 read from the stream.
156
+ **/
113
157
- (int64_t )readSFixed64 ;
114
- // / Read and return a sint32.
158
+ /* *
159
+ * @return A sint32 read from the stream.
160
+ **/
115
161
- (int32_t )readSInt32 ;
116
- // / Read and return a sint64.
162
+ /* *
163
+ * @return A sint64 read from the stream.
164
+ **/
117
165
- (int64_t )readSInt64 ;
118
- // / Read and return a boolean.
166
+ /* *
167
+ * @return A boolean read from the stream.
168
+ **/
119
169
- (BOOL )readBool ;
120
- // / Read and return a string.
170
+ /* *
171
+ * @return A string read from the stream.
172
+ **/
121
173
- (NSString *)readString ;
122
- // / Read and return length delimited data.
174
+ /* *
175
+ * @return Data read from the stream.
176
+ **/
123
177
- (NSData *)readBytes ;
124
178
125
- // / Read an embedded message field value from the stream.
126
- // /
127
- // / @param message The message to set fields on as they are read.
128
- // / @param extensionRegistry An optional extension registry to use to lookup
129
- // / extensions for @c message.
179
+ /* *
180
+ * Read an embedded message field value from the stream.
181
+ *
182
+ * @param message The message to set fields on as they are read.
183
+ * @param extensionRegistry An optional extension registry to use to lookup
184
+ * extensions for message.
185
+ **/
130
186
- (void )readMessage : (GPBMessage *)message
131
187
extensionRegistry : (nullable GPBExtensionRegistry *)extensionRegistry ;
132
188
133
- // / Reads and discards a single field, given its tag value.
134
- // /
135
- // / @param tag The tag number of the field to skip.
136
- // /
137
- // / @return NO if the tag is an endgroup tag (in which case nothing is skipped),
138
- // / YES in all other cases.
189
+ /* *
190
+ * Reads and discards a single field, given its tag value.
191
+ *
192
+ * @param tag The tag number of the field to skip.
193
+ *
194
+ * @return NO if the tag is an endgroup tag (in which case nothing is skipped),
195
+ * YES in all other cases.
196
+ **/
139
197
- (BOOL )skipField : (int32_t )tag ;
140
198
141
- // / Reads and discards an entire message. This will read either until EOF
142
- // / or until an endgroup tag, whichever comes first.
199
+ /* *
200
+ * Reads and discards an entire message. This will read either until EOF or
201
+ * until an endgroup tag, whichever comes first.
202
+ **/
143
203
- (void )skipMessage ;
144
204
145
- // / Check to see if the logical end of the stream has been reached.
146
- // /
147
- // / This can return NO when there is no more data, but the current parsing
148
- // / expected more data.
205
+ /* *
206
+ * Check to see if the logical end of the stream has been reached.
207
+ *
208
+ * @note This can return NO when there is no more data, but the current parsing
209
+ * expected more data.
210
+ *
211
+ * @return YES if the logical end of the stream has been reached, NO otherwise.
212
+ **/
149
213
- (BOOL )isAtEnd ;
150
214
151
- // / The offset into the stream.
215
+ /* *
216
+ * @return The offset into the stream.
217
+ **/
152
218
- (size_t )position ;
153
219
154
- // / Verifies that the last call to @c -readTag returned the given tag value.
155
- // / This is used to verify that a nested group ended with the correct end tag.
156
- // / Throws @c NSParseErrorException if value does not match the last tag.
157
- // /
158
- // / @param expected The tag that was expected.
220
+ /* *
221
+ * Verifies that the last call to -readTag returned the given tag value. This
222
+ * is used to verify that a nested group ended with the correct end tag.
223
+ *
224
+ * @exception NSParseErrorException If the value does not match the last tag.
225
+ *
226
+ * @param expected The tag that was expected.
227
+ **/
159
228
- (void )checkLastTagWas : (int32_t )expected ;
160
229
161
230
@end
0 commit comments