// // MessagePack for C++ deserializing routine // // Copyright (C) 2008-2016 FURUHASHI Sadayuki and KONDO Takatoshi // // 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_V1_UNPACK_DECL_HPP #define MSGPACK_V1_UNPACK_DECL_HPP
/// The type of reference or copy judging function. /** * @param type msgpack data type. * @param size msgpack data size. * @param user_data The user_data that is set by msgpack::unpack functions. * * @return If the data should be referenced, then return true, otherwise (should be copied) false. * * This function is called when unpacking STR, BIN, or EXT. *
*/ typedefbool (*unpack_reference_func)(msgpack::type::object_type type, std::size_t size, void* user_data);
/// Unpacking class for a stream deserialization. class unpacker;
/// Unpack msgpack::object from a buffer. /** * @param data The pointer to the buffer. * @param len The length of the buffer. * @param off The offset position of the buffer. It is read and overwritten. * @param referenced If the unpacked object contains reference of the buffer, then set as true, otherwise false. * @param f A judging function that msgpack::object refer to the buffer. * @param user_data This parameter is passed to f. * @param limit The size limit information of msgpack::object. * * @return object_handle that contains unpacked data. *
*/
object_handle unpack( constchar* data, std::size_t len, std::size_t& off, bool& referenced,
unpack_reference_func f = MSGPACK_NULLPTR, void* user_data = MSGPACK_NULLPTR, unpack_limit const& limit = unpack_limit());
/// Unpack msgpack::object from a buffer. /** * @param data The pointer to the buffer. * @param len The length of the buffer. * @param off The offset position of the buffer. It is read and overwritten. * @param f A judging function that msgpack::object refer to the buffer. * @param user_data This parameter is passed to f. * @param limit The size limit information of msgpack::object. * * @return object_handle that contains unpacked data. *
*/
object_handle unpack( constchar* data, std::size_t len, std::size_t& off,
unpack_reference_func f = MSGPACK_NULLPTR, void* user_data = MSGPACK_NULLPTR, unpack_limit const& limit = unpack_limit());
/// Unpack msgpack::object from a buffer. /** * @param data The pointer to the buffer. * @param len The length of the buffer. * @param referenced If the unpacked object contains reference of the buffer, then set as true, otherwise false. * @param f A judging function that msgpack::object refer to the buffer. * @param user_data This parameter is passed to f. * @param limit The size limit information of msgpack::object. * * @return object_handle that contains unpacked data. *
*/
object_handle unpack( constchar* data, std::size_t len, bool& referenced,
unpack_reference_func f = MSGPACK_NULLPTR, void* user_data = MSGPACK_NULLPTR, unpack_limit const& limit = unpack_limit());
/// Unpack msgpack::object from a buffer. /** * @param data The pointer to the buffer. * @param len The length of the buffer. * @param f A judging function that msgpack::object refer to the buffer. * @param user_data This parameter is passed to f. * @param limit The size limit information of msgpack::object. * * @return object_handle that contains unpacked data. *
*/
object_handle unpack( constchar* data, std::size_t len,
unpack_reference_func f = MSGPACK_NULLPTR, void* user_data = MSGPACK_NULLPTR, unpack_limit const& limit = unpack_limit());
/// Unpack msgpack::object from a buffer. /** * @param result The object_handle that contains unpacked data. * @param data The pointer to the buffer. * @param len The length of the buffer. * @param off The offset position of the buffer. It is read and overwritten. * @param referenced If the unpacked object contains reference of the buffer, then set as true, otherwise false. * @param f A judging function that msgpack::object refer to the buffer. * @param user_data This parameter is passed to f. * @param limit The size limit information of msgpack::object. * *
*/ void unpack(
object_handle& result, constchar* data, std::size_t len, std::size_t& off, bool& referenced,
unpack_reference_func f = MSGPACK_NULLPTR, void* user_data = MSGPACK_NULLPTR, unpack_limit const& limit = unpack_limit());
/// Unpack msgpack::object from a buffer. /** * @param result The object_handle that contains unpacked data. * @param data The pointer to the buffer. * @param len The length of the buffer. * @param off The offset position of the buffer. It is read and overwritten. * @param f A judging function that msgpack::object refer to the buffer. * @param user_data This parameter is passed to f. * @param limit The size limit information of msgpack::object. * *
*/ void unpack(
object_handle& result, constchar* data, std::size_t len, std::size_t& off,
unpack_reference_func f = MSGPACK_NULLPTR, void* user_data = MSGPACK_NULLPTR, unpack_limit const& limit = unpack_limit());
/// Unpack msgpack::object from a buffer. /** * @param result The object_handle that contains unpacked data. * @param data The pointer to the buffer. * @param len The length of the buffer. * @param referenced If the unpacked object contains reference of the buffer, then set as true, otherwise false. * @param f A judging function that msgpack::object refer to the buffer. * @param user_data This parameter is passed to f. * @param limit The size limit information of msgpack::object. * *
*/ void unpack(
object_handle& result, constchar* data, std::size_t len, bool& referenced,
unpack_reference_func f = MSGPACK_NULLPTR, void* user_data = MSGPACK_NULLPTR, unpack_limit const& limit = unpack_limit());
/// Unpack msgpack::object from a buffer. /** * @param result The object_handle that contains unpacked data. * @param data The pointer to the buffer. * @param len The length of the buffer. * @param f A judging function that msgpack::object refer to the buffer. * @param user_data This parameter is passed to f. * @param limit The size limit information of msgpack::object. * *
*/ void unpack(
object_handle& result, constchar* data, std::size_t len,
unpack_reference_func f = MSGPACK_NULLPTR, void* user_data = MSGPACK_NULLPTR, unpack_limit const& limit = unpack_limit());
/// Unpack msgpack::object from a buffer. /** * @param z The msgpack::zone that is used as a memory of unpacked msgpack objects. * @param data The pointer to the buffer. * @param len The length of the buffer. * @param off The offset position of the buffer. It is read and overwritten. * @param referenced If the unpacked object contains reference of the buffer, then set as true, otherwise false. * @param f A judging function that msgpack::object refer to the buffer. * @param user_data This parameter is passed to f. * @param limit The size limit information of msgpack::object. * * @return msgpack::object that contains unpacked data. *
*/
msgpack::object unpack(
msgpack::zone& z, constchar* data, std::size_t len, std::size_t& off, bool& referenced,
unpack_reference_func f = MSGPACK_NULLPTR, void* user_data = MSGPACK_NULLPTR, unpack_limit const& limit = unpack_limit());
/// Unpack msgpack::object from a buffer. /** * @param z The msgpack::zone that is used as a memory of unpacked msgpack objects. * @param data The pointer to the buffer. * @param len The length of the buffer. * @param off The offset position of the buffer. It is read and overwritten. * @param f A judging function that msgpack::object refer to the buffer. * @param user_data This parameter is passed to f. * @param limit The size limit information of msgpack::object. * * @return msgpack::object that contains unpacked data. *
*/
msgpack::object unpack(
msgpack::zone& z, constchar* data, std::size_t len, std::size_t& off,
unpack_reference_func f = MSGPACK_NULLPTR, void* user_data = MSGPACK_NULLPTR, unpack_limit const& limit = unpack_limit());
/// Unpack msgpack::object from a buffer. /** * @param z The msgpack::zone that is used as a memory of unpacked msgpack objects. * @param data The pointer to the buffer. * @param len The length of the buffer. * @param referenced If the unpacked object contains reference of the buffer, then set as true, otherwise false. * @param f A judging function that msgpack::object refer to the buffer. * @param user_data This parameter is passed to f. * @param limit The size limit information of msgpack::object. * * @return msgpack::object that contains unpacked data. *
*/
msgpack::object unpack(
msgpack::zone& z, constchar* data, std::size_t len, bool& referenced,
unpack_reference_func f = MSGPACK_NULLPTR, void* user_data = MSGPACK_NULLPTR, unpack_limit const& limit = unpack_limit());
/// Unpack msgpack::object from a buffer. /** * @param z The msgpack::zone that is used as a memory of unpacked msgpack objects. * @param data The pointer to the buffer. * @param len The length of the buffer. * @param f A judging function that msgpack::object refer to the buffer. * @param user_data This parameter is passed to f. * @param limit The size limit information of msgpack::object. * * @return msgpack::object that contains unpacked data. *
*/
msgpack::object unpack(
msgpack::zone& z, constchar* data, std::size_t len,
unpack_reference_func f = MSGPACK_NULLPTR, void* user_data = MSGPACK_NULLPTR, unpack_limit const& limit = unpack_limit());
/// Unpack msgpack::object from a buffer. [obsolete] /** * @param result The object_handle that contains unpacked data. * @param data The pointer to the buffer. * @param len The length of the buffer. * @param off The offset position of the buffer. It is read and overwritten. * @param referenced If the unpacked object contains reference of the buffer, then set as true, otherwise false. * @param f A judging function that msgpack::object refer to the buffer. * @param user_data This parameter is passed to f. * @param limit The size limit information of msgpack::object. * * This function is obsolete. Use the reference inteface version of unpack functions instead of the pointer interface version.
*/ void unpack(
object_handle* result, constchar* data, std::size_t len, std::size_t* off = MSGPACK_NULLPTR, bool* referenced = MSGPACK_NULLPTR,
unpack_reference_func f = MSGPACK_NULLPTR, void* user_data = MSGPACK_NULLPTR, unpack_limit const& limit = unpack_limit());
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 und die Messung sind noch experimentell.