summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorfrsyuki (none) <frsyuki@vcore.>2009-02-25 23:31:53 +0900
committerfrsyuki (none) <frsyuki@vcore.>2009-02-25 23:31:53 +0900
commit6ffee9e54abc54e84a2c81450bb1f607f0637a72 (patch)
treed23e01bca4f615e1028e3e9681e884b9521ebaf6 /cpp
parent43360e378611ae550ece16554311e0de6e3cc046 (diff)
downloadmsgpack-python-6ffee9e54abc54e84a2c81450bb1f607f0637a72.tar.gz
c: msgpack_unpacker_buffered_size; c++: unpacker::buffered_size
Diffstat (limited to 'cpp')
-rw-r--r--cpp/unpack.hpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/cpp/unpack.hpp b/cpp/unpack.hpp
index e6d35da..6e9b641 100644
--- a/cpp/unpack.hpp
+++ b/cpp/unpack.hpp
@@ -43,6 +43,9 @@ public:
~unpacker();
public:
+ /*! 0. check if the buffered size is not exceed the assumption. */
+ size_t buffered_size() const;
+
/*! 1. reserve buffer. at least `size' bytes of capacity will be ready */
void reserve_buffer(size_t size);
@@ -154,6 +157,12 @@ inline unpacker::~unpacker()
msgpack_unpacker_destroy(this);
}
+
+inline size_t unpacker::buffered_size() const
+{
+ return msgpack_unpacker_buffered_size(this);
+}
+
inline void unpacker::reserve_buffer(size_t size)
{
if(!msgpack_unpacker_reserve_buffer(this, size)) {