aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/core/src/firebase/firestore/nanopb/reader.h
diff options
context:
space:
mode:
authorGravatar rsgowman <rgowman@google.com>2018-06-25 10:06:35 -0400
committerGravatar GitHub <noreply@github.com>2018-06-25 10:06:35 -0400
commit47ab39aee6330f59263b0a9b2fc36536544651fd (patch)
treeefff1d390bc56c7a7d00628da6d81dca377684be /Firestore/core/src/firebase/firestore/nanopb/reader.h
parent137ce37363d72ac1d643ea9f93bc6e6665367e57 (diff)
Refactor nanopb decoding methods (#1438)
Rather than decoding the type, and then the contents, decode them both at once.
Diffstat (limited to 'Firestore/core/src/firebase/firestore/nanopb/reader.h')
-rw-r--r--Firestore/core/src/firebase/firestore/nanopb/reader.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/Firestore/core/src/firebase/firestore/nanopb/reader.h b/Firestore/core/src/firebase/firestore/nanopb/reader.h
index 7dd7432..76dc3b6 100644
--- a/Firestore/core/src/firebase/firestore/nanopb/reader.h
+++ b/Firestore/core/src/firebase/firestore/nanopb/reader.h
@@ -58,6 +58,16 @@ class Reader {
Tag ReadTag();
/**
+ * Ensures the specified tag is of the specified type. If not, then
+ * Reader::status() will return a non-ok value (with the code set to
+ * FirestoreErrorCode::DataLoss).
+ *
+ * @return Convenience indicator for success. (If false, then status() will
+ * return a non-ok value.)
+ */
+ bool RequireWireType(pb_wire_type_t wire_type, Tag tag);
+
+ /**
* Reads a nanopb message from the input stream.
*
* This essentially wraps calls to nanopb's pb_decode() method. If we didn't