diff options
author | frsyuki <frsyuki@5a5092ae-2292-43ba-b2d5-dcab9c1a2731> | 2009-02-15 09:10:01 +0000 |
---|---|---|
committer | frsyuki <frsyuki@5a5092ae-2292-43ba-b2d5-dcab9c1a2731> | 2009-02-15 09:10:01 +0000 |
commit | cbf2be8db4f6bc18e1ec3002534da06774561a4d (patch) | |
tree | 24853e9732c0e86f2d43814b0467e72e10ee50f9 /cpp/unpack.hpp | |
parent | e582fa34c7f1246d27cce5a2333e0f954cbed251 (diff) | |
download | msgpack-python-cbf2be8db4f6bc18e1ec3002534da06774561a4d.tar.gz |
c++ binding: remove unpacker::parsed_size() API
git-svn-id: file:///Users/frsyuki/project/msgpack-git/svn/x@93 5a5092ae-2292-43ba-b2d5-dcab9c1a2731
Diffstat (limited to 'cpp/unpack.hpp')
-rw-r--r-- | cpp/unpack.hpp | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/cpp/unpack.hpp b/cpp/unpack.hpp index cba1963..fe20fc7 100644 --- a/cpp/unpack.hpp +++ b/cpp/unpack.hpp @@ -109,23 +109,19 @@ public: public: // These functions are usable when non-MessagePack message follows after // MessagePack message. - // Note that there are no parsed buffer when execute() returned true. - /*! get address of buffer that is not parsed */ + /*! get address of the buffer that is not parsed */ char* nonparsed_buffer(); size_t nonparsed_size() const; - /*! get the number of bytes that is already parsed */ - size_t parsed_size() const; + /*! skip specified size of non-parsed buffer, leaving the buffer */ + // Note that the `len' argument must be smaller than nonparsed_size() + void skip_nonparsed_buffer(size_t len); /*! remove unparsed buffer from unpacker */ // Note that reset() leaves non-parsed buffer. void remove_nonparsed_buffer(); - /*! skip specified size of non-parsed buffer, leaving the buffer */ - // Note the size must be smaller than nonparsed_size() - void skip_nonparsed_buffer(size_t len); - private: char* m_buffer; size_t m_used; @@ -174,15 +170,12 @@ inline char* unpacker::nonparsed_buffer() inline size_t unpacker::nonparsed_size() const { return m_used - m_off; } -inline size_t unpacker::parsed_size() const - { return m_off; } +inline void unpacker::skip_nonparsed_buffer(size_t len) + { m_off += len; } inline void unpacker::remove_nonparsed_buffer() { m_used = m_off; } -inline void unpacker::skip_nonparsed_buffer(size_t len) - { m_off += len; } - inline object unpack(const char* data, size_t len, zone& z, size_t* off = NULL) { |