From 815bf0ee25e78f92f73b6cbb57be2bd65e51f199 Mon Sep 17 00:00:00 2001 From: Takatoshi Kondo Date: Mon, 9 Jan 2017 19:10:40 +0900 Subject: [PATCH] Updated v_2_0_cpp_x3_parse (markdown) --- v_2_0_cpp_x3_parse.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/v_2_0_cpp_x3_parse.md b/v_2_0_cpp_x3_parse.md index 5bbb134..6c0f335 100644 --- a/v_2_0_cpp_x3_parse.md +++ b/v_2_0_cpp_x3_parse.md @@ -21,11 +21,18 @@ Define `MSGPACK_USE_X3_PARSE` before including `msgpack.hpp`. It is usually defi ## APIs +### parse ```cpp template inline bool parse(Iterator&& begin, Iterator&& end, Visitor&& vis); ``` +`Visitor` need to satisfy [visitor concept](https://github.com/msgpack/msgpack-c/wiki/v2_0_cpp_visitor). +If `begin` is non-const lvalue, then it will be updated after successfully parsed. + +See an [example](https://github.com/redboltz/msgpack-c/blob/x3_parse/example/x3/parse.cpp). + +### unpack ```cpp template msgpack::object_handle unpack( @@ -54,6 +61,12 @@ msgpack::object unpack( Iterator&& begin, Iterator&& end, unpack_reference_func f = MSGPACK_NULLPTR, void* user_data = MSGPACK_NULLPTR, unpack_limit const& limit = unpack_limit()); +``` + +They are similar to https://github.com/msgpack/msgpack-c/wiki/v2_0_cpp_unpacker#client-controls-a-buffer. The APIs take a pair of iterators instead of data and len. + +See an [example](https://github.com/redboltz/msgpack-c/blob/x3_parse/example/x3/unpack.cpp). + +## Stream parse/unpack -https://github.com/redboltz/msgpack-c/blob/x3_parse/include/msgpack/v2/x3_parse.hpp#L846