summaryrefslogtreecommitdiff
path: root/cpp/unpack.hpp
diff options
context:
space:
mode:
authorfrsyuki <frsyuki@vcore.(none)>2009-02-26 01:27:00 +0900
committerfrsyuki <frsyuki@vcore.(none)>2009-02-26 01:27:00 +0900
commit980bb9cdd08bd3e5a0ff6021a45a1d880691c013 (patch)
treefe2c89f041c2c84e77999d62d0964a9b62385e82 /cpp/unpack.hpp
parent5697b9a15d89a397a53174b9eca2d96bc7ebaef0 (diff)
downloadmsgpack-python-980bb9cdd08bd3e5a0ff6021a45a1d880691c013.tar.gz
add msgpack_unpacker_message_size
Diffstat (limited to 'cpp/unpack.hpp')
-rw-r--r--cpp/unpack.hpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/cpp/unpack.hpp b/cpp/unpack.hpp
index 0b7fe57..e140b36 100644
--- a/cpp/unpack.hpp
+++ b/cpp/unpack.hpp
@@ -67,8 +67,8 @@ public:
/*! 5.3. after release_zone(), re-initialize unpacker */
void reset();
- /*! 6. check if the parsed message size doesn't exceed assumption. */
- size_t parsed_size() const;
+ /*! 6. check if the size of message doesn't exceed assumption. */
+ size_t message_size() const;
// Basic usage of the unpacker is as following:
@@ -112,6 +112,7 @@ public:
public:
// These functions are usable when non-MessagePack message follows after
// MessagePack message.
+ size_t parsed_size() const;
/*! get address of the buffer that is not parsed */
char* nonparsed_buffer();
@@ -218,12 +219,17 @@ inline void unpacker::reset()
msgpack_unpacker_reset(this);
}
+inline size_t unpacker::message_size() const
+{
+ return msgpack_unpacker_message_size(this);
+}
+
+
inline size_t unpacker::parsed_size() const
{
return msgpack_unpacker_parsed_size(this);
}
-
inline char* unpacker::nonparsed_buffer()
{
return buf + off;