/* * MessagePack for C unpacking routine * * Copyright (C) 2008-2009 FURUHASHI Sadayuki * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt)
*/ #ifndef MSGPACK_UNPACKER_H #define MSGPACK_UNPACKER_H
/** * Initializes a streaming deserializer. * The initialized deserializer must be destroyed by msgpack_unpacker_destroy(msgpack_unpacker*).
*/
MSGPACK_DLLEXPORT bool msgpack_unpacker_init(msgpack_unpacker* mpac, size_t initial_buffer_size);
/** * Destroys a streaming deserializer initialized by msgpack_unpacker_init(msgpack_unpacker*, size_t).
*/
MSGPACK_DLLEXPORT void msgpack_unpacker_destroy(msgpack_unpacker* mpac);
/** * Creates a streaming deserializer. * The created deserializer must be destroyed by msgpack_unpacker_free(msgpack_unpacker*).
*/
MSGPACK_DLLEXPORT
msgpack_unpacker* msgpack_unpacker_new(size_t initial_buffer_size);
/** * Frees a streaming deserializer created by msgpack_unpacker_new(size_t).
*/
MSGPACK_DLLEXPORT void msgpack_unpacker_free(msgpack_unpacker* mpac);
/** * Reserves free space of the internal buffer. * Use this function to fill the internal buffer with * msgpack_unpacker_buffer(msgpack_unpacker*), * msgpack_unpacker_buffer_capacity(const msgpack_unpacker*) and * msgpack_unpacker_buffer_consumed(msgpack_unpacker*).
*/ staticinlinebool msgpack_unpacker_reserve_buffer(msgpack_unpacker* mpac, size_t size);
/** * Gets pointer to the free space of the internal buffer. * Use this function to fill the internal buffer with * msgpack_unpacker_reserve_buffer(msgpack_unpacker*, size_t), * msgpack_unpacker_buffer_capacity(const msgpack_unpacker*) and * msgpack_unpacker_buffer_consumed(msgpack_unpacker*).
*/ staticinlinechar* msgpack_unpacker_buffer(msgpack_unpacker* mpac);
/** * Gets size of the free space of the internal buffer. * Use this function to fill the internal buffer with * msgpack_unpacker_reserve_buffer(msgpack_unpacker*, size_t), * msgpack_unpacker_buffer(const msgpack_unpacker*) and * msgpack_unpacker_buffer_consumed(msgpack_unpacker*).
*/ staticinline size_t msgpack_unpacker_buffer_capacity(const msgpack_unpacker* mpac);
/** * Notifies the deserializer that the internal buffer filled. * Use this function to fill the internal buffer with * msgpack_unpacker_reserve_buffer(msgpack_unpacker*, size_t), * msgpack_unpacker_buffer(msgpack_unpacker*) and * msgpack_unpacker_buffer_capacity(const msgpack_unpacker*).
*/ staticinlinevoid msgpack_unpacker_buffer_consumed(msgpack_unpacker* mpac, size_t size);
/** * Deserializes one object. * Returns true if it successes. Otherwise false is returned. * @param pac pointer to an initialized msgpack_unpacked object.
*/
MSGPACK_DLLEXPORT
msgpack_unpack_return msgpack_unpacker_next(msgpack_unpacker* mpac, msgpack_unpacked* pac);
/** * Deserializes one object and set the number of parsed bytes involved. * Returns true if it successes. Otherwise false is returned. * @param mpac pointer to an initialized msgpack_unpacker object. * @param result pointer to an initialized msgpack_unpacked object. * @param p_bytes pointer to variable that will be set with the number of parsed bytes.
*/
MSGPACK_DLLEXPORT
msgpack_unpack_return msgpack_unpacker_next_with_size(msgpack_unpacker* mpac,
msgpack_unpacked* result,
size_t *p_bytes);
/** * Initializes a msgpack_unpacked object. * The initialized object must be destroyed by msgpack_unpacked_destroy(msgpack_unpacker*). * Use the object with msgpack_unpacker_next(msgpack_unpacker*, msgpack_unpacked*) or * msgpack_unpack_next(msgpack_unpacked*, const char*, size_t, size_t*).
*/ staticinlinevoid msgpack_unpacked_init(msgpack_unpacked* result);
/** * Destroys a streaming deserializer initialized by msgpack_unpacked().
*/ staticinlinevoid msgpack_unpacked_destroy(msgpack_unpacked* result);
/** * Releases the memory zone from msgpack_unpacked object. * The released zone must be freed by msgpack_zone_free(msgpack_zone*).
*/ staticinline msgpack_zone* msgpack_unpacked_release_zone(msgpack_unpacked* result);
MSGPACK_DLLEXPORT int msgpack_unpacker_execute(msgpack_unpacker* mpac);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.