diff options
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/pack.hpp | 4 | ||||
-rw-r--r-- | cpp/unpack.hpp | 16 |
2 files changed, 12 insertions, 8 deletions
diff --git a/cpp/pack.hpp b/cpp/pack.hpp index 52854ac..257ccb6 100644 --- a/cpp/pack.hpp +++ b/cpp/pack.hpp @@ -30,6 +30,7 @@ template <typename Stream> class packer { public: packer(Stream& s); + ~packer(); public: template <typename T> @@ -130,6 +131,9 @@ template <typename Stream> packer<Stream>::packer(Stream& s) : m_stream(s) { } template <typename Stream> +packer<Stream>::~packer() { } + +template <typename Stream> inline packer<Stream>& packer<Stream>::pack_uint8(uint8_t d) { _pack_uint8(m_stream, d); return *this; } diff --git a/cpp/unpack.hpp b/cpp/unpack.hpp index 4e7ccf5..e6d35da 100644 --- a/cpp/unpack.hpp +++ b/cpp/unpack.hpp @@ -128,10 +128,10 @@ private: typedef enum { - MSGPACK_UNPACK_SUCCESS = 2, - MSGPACK_UNPACK_EXTRA_BYTES = 1, - MSGPACK_UNPACK_CONTINUE = 0, - MSGPACK_UNPACK_PARSE_ERROR = -1, + UNPACK_SUCCESS = 2, + UNPACK_EXTRA_BYTES = 1, + UNPACK_CONTINUE = 0, + UNPACK_PARSE_ERROR = -1, } unpack_return; static unpack_return unpack(const char* data, size_t len, size_t* off, @@ -249,20 +249,20 @@ inline object unpack(const char* data, size_t len, zone& z, size_t* off) object result; switch( msgpack::unpack(data, len, off, &z, &result) ) { - case MSGPACK_UNPACK_SUCCESS: + case UNPACK_SUCCESS: return result; - case MSGPACK_UNPACK_EXTRA_BYTES: + case UNPACK_EXTRA_BYTES: if(off) { return result; } else { throw unpack_error("extra bytes"); } - case MSGPACK_UNPACK_CONTINUE: + case UNPACK_CONTINUE: throw unpack_error("insufficient bytes"); - case MSGPACK_UNPACK_PARSE_ERROR: + case UNPACK_PARSE_ERROR: default: throw unpack_error("parse error"); } |