mirror of
https://github.com/msgpack/msgpack-c
synced 2026-06-08 16:11:40 +00:00
Updated v_2_0_cpp_x3_parse (markdown)
+59
-1
@@ -1 +1,59 @@
|
||||
# Iterator based parser/unpacker using Spirit.X3 (experimental)
|
||||
# Iterator based parser/unpacker using Spirit.X3 (experimental)
|
||||
|
||||
## What is this?
|
||||
It is a new parser using Boost.Spirit.X3(experimental). Boost.Spirit.X3 is experimental feature, so the iterator based parser/unpacker is also an experimental feature.
|
||||
|
||||
Here is the parser code.
|
||||
|
||||
See https://github.com/redboltz/msgpack-c/blob/x3_parse/include/msgpack/v2/x3_parse.hpp
|
||||
|
||||
It is quite small. It is completely separete from existing parser/unpacker.
|
||||
The existing parser/unpacker takes the pointer and the size of buffer, but iterator based unpacker/parser takes begin/end iterator pair.
|
||||
|
||||
## How to use?
|
||||
|
||||
Define `MSGPACK_USE_X3_PARSE` before including `msgpack.hpp`. It is usually defined via a compiler option such as `-DMSGPACK_USE_X3_PARSE`.
|
||||
|
||||
## Requirements
|
||||
|
||||
* Boost 1.61.0 or later
|
||||
* C++14 support.
|
||||
|
||||
## APIs
|
||||
|
||||
```cpp
|
||||
template <typename Iterator, typename Visitor>
|
||||
inline bool parse(Iterator&& begin, Iterator&& end, Visitor&& vis);
|
||||
```
|
||||
|
||||
```cpp
|
||||
template <typename Iterator>
|
||||
msgpack::object_handle unpack(
|
||||
Iterator&& begin, Iterator&& end,
|
||||
bool& referenced,
|
||||
unpack_reference_func f = MSGPACK_NULLPTR, void* user_data = MSGPACK_NULLPTR,
|
||||
unpack_limit const& limit = unpack_limit());
|
||||
|
||||
template <typename Iterator>
|
||||
msgpack::object_handle unpack(
|
||||
Iterator&& begin, Iterator&& end,
|
||||
unpack_reference_func f = MSGPACK_NULLPTR, void* user_data = MSGPACK_NULLPTR,
|
||||
unpack_limit const& limit = unpack_limit());
|
||||
|
||||
template <typename Iterator>
|
||||
msgpack::object unpack(
|
||||
msgpack::zone& z,
|
||||
Iterator&& begin, Iterator&& end,
|
||||
bool& referenced,
|
||||
unpack_reference_func f = MSGPACK_NULLPTR, void* user_data = MSGPACK_NULLPTR,
|
||||
unpack_limit const& limit = unpack_limit());
|
||||
|
||||
template <typename Iterator>
|
||||
msgpack::object unpack(
|
||||
msgpack::zone& z,
|
||||
Iterator&& begin, Iterator&& end,
|
||||
unpack_reference_func f = MSGPACK_NULLPTR, void* user_data = MSGPACK_NULLPTR,
|
||||
unpack_limit const& limit = unpack_limit());
|
||||
|
||||
https://github.com/redboltz/msgpack-c/blob/x3_parse/include/msgpack/v2/x3_parse.hpp#L846
|
||||
|
||||
|
||||
Reference in New Issue
Block a user