mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-10-15 15:16:51 +02:00
Merge pull request #448 from redboltz/replace_unpacked_with_object_handle
Replaced msgpack::unpacked with msgpack::object_handle.
This commit is contained in:
@@ -1003,7 +1003,7 @@ public:
|
||||
* This function is obsolete. Use the reference inteface version of next() function instead of
|
||||
* the pointer interface version.
|
||||
*/
|
||||
bool next(unpacked* result);
|
||||
bool next(object_handle* result);
|
||||
|
||||
/// Unpack one msgpack::object.
|
||||
/**
|
||||
@@ -1019,7 +1019,7 @@ public:
|
||||
* See:
|
||||
* https://github.com/msgpack/msgpack-c/wiki/v1_1_cpp_unpacker#msgpack-controls-a-buffer
|
||||
*/
|
||||
bool next(unpacked& result, bool& referenced);
|
||||
bool next(object_handle& result, bool& referenced);
|
||||
|
||||
/// Unpack one msgpack::object.
|
||||
/**
|
||||
@@ -1033,7 +1033,7 @@ public:
|
||||
* See:
|
||||
* https://github.com/msgpack/msgpack-c/wiki/v1_1_cpp_unpacker#msgpack-controls-a-buffer
|
||||
*/
|
||||
bool next(unpacked& result);
|
||||
bool next(object_handle& result);
|
||||
|
||||
/// Get message size.
|
||||
/**
|
||||
@@ -1281,7 +1281,7 @@ inline void unpacker::buffer_consumed(std::size_t size)
|
||||
m_free -= size;
|
||||
}
|
||||
|
||||
inline bool unpacker::next(unpacked& result, bool& referenced)
|
||||
inline bool unpacker::next(object_handle& result, bool& referenced)
|
||||
{
|
||||
referenced = false;
|
||||
int ret = execute_imp();
|
||||
@@ -1303,13 +1303,13 @@ inline bool unpacker::next(unpacked& result, bool& referenced)
|
||||
}
|
||||
}
|
||||
|
||||
inline bool unpacker::next(unpacked& result)
|
||||
inline bool unpacker::next(object_handle& result)
|
||||
{
|
||||
bool referenced;
|
||||
return next(result, referenced);
|
||||
}
|
||||
|
||||
inline bool unpacker::next(unpacked* result)
|
||||
inline bool unpacker::next(object_handle* result)
|
||||
{
|
||||
return next(*result);
|
||||
}
|
||||
@@ -1461,7 +1461,7 @@ unpack_imp(const char* data, std::size_t len, std::size_t& off,
|
||||
|
||||
// reference version
|
||||
|
||||
inline unpacked unpack(
|
||||
inline object_handle unpack(
|
||||
const char* data, std::size_t len, std::size_t& off, bool& referenced,
|
||||
unpack_reference_func f, void* user_data,
|
||||
unpack_limit const& limit
|
||||
@@ -1477,20 +1477,20 @@ inline unpacked unpack(
|
||||
switch(ret) {
|
||||
case UNPACK_SUCCESS:
|
||||
off = noff;
|
||||
return unpacked(obj, msgpack::move(z));
|
||||
return object_handle(obj, msgpack::move(z));
|
||||
case UNPACK_EXTRA_BYTES:
|
||||
off = noff;
|
||||
return unpacked(obj, msgpack::move(z));
|
||||
return object_handle(obj, msgpack::move(z));
|
||||
case UNPACK_CONTINUE:
|
||||
throw msgpack::insufficient_bytes("insufficient bytes");
|
||||
case UNPACK_PARSE_ERROR:
|
||||
default:
|
||||
throw msgpack::parse_error("parse error");
|
||||
}
|
||||
return unpacked();
|
||||
return object_handle();
|
||||
}
|
||||
|
||||
inline unpacked unpack(
|
||||
inline object_handle unpack(
|
||||
const char* data, std::size_t len, std::size_t& off,
|
||||
unpack_reference_func f, void* user_data,
|
||||
unpack_limit const& limit)
|
||||
@@ -1499,7 +1499,7 @@ inline unpacked unpack(
|
||||
return unpack(data, len, off, referenced, f, user_data, limit);
|
||||
}
|
||||
|
||||
inline unpacked unpack(
|
||||
inline object_handle unpack(
|
||||
const char* data, std::size_t len, bool& referenced,
|
||||
unpack_reference_func f, void* user_data,
|
||||
unpack_limit const& limit)
|
||||
@@ -1508,7 +1508,7 @@ inline unpacked unpack(
|
||||
return unpack(data, len, off, referenced, f, user_data, limit);
|
||||
}
|
||||
|
||||
inline unpacked unpack(
|
||||
inline object_handle unpack(
|
||||
const char* data, std::size_t len,
|
||||
unpack_reference_func f, void* user_data,
|
||||
unpack_limit const& limit)
|
||||
@@ -1519,7 +1519,7 @@ inline unpacked unpack(
|
||||
}
|
||||
|
||||
inline void unpack(
|
||||
unpacked& result,
|
||||
object_handle& result,
|
||||
const char* data, std::size_t len, std::size_t& off, bool& referenced,
|
||||
unpack_reference_func f, void* user_data,
|
||||
unpack_limit const& limit)
|
||||
@@ -1551,7 +1551,7 @@ inline void unpack(
|
||||
}
|
||||
|
||||
inline void unpack(
|
||||
unpacked& result,
|
||||
object_handle& result,
|
||||
const char* data, std::size_t len, std::size_t& off,
|
||||
unpack_reference_func f, void* user_data,
|
||||
unpack_limit const& limit)
|
||||
@@ -1561,7 +1561,7 @@ inline void unpack(
|
||||
}
|
||||
|
||||
inline void unpack(
|
||||
unpacked& result,
|
||||
object_handle& result,
|
||||
const char* data, std::size_t len, bool& referenced,
|
||||
unpack_reference_func f, void* user_data,
|
||||
unpack_limit const& limit)
|
||||
@@ -1571,7 +1571,7 @@ inline void unpack(
|
||||
}
|
||||
|
||||
inline void unpack(
|
||||
unpacked& result,
|
||||
object_handle& result,
|
||||
const char* data, std::size_t len,
|
||||
unpack_reference_func f, void* user_data,
|
||||
unpack_limit const& limit)
|
||||
@@ -1644,7 +1644,7 @@ inline msgpack::object unpack(
|
||||
// obsolete
|
||||
// pointer version
|
||||
inline void unpack(
|
||||
unpacked* result,
|
||||
object_handle* result,
|
||||
const char* data, std::size_t len, std::size_t* off, bool* referenced,
|
||||
unpack_reference_func f, void* user_data,
|
||||
unpack_limit const& limit)
|
||||
|
@@ -218,10 +218,10 @@ class unpacker;
|
||||
* @param user_data This parameter is passed to f.
|
||||
* @param limit The size limit information of msgpack::object.
|
||||
*
|
||||
* @return unpacked object that contains unpacked data.
|
||||
* @return object_handle that contains unpacked data.
|
||||
*
|
||||
*/
|
||||
unpacked unpack(
|
||||
object_handle unpack(
|
||||
const char* data, std::size_t len, std::size_t& off, bool& referenced,
|
||||
unpack_reference_func f = nullptr, void* user_data = nullptr, unpack_limit const& limit = unpack_limit());
|
||||
|
||||
@@ -234,10 +234,10 @@ unpacked unpack(
|
||||
* @param user_data This parameter is passed to f.
|
||||
* @param limit The size limit information of msgpack::object.
|
||||
*
|
||||
* @return unpacked object that contains unpacked data.
|
||||
* @return object_handle that contains unpacked data.
|
||||
*
|
||||
*/
|
||||
unpacked unpack(
|
||||
object_handle unpack(
|
||||
const char* data, std::size_t len, std::size_t& off,
|
||||
unpack_reference_func f = nullptr, void* user_data = nullptr, unpack_limit const& limit = unpack_limit());
|
||||
|
||||
@@ -250,10 +250,10 @@ unpacked unpack(
|
||||
* @param user_data This parameter is passed to f.
|
||||
* @param limit The size limit information of msgpack::object.
|
||||
*
|
||||
* @return unpacked object that contains unpacked data.
|
||||
* @return object_handle that contains unpacked data.
|
||||
*
|
||||
*/
|
||||
unpacked unpack(
|
||||
object_handle unpack(
|
||||
const char* data, std::size_t len, bool& referenced,
|
||||
unpack_reference_func f = nullptr, void* user_data = nullptr, unpack_limit const& limit = unpack_limit());
|
||||
|
||||
@@ -265,17 +265,17 @@ unpacked unpack(
|
||||
* @param user_data This parameter is passed to f.
|
||||
* @param limit The size limit information of msgpack::object.
|
||||
*
|
||||
* @return unpacked object that contains unpacked data.
|
||||
* @return object_handle that contains unpacked data.
|
||||
*
|
||||
*/
|
||||
unpacked unpack(
|
||||
object_handle unpack(
|
||||
const char* data, std::size_t len,
|
||||
unpack_reference_func f = nullptr, void* user_data = nullptr, unpack_limit const& limit = unpack_limit());
|
||||
|
||||
|
||||
/// Unpack msgpack::object from a buffer.
|
||||
/**
|
||||
* @param result The object that contains unpacked data.
|
||||
* @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.
|
||||
@@ -287,13 +287,13 @@ unpacked unpack(
|
||||
*
|
||||
*/
|
||||
void unpack(
|
||||
unpacked& result,
|
||||
object_handle& result,
|
||||
const char* data, std::size_t len, std::size_t& off, bool& referenced,
|
||||
unpack_reference_func f = nullptr, void* user_data = nullptr, unpack_limit const& limit = unpack_limit());
|
||||
|
||||
/// Unpack msgpack::object from a buffer.
|
||||
/**
|
||||
* @param result The object that contains unpacked data.
|
||||
* @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.
|
||||
@@ -304,13 +304,13 @@ void unpack(
|
||||
*
|
||||
*/
|
||||
void unpack(
|
||||
unpacked& result,
|
||||
object_handle& result,
|
||||
const char* data, std::size_t len, std::size_t& off,
|
||||
unpack_reference_func f = nullptr, void* user_data = nullptr, unpack_limit const& limit = unpack_limit());
|
||||
|
||||
/// Unpack msgpack::object from a buffer.
|
||||
/**
|
||||
* @param result The object that contains unpacked data.
|
||||
* @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.
|
||||
@@ -321,13 +321,13 @@ void unpack(
|
||||
*
|
||||
*/
|
||||
void unpack(
|
||||
unpacked& result,
|
||||
object_handle& result,
|
||||
const char* data, std::size_t len, bool& referenced,
|
||||
unpack_reference_func f = nullptr, void* user_data = nullptr, unpack_limit const& limit = unpack_limit());
|
||||
|
||||
/// Unpack msgpack::object from a buffer.
|
||||
/**
|
||||
* @param result The object that contains unpacked data.
|
||||
* @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.
|
||||
@@ -337,7 +337,7 @@ void unpack(
|
||||
*
|
||||
*/
|
||||
void unpack(
|
||||
unpacked& result,
|
||||
object_handle& result,
|
||||
const char* data, std::size_t len,
|
||||
unpack_reference_func f = nullptr, void* user_data = nullptr, unpack_limit const& limit = unpack_limit());
|
||||
|
||||
@@ -416,7 +416,7 @@ msgpack::object unpack(
|
||||
|
||||
/// Unpack msgpack::object from a buffer. [obsolete]
|
||||
/**
|
||||
* @param result The object that contains unpacked data.
|
||||
* @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.
|
||||
@@ -428,7 +428,7 @@ msgpack::object unpack(
|
||||
* This function is obsolete. Use the reference inteface version of unpack functions instead of the pointer interface version.
|
||||
*/
|
||||
void unpack(
|
||||
unpacked* result,
|
||||
object_handle* result,
|
||||
const char* data, std::size_t len, std::size_t* off = nullptr, bool* referenced = nullptr,
|
||||
unpack_reference_func f = nullptr, void* user_data = nullptr, unpack_limit const& limit = unpack_limit());
|
||||
|
||||
|
Reference in New Issue
Block a user