aboutsummaryrefslogtreecommitdiff
path: root/objectivec/GPBCodedInputStream.h
diff options
context:
space:
mode:
authorSergio Campamá <kaipi@google.com>2016-10-27 16:06:45 -0400
committerThomas Van Lenten <thomasvl@google.com>2016-10-27 16:06:45 -0400
commitd58b92ae5169ba888e6b5ca91c0ec9814668fa2c (patch)
treedaa0903528532985238071eb4c18056ec354b04f /objectivec/GPBCodedInputStream.h
parent795976ecf536957719403b72a449e0b250d1b4e1 (diff)
downloadprotobuf-d58b92ae5169ba888e6b5ca91c0ec9814668fa2c.tar.gz
protobuf-d58b92ae5169ba888e6b5ca91c0ec9814668fa2c.tar.bz2
protobuf-d58b92ae5169ba888e6b5ca91c0ec9814668fa2c.zip
Adds pushLimit: and popLimit: into GPBCodedInputStream (#2297)
Adds pushLimit: and popLimit: into GPBCodedInputStream
Diffstat (limited to 'objectivec/GPBCodedInputStream.h')
-rw-r--r--objectivec/GPBCodedInputStream.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/objectivec/GPBCodedInputStream.h b/objectivec/GPBCodedInputStream.h
index de27b186..fbe5009c 100644
--- a/objectivec/GPBCodedInputStream.h
+++ b/objectivec/GPBCodedInputStream.h
@@ -218,6 +218,27 @@ CF_EXTERN_C_END
- (size_t)position;
/**
+ * Moves the limit to the given byte offset starting at the current location.
+ *
+ * @exception GPBCodedInputStreamException If the requested bytes exceeed the
+ * current limit.
+ *
+ * @param byteLimit The number of bytes to move the limit, offset to the current
+ * location.
+ *
+ * @return The limit offset before moving the new limit.
+ */
+- (size_t)pushLimit:(size_t)byteLimit;
+
+/**
+ * Moves the limit back to the offset as it was before calling pushLimit:.
+ *
+ * @param oldLimit The number of bytes to move the current limit. Usually this
+ * is the value returned by the pushLimit: method.
+ */
+- (void)popLimit:(size_t)oldLimit;
+
+/**
* Verifies that the last call to -readTag returned the given tag value. This
* is used to verify that a nested group ended with the correct end tag.
*