MessagePack for C++
|
Parsing class for a stream deserialization. More...
#include <parse.hpp>
Public Member Functions | |
parser (ReferencedBufferHook &hook, std::size_t initial_buffer_size=MSGPACK_UNPACKER_INIT_BUFFER_SIZE) | |
Constructor. More... | |
parser (this_type &&other) | |
this_type & | operator= (this_type &&other) |
~parser () | |
void | reserve_buffer (std::size_t size=MSGPACK_UNPACKER_RESERVE_SIZE) |
Reserve a buffer memory. More... | |
char * | buffer () |
Get buffer pointer. More... | |
std::size_t | buffer_capacity () const |
Get buffer capacity. More... | |
void | buffer_consumed (std::size_t size) |
Notify a buffer consumed information to msgpack::unpacker. More... | |
bool | next () |
Unpack one msgpack::object. More... | |
std::size_t | message_size () const |
Get message size. More... | |
std::size_t | parsed_size () const |
Get parsed message size. More... | |
char * | nonparsed_buffer () |
Get the address that is not parsed in the buffer. More... | |
std::size_t | nonparsed_size () const |
Get the size of the buffer that is not parsed. More... | |
void | skip_nonparsed_buffer (std::size_t size) |
Skip the specified size of non-parsed buffer. More... | |
void | remove_nonparsed_buffer () |
Remove nonparsed buffer and reset the current position as a new start point. More... | |
void | reset () |
parser (const this_type &)=delete | |
this_type & | operator= (const this_type &)=delete |
![]() | |
context (unpack_reference_func f, void *user_data, unpack_limit const &limit) | |
void | init () |
msgpack::object const & | data () const |
unpack_user & | user () |
unpack_user const & | user () const |
int | execute (const char *data, std::size_t len, std::size_t &off) |
context () | |
void | init () |
parse_return | execute (const char *data, std::size_t len, std::size_t &off) |
template<> | |
void | check_ext_size (std::size_t size) |
Protected Member Functions | |
char * | get_raw_buffer () |
Parsing class for a stream deserialization.
|
inline |
Constructor.
referenced | If the unpacked object contains reference of the buffer, then set as true, otherwise false. |
f | A judging function that msgpack::object refer to the buffer. |
user_data | This parameter is passed to f. |
initial_buffer_size | The memory size to allocate when unpacker is constructed. |
limit | The size limit information of msgpack::object. |
|
inline |
|
inline |
|
delete |
|
inline |
Get buffer pointer.
You need to care about the memory is enable between buffer() and buffer() + buffer_capacity() See: https://github.com/msgpack/msgpack-c/wiki/v1_1_cpp_unpacker#msgpack-controls-a-buffer
|
inline |
Get buffer capacity.
See: https://github.com/msgpack/msgpack-c/wiki/v1_1_cpp_unpacker#msgpack-controls-a-buffer
|
inline |
Notify a buffer consumed information to msgpack::unpacker.
size | The size of memory that you consumed. |
After copying the data to the memory that is pointed by buffer(), you need to call the function to notify how many bytes are consumed. Then you can call next() functions.
See: https://github.com/msgpack/msgpack-c/wiki/v1_1_cpp_unpacker#msgpack-controls-a-buffer
|
inlineprotected |
|
inline |
Get message size.
|
inline |
Unpack one msgpack::object.
See: https://github.com/msgpack/msgpack-c/wiki/v1_1_cpp_unpacker#msgpack-controls-a-buffer
|
inline |
Get the address that is not parsed in the buffer.
This function is usable when non-MessagePack message follows after MessagePack message.
|
inline |
Get the size of the buffer that is not parsed.
This function is usable when non-MessagePack message follows after MessagePack message.
|
inline |
|
delete |
|
inline |
Get parsed message size.
This function is usable when non-MessagePack message follows after MessagePack message.
|
inline |
Remove nonparsed buffer and reset the current position as a new start point.
This function is usable when non-MessagePack message follows after MessagePack message.
|
inline |
Reserve a buffer memory.
size | The size of allocating memory. |
After returning this function, buffer_capacity() returns at least 'size'. See: https://github.com/msgpack/msgpack-c/wiki/v1_1_cpp_unpacker#msgpack-controls-a-buffer
|
inline |
|
inline |
Skip the specified size of non-parsed buffer.
size | to skip |
Note that the `size' argument must be smaller than nonparsed_size(). This function is usable when non-MessagePack message follows after MessagePack message.