Coverage Report

Created: 2026-04-12 06:45

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/jsoncons/include/jsoncons_ext/msgpack/msgpack_options.hpp
Line
Count
Source
1
// Copyright 2013-2026 Daniel Parker
2
// Distributed under the Boost license, Version 1.0.
3
// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
4
5
// See https://github.com/danielaparker/jsoncons for latest version
6
7
#ifndef JSONCONS_EXT_MSGPACK_MSGPACK_OPTIONS_HPP
8
#define JSONCONS_EXT_MSGPACK_MSGPACK_OPTIONS_HPP
9
10
#include <cwchar>
11
12
namespace jsoncons { 
13
namespace msgpack {
14
15
class msgpack_options;
16
17
class msgpack_options_common
18
{
19
    friend class msgpack_options;
20
21
    int max_nesting_depth_{1024};
22
protected:
23
24.5k
    msgpack_options_common() = default;
24
    msgpack_options_common(const msgpack_options_common&) = default;
25
26
24.5k
    virtual ~msgpack_options_common() = default;
27
28
    msgpack_options_common& operator=(const msgpack_options_common&) = default;
29
public:
30
    int max_nesting_depth() const 
31
24.5k
    {
32
24.5k
        return max_nesting_depth_;
33
24.5k
    }
34
};
35
36
class msgpack_decode_options : public virtual msgpack_options_common
37
{
38
    friend class msgpack_options;
39
public:
40
18.0k
    msgpack_decode_options() = default;
41
    msgpack_decode_options(const msgpack_decode_options& other) = default;
42
protected:
43
    msgpack_decode_options& operator=(const msgpack_decode_options& other) = default;
44
};
45
46
class msgpack_encode_options : public virtual msgpack_options_common
47
{
48
    friend class msgpack_options;
49
public:
50
6.44k
    msgpack_encode_options() = default;
51
    msgpack_encode_options(const msgpack_encode_options& other) = default;
52
protected:
53
    msgpack_encode_options& operator=(const msgpack_encode_options& other) = default;
54
};
55
56
class msgpack_options final : public msgpack_decode_options, public msgpack_encode_options
57
{
58
public:
59
    using msgpack_options_common::max_nesting_depth;
60
61
    msgpack_options() = default;
62
    msgpack_options(const msgpack_options& other) = default;
63
    msgpack_options& operator=(const msgpack_options& other) = default;
64
65
    msgpack_options& max_nesting_depth(int value)
66
0
    {
67
0
        this->max_nesting_depth_ = value;
68
0
        return *this;
69
0
    }
70
};
71
72
} // namespace msgpack
73
} // namespace jsoncons
74
75
#endif // JSONCONS_EXT_MSGPACK_MSGPACK_OPTIONS_HPP