Skip to content

Commit 36650a0

Browse files
committed
HeaderDoc support in the library and generated sources
- Convert most of the core library headers over to HeaderDoc format. - Switch the generated comments over to HeaderDoc. - Create GPBCodedOutputStream_PackagePrivate and move some things into there that should be more internal.
1 parent f2d3408 commit 36650a0

35 files changed

+1985
-1363
lines changed

objectivec/GPBCodedInputStream.h

+50-16
Original file line numberDiff line numberDiff line change
@@ -35,52 +35,86 @@
3535

3636
NS_ASSUME_NONNULL_BEGIN
3737

38-
// Reads and decodes protocol message fields.
39-
// Subclassing of GPBCodedInputStream is NOT supported.
38+
/// Reads and decodes protocol message fields.
39+
///
40+
/// The common uses of protocol buffers shouldn't need to use this class.
41+
/// @c GPBMessage's provide a @c +parseFromData:error: and @c
42+
/// +parseFromData:extensionRegistry:error: method that will decode a
43+
/// message for you.
44+
///
45+
/// @note Subclassing of GPBCodedInputStream is NOT supported.
4046
@interface GPBCodedInputStream : NSObject
4147

48+
/// Creates a new stream wrapping some data.
4249
+ (instancetype)streamWithData:(NSData *)data;
50+
51+
/// Initializes a stream wrapping some data.
4352
- (instancetype)initWithData:(NSData *)data;
4453

45-
// Attempt to read a field tag, returning zero if we have reached EOF.
46-
// Protocol message parsers use this to read tags, since a protocol message
47-
// may legally end wherever a tag occurs, and zero is not a valid tag number.
54+
/// Attempt to read a field tag, returning zero if we have reached EOF.
55+
/// Protocol message parsers use this to read tags, since a protocol message
56+
/// may legally end wherever a tag occurs, and zero is not a valid tag number.
4857
- (int32_t)readTag;
4958

59+
/// Read and return a double.
5060
- (double)readDouble;
61+
/// Read and return a float.
5162
- (float)readFloat;
63+
/// Read and return a uint64.
5264
- (uint64_t)readUInt64;
65+
/// Read and return a uint32.
5366
- (uint32_t)readUInt32;
67+
/// Read and return an int64.
5468
- (int64_t)readInt64;
69+
/// Read and return an int32.
5570
- (int32_t)readInt32;
71+
/// Read and return a fixed64.
5672
- (uint64_t)readFixed64;
73+
/// Read and return a fixed32.
5774
- (uint32_t)readFixed32;
75+
/// Read and return an enum (int).
5876
- (int32_t)readEnum;
77+
/// Read and return a sfixed32.
5978
- (int32_t)readSFixed32;
79+
/// Read and return a sfixed64.
6080
- (int64_t)readSFixed64;
81+
/// Read and return a sint32.
6182
- (int32_t)readSInt32;
83+
/// Read and return a sint64.
6284
- (int64_t)readSInt64;
85+
/// Read and return a boolean.
6386
- (BOOL)readBool;
87+
/// Read and return a string.
6488
- (NSString *)readString;
89+
/// Read and return length delimited data.
6590
- (NSData *)readBytes;
6691

67-
// Read an embedded message field value from the stream.
92+
/// Read an embedded message field value from the stream.
93+
///
94+
/// @param message The message to set fields on as they are read.
95+
/// @param extensionRegistry An optional extension registry to use to lookup
96+
/// extensions for @message.
6897
- (void)readMessage:(GPBMessage *)message
69-
extensionRegistry:(nullable GPBExtensionRegistry *)extensionRegistry;
98+
extensionRegistry:(nullable GPBExtensionRegistry *)extensionRegistry;
7099

71-
// Reads and discards a single field, given its tag value. Returns NO if the
72-
// tag is an endgroup tag, in which case nothing is skipped. Otherwise,
73-
// returns YES.
100+
/// Reads and discards a single field, given its tag value.
101+
///
102+
/// @param tag The tag number of the field to skip.
103+
///
104+
/// @return NO if the tag is an endgroup tag (in which case nothing is skipped),
105+
/// YES in all other cases.
74106
- (BOOL)skipField:(int32_t)tag;
75107

76-
// Reads and discards an entire message. This will read either until EOF
77-
// or until an endgroup tag, whichever comes first.
108+
/// Reads and discards an entire message. This will read either until EOF
109+
/// or until an endgroup tag, whichever comes first.
78110
- (void)skipMessage;
79111

80-
// Verifies that the last call to readTag() returned the given tag value.
81-
// This is used to verify that a nested group ended with the correct end tag.
82-
// Throws NSParseErrorException if value does not match the last tag.
83-
- (void)checkLastTagWas:(int32_t)value;
112+
/// Verifies that the last call to @c -readTag returned the given tag value.
113+
/// This is used to verify that a nested group ended with the correct end tag.
114+
/// Throws @c NSParseErrorException if value does not match the last tag.
115+
///
116+
/// @param expected The tag that was expected.
117+
- (void)checkLastTagWas:(int32_t)expected;
84118

85119
@end
86120

0 commit comments

Comments
 (0)