Updated v2_0_cpp_visitor (markdown)

Takatoshi Kondo
2016-05-26 21:03:44 +09:00
parent 75fe8ba674
commit dd348978c1
+24
@@ -208,3 +208,27 @@ They are similar to unpack APIs.
When you call a parse function, then the parse function callback the visitor that you passed. If parsing process is successfully finished, then the parse function returns true, otherwise returns false. If the visitor's visit function returns false, then the parse function returns false.
You can use visitors with stream interface like an unpacker.
```C++
template <typename VisitorHolder, typename ReferencedBufferHook>
class parser
```
`VisitorHolder` need to have a function named `visitor()` that returns a reference of the visitor object that satisfies the visitor concept.
`parser` has the same public member functions as unpacker except `bool next()`.
`unpacker` has the following member functions named `next`:
```C++
bool next(msgpack::object_handle& result, bool& referenced);
bool next(msgpack::object_handle& result);
```
`parser` has the follwoing member function named `next`
```C++
bool next();
```
When you call `next()` then parse one MessagePack formatted data.