Updated v_2_0_cpp_x3_parse (markdown)

Takatoshi Kondo
2017-01-09 19:10:40 +09:00
parent 2fa8dd9a66
commit 815bf0ee25
+14 -1
@@ -21,11 +21,18 @@ Define `MSGPACK_USE_X3_PARSE` before including `msgpack.hpp`. It is usually defi
## APIs
### parse
```cpp
template <typename Iterator, typename Visitor>
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 <typename Iterator>
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