Coverage Report

Created: 2025-08-24 06:56

/src/jsoncons/include/jsoncons_ext/msgpack/msgpack_options.hpp
Line
Count
Source (jump to first uncovered line)
1
// Copyright 2013-2025 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_;
22
protected:
23
47.8k
    virtual ~msgpack_options_common() = default;
24
25
    msgpack_options_common()
26
23.9k
        : max_nesting_depth_(1024)
27
23.9k
    {
28
23.9k
    }
29
30
23.9k
    msgpack_options_common(const msgpack_options_common&) = default;
31
    msgpack_options_common& operator=(const msgpack_options_common&) = default;
32
    msgpack_options_common(msgpack_options_common&&) = default;
33
    msgpack_options_common& operator=(msgpack_options_common&&) = default;
34
public:
35
    int max_nesting_depth() const 
36
15.3M
    {
37
15.3M
        return max_nesting_depth_;
38
15.3M
    }
39
};
40
41
class msgpack_decode_options : public virtual msgpack_options_common
42
{
43
    friend class msgpack_options;
44
public:
45
    msgpack_decode_options()
46
17.4k
    {
47
17.4k
    }
48
};
49
50
class msgpack_encode_options : public virtual msgpack_options_common
51
{
52
    friend class msgpack_options;
53
public:
54
    msgpack_encode_options()
55
6.46k
    {
56
6.46k
    }
Unexecuted instantiation: jsoncons::msgpack::msgpack_encode_options::msgpack_encode_options()
jsoncons::msgpack::msgpack_encode_options::msgpack_encode_options()
Line
Count
Source
55
6.46k
    {
56
6.46k
    }
57
};
58
59
class msgpack_options final : public msgpack_decode_options, public msgpack_encode_options
60
{
61
public:
62
    using msgpack_options_common::max_nesting_depth;
63
64
    msgpack_options& max_nesting_depth(int value)
65
0
    {
66
0
        this->max_nesting_depth_ = value;
67
0
        return *this;
68
0
    }
69
};
70
71
} // namespace msgpack
72
} // namespace jsoncons
73
74
#endif // JSONCONS_EXT_MSGPACK_MSGPACK_OPTIONS_HPP