1 //
2 // MessagePack for C++ deserializing routine
3 //
4 // Copyright (C) 2017 KONDO Takatoshi
5 //
6 //    Distributed under the Boost Software License, Version 1.0.
7 //    (See accompanying file LICENSE_1_0.txt or copy at
8 //    http://www.boost.org/LICENSE_1_0.txt)
9 //
10 #ifndef MSGPACK_V2_NULL_VISITOR_HPP
11 #define MSGPACK_V2_NULL_VISITOR_HPP
12 
13 #include "msgpack/v2/null_visitor_decl.hpp"
14 
15 namespace msgpack {
16 
17 /// @cond
MSGPACK_API_VERSION_NAMESPACE(v2)18 MSGPACK_API_VERSION_NAMESPACE(v2) {
19 /// @endcond
20 
21 struct null_visitor {
22     bool visit_nil() {
23         return true;
24     }
25     bool visit_boolean(bool /*v*/) {
26         return true;
27     }
28     bool visit_positive_integer(uint64_t /*v*/) {
29         return true;
30     }
31     bool visit_negative_integer(int64_t /*v*/) {
32         return true;
33     }
34     bool visit_float32(float /*v*/) {
35         return true;
36     }
37     bool visit_float64(double /*v*/) {
38         return true;
39     }
40     bool visit_str(const char* /*v*/, uint32_t /*size*/) {
41         return true;
42     }
43     bool visit_bin(const char* /*v*/, uint32_t /*size*/) {
44         return true;
45     }
46     bool visit_ext(const char* /*v*/, uint32_t /*size*/) {
47         return true;
48     }
49     bool start_array(uint32_t /*num_elements*/) {
50         return true;
51     }
52     bool start_array_item() {
53         return true;
54     }
55     bool end_array_item() {
56         return true;
57     }
58     bool end_array() {
59         return true;
60     }
61     bool start_map(uint32_t /*num_kv_pairs*/) {
62         return true;
63     }
64     bool start_map_key() {
65         return true;
66     }
67     bool end_map_key() {
68         return true;
69     }
70     bool start_map_value() {
71         return true;
72     }
73     bool end_map_value() {
74         return true;
75     }
76     bool end_map() {
77         return true;
78     }
79     void parse_error(size_t /*parsed_offset*/, size_t /*error_offset*/) {
80     }
81     void insufficient_bytes(size_t /*parsed_offset*/, size_t /*error_offset*/) {
82     }
83     bool referenced() const {
84         return false;
85     }
86     void set_referenced(bool /*referenced*/) {
87     }
88 };
89 
90 /// @cond
91 }  // MSGPACK_API_VERSION_NAMESPACE(v2)
92 /// @endcond
93 
94 }  // namespace msgpack
95 
96 #endif // MSGPACK_V2_NULL_VISITOR_HPP
97