/bitcoin/src/univalue/include/univalue.h
Line | Count | Source |
1 | | // Copyright 2014 BitPay Inc. |
2 | | // Copyright 2015 Bitcoin Core Developers |
3 | | // Distributed under the MIT software license, see the accompanying |
4 | | // file COPYING or https://opensource.org/licenses/mit-license.php. |
5 | | |
6 | | #ifndef BITCOIN_UNIVALUE_INCLUDE_UNIVALUE_H |
7 | | #define BITCOIN_UNIVALUE_INCLUDE_UNIVALUE_H |
8 | | |
9 | | #include <charconv> |
10 | | #include <cstddef> |
11 | | #include <cstdint> |
12 | | #include <map> |
13 | | #include <stdexcept> |
14 | | #include <string> |
15 | | #include <string_view> |
16 | | #include <system_error> |
17 | | #include <type_traits> |
18 | | #include <utility> |
19 | | #include <vector> |
20 | | |
21 | | // NOLINTNEXTLINE(misc-no-recursion) |
22 | | class UniValue { |
23 | | public: |
24 | | enum VType { VNULL, VOBJ, VARR, VSTR, VNUM, VBOOL, }; |
25 | | |
26 | | class type_error : public std::runtime_error |
27 | | { |
28 | | using std::runtime_error::runtime_error; |
29 | | }; |
30 | | |
31 | 29.9M | UniValue() { typ = VNULL; } |
32 | 21.8M | UniValue(UniValue::VType type, std::string str = {}) : typ{type}, val{std::move(str)} {} |
33 | | template <typename Ref, typename T = std::remove_cv_t<std::remove_reference_t<Ref>>, |
34 | | std::enable_if_t<std::is_floating_point_v<T> || // setFloat |
35 | | std::is_same_v<bool, T> || // setBool |
36 | | std::is_signed_v<T> || std::is_unsigned_v<T> || // setInt |
37 | | std::is_constructible_v<std::string, T>, // setStr |
38 | | bool> = true> |
39 | | UniValue(Ref&& val) |
40 | 9.13M | { |
41 | 9.13M | if constexpr (std::is_floating_point_v<T>) { |
42 | 44.3k | setFloat(val); |
43 | 4.38M | } else if constexpr (std::is_same_v<bool, T>) { |
44 | 4.38M | setBool(val); |
45 | 4.38M | } else if constexpr (std::is_signed_v<T>) { |
46 | 881k | setInt(int64_t{val}); |
47 | 881k | } else if constexpr (std::is_unsigned_v<T>) { |
48 | 55.4k | setInt(uint64_t{val}); |
49 | 3.76M | } else { |
50 | 3.76M | setStr(std::string{std::forward<Ref>(val)}); |
51 | 3.76M | } |
52 | 9.13M | } _ZN8UniValueC2IKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_TnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS9_Esr3stdE11is_signed_vIS9_Esr3stdE13is_unsigned_vIS9_Esr3stdE18is_constructible_vIS6_S9_EEbE4typeELb1EEEOT_ Line | Count | Source | 40 | 255k | { | 41 | | if constexpr (std::is_floating_point_v<T>) { | 42 | | setFloat(val); | 43 | | } else if constexpr (std::is_same_v<bool, T>) { | 44 | | setBool(val); | 45 | | } else if constexpr (std::is_signed_v<T>) { | 46 | | setInt(int64_t{val}); | 47 | | } else if constexpr (std::is_unsigned_v<T>) { | 48 | | setInt(uint64_t{val}); | 49 | 255k | } else { | 50 | 255k | setStr(std::string{std::forward<Ref>(val)}); | 51 | 255k | } | 52 | 255k | } |
_ZN8UniValueC2INSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_TnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS8_Esr3stdE11is_signed_vIS8_Esr3stdE13is_unsigned_vIS8_Esr3stdE18is_constructible_vIS6_S8_EEbE4typeELb1EEEOT_ Line | Count | Source | 40 | 221k | { | 41 | | if constexpr (std::is_floating_point_v<T>) { | 42 | | setFloat(val); | 43 | | } else if constexpr (std::is_same_v<bool, T>) { | 44 | | setBool(val); | 45 | | } else if constexpr (std::is_signed_v<T>) { | 46 | | setInt(int64_t{val}); | 47 | | } else if constexpr (std::is_unsigned_v<T>) { | 48 | | setInt(uint64_t{val}); | 49 | 221k | } else { | 50 | 221k | setStr(std::string{std::forward<Ref>(val)}); | 51 | 221k | } | 52 | 221k | } |
_ZN8UniValueC2IRiiTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS3_Esr3stdE11is_signed_vIS3_Esr3stdE13is_unsigned_vIS3_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES3_EEbE4typeELb1EEEOT_ Line | Count | Source | 40 | 4.78k | { | 41 | | if constexpr (std::is_floating_point_v<T>) { | 42 | | setFloat(val); | 43 | | } else if constexpr (std::is_same_v<bool, T>) { | 44 | | setBool(val); | 45 | 4.78k | } else if constexpr (std::is_signed_v<T>) { | 46 | 4.78k | setInt(int64_t{val}); | 47 | | } else if constexpr (std::is_unsigned_v<T>) { | 48 | | setInt(uint64_t{val}); | 49 | | } else { | 50 | | setStr(std::string{std::forward<Ref>(val)}); | 51 | | } | 52 | 4.78k | } |
Unexecuted instantiation: _ZN8UniValueC2IRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_TnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS9_Esr3stdE11is_signed_vIS9_Esr3stdE13is_unsigned_vIS9_Esr3stdE18is_constructible_vIS6_S9_EEbE4typeELb1EEEOT_ _ZN8UniValueC2IiiTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS2_Esr3stdE11is_signed_vIS2_Esr3stdE13is_unsigned_vIS2_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES2_EEbE4typeELb1EEEOT_ Line | Count | Source | 40 | 776k | { | 41 | | if constexpr (std::is_floating_point_v<T>) { | 42 | | setFloat(val); | 43 | | } else if constexpr (std::is_same_v<bool, T>) { | 44 | | setBool(val); | 45 | 776k | } else if constexpr (std::is_signed_v<T>) { | 46 | 776k | setInt(int64_t{val}); | 47 | | } else if constexpr (std::is_unsigned_v<T>) { | 48 | | setInt(uint64_t{val}); | 49 | | } else { | 50 | | setStr(std::string{std::forward<Ref>(val)}); | 51 | | } | 52 | 776k | } |
Unexecuted instantiation: _ZN8UniValueC2IRKllTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS4_Esr3stdE11is_signed_vIS4_Esr3stdE13is_unsigned_vIS4_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_EEbE4typeELb1EEEOT_ Unexecuted instantiation: _ZN8UniValueC2IRllTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS3_Esr3stdE11is_signed_vIS3_Esr3stdE13is_unsigned_vIS3_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES3_EEbE4typeELb1EEEOT_ _ZN8UniValueC2ImmTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS2_Esr3stdE11is_signed_vIS2_Esr3stdE13is_unsigned_vIS2_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES2_EEbE4typeELb1EEEOT_ Line | Count | Source | 40 | 11.0k | { | 41 | | if constexpr (std::is_floating_point_v<T>) { | 42 | | setFloat(val); | 43 | | } else if constexpr (std::is_same_v<bool, T>) { | 44 | | setBool(val); | 45 | | } else if constexpr (std::is_signed_v<T>) { | 46 | | setInt(int64_t{val}); | 47 | 11.0k | } else if constexpr (std::is_unsigned_v<T>) { | 48 | 11.0k | setInt(uint64_t{val}); | 49 | | } else { | 50 | | setStr(std::string{std::forward<Ref>(val)}); | 51 | | } | 52 | 11.0k | } |
_ZN8UniValueC2IbbTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS2_Esr3stdE11is_signed_vIS2_Esr3stdE13is_unsigned_vIS2_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES2_EEbE4typeELb1EEEOT_ Line | Count | Source | 40 | 4.38M | { | 41 | | if constexpr (std::is_floating_point_v<T>) { | 42 | | setFloat(val); | 43 | 4.38M | } else if constexpr (std::is_same_v<bool, T>) { | 44 | 4.38M | setBool(val); | 45 | | } else if constexpr (std::is_signed_v<T>) { | 46 | | setInt(int64_t{val}); | 47 | | } else if constexpr (std::is_unsigned_v<T>) { | 48 | | setInt(uint64_t{val}); | 49 | | } else { | 50 | | setStr(std::string{std::forward<Ref>(val)}); | 51 | | } | 52 | 4.38M | } |
_ZN8UniValueC2IRA18_KcA18_cTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS6_Esr3stdE11is_signed_vIS6_Esr3stdE13is_unsigned_vIS6_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_EEbE4typeELb1EEEOT_ Line | Count | Source | 40 | 22.1k | { | 41 | | if constexpr (std::is_floating_point_v<T>) { | 42 | | setFloat(val); | 43 | | } else if constexpr (std::is_same_v<bool, T>) { | 44 | | setBool(val); | 45 | | } else if constexpr (std::is_signed_v<T>) { | 46 | | setInt(int64_t{val}); | 47 | | } else if constexpr (std::is_unsigned_v<T>) { | 48 | | setInt(uint64_t{val}); | 49 | 22.1k | } else { | 50 | 22.1k | setStr(std::string{std::forward<Ref>(val)}); | 51 | 22.1k | } | 52 | 22.1k | } |
Unexecuted instantiation: _ZN8UniValueC2IRbbTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS3_Esr3stdE11is_signed_vIS3_Esr3stdE13is_unsigned_vIS3_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES3_EEbE4typeELb1EEEOT_ _ZN8UniValueC2IRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_TnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbSA_Esr3stdE11is_signed_vISA_Esr3stdE13is_unsigned_vISA_Esr3stdE18is_constructible_vIS6_SA_EEbE4typeELb1EEEOT_ Line | Count | Source | 40 | 171k | { | 41 | | if constexpr (std::is_floating_point_v<T>) { | 42 | | setFloat(val); | 43 | | } else if constexpr (std::is_same_v<bool, T>) { | 44 | | setBool(val); | 45 | | } else if constexpr (std::is_signed_v<T>) { | 46 | | setInt(int64_t{val}); | 47 | | } else if constexpr (std::is_unsigned_v<T>) { | 48 | | setInt(uint64_t{val}); | 49 | 171k | } else { | 50 | 171k | setStr(std::string{std::forward<Ref>(val)}); | 51 | 171k | } | 52 | 171k | } |
_ZN8UniValueC2IRA6_KcA6_cTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS6_Esr3stdE11is_signed_vIS6_Esr3stdE13is_unsigned_vIS6_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_EEbE4typeELb1EEEOT_ Line | Count | Source | 40 | 244k | { | 41 | | if constexpr (std::is_floating_point_v<T>) { | 42 | | setFloat(val); | 43 | | } else if constexpr (std::is_same_v<bool, T>) { | 44 | | setBool(val); | 45 | | } else if constexpr (std::is_signed_v<T>) { | 46 | | setInt(int64_t{val}); | 47 | | } else if constexpr (std::is_unsigned_v<T>) { | 48 | | setInt(uint64_t{val}); | 49 | 244k | } else { | 50 | 244k | setStr(std::string{std::forward<Ref>(val)}); | 51 | 244k | } | 52 | 244k | } |
Unexecuted instantiation: _ZN8UniValueC2IRA8_KcA8_cTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS6_Esr3stdE11is_signed_vIS6_Esr3stdE13is_unsigned_vIS6_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_EEbE4typeELb1EEEOT_ _ZN8UniValueC2IRA1_KcA1_cTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS6_Esr3stdE11is_signed_vIS6_Esr3stdE13is_unsigned_vIS6_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_EEbE4typeELb1EEEOT_ Line | Count | Source | 40 | 66.5k | { | 41 | | if constexpr (std::is_floating_point_v<T>) { | 42 | | setFloat(val); | 43 | | } else if constexpr (std::is_same_v<bool, T>) { | 44 | | setBool(val); | 45 | | } else if constexpr (std::is_signed_v<T>) { | 46 | | setInt(int64_t{val}); | 47 | | } else if constexpr (std::is_unsigned_v<T>) { | 48 | | setInt(uint64_t{val}); | 49 | 66.5k | } else { | 50 | 66.5k | setStr(std::string{std::forward<Ref>(val)}); | 51 | 66.5k | } | 52 | 66.5k | } |
_ZN8UniValueC2IRKiiTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS4_Esr3stdE11is_signed_vIS4_Esr3stdE13is_unsigned_vIS4_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_EEbE4typeELb1EEEOT_ Line | Count | Source | 40 | 77.6k | { | 41 | | if constexpr (std::is_floating_point_v<T>) { | 42 | | setFloat(val); | 43 | | } else if constexpr (std::is_same_v<bool, T>) { | 44 | | setBool(val); | 45 | 77.6k | } else if constexpr (std::is_signed_v<T>) { | 46 | 77.6k | setInt(int64_t{val}); | 47 | | } else if constexpr (std::is_unsigned_v<T>) { | 48 | | setInt(uint64_t{val}); | 49 | | } else { | 50 | | setStr(std::string{std::forward<Ref>(val)}); | 51 | | } | 52 | 77.6k | } |
Unexecuted instantiation: _ZN8UniValueC2IRKjjTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS4_Esr3stdE11is_signed_vIS4_Esr3stdE13is_unsigned_vIS4_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_EEbE4typeELb1EEEOT_ _ZN8UniValueC2IllTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS2_Esr3stdE11is_signed_vIS2_Esr3stdE13is_unsigned_vIS2_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES2_EEbE4typeELb1EEEOT_ Line | Count | Source | 40 | 22.1k | { | 41 | | if constexpr (std::is_floating_point_v<T>) { | 42 | | setFloat(val); | 43 | | } else if constexpr (std::is_same_v<bool, T>) { | 44 | | setBool(val); | 45 | 22.1k | } else if constexpr (std::is_signed_v<T>) { | 46 | 22.1k | setInt(int64_t{val}); | 47 | | } else if constexpr (std::is_unsigned_v<T>) { | 48 | | setInt(uint64_t{val}); | 49 | | } else { | 50 | | setStr(std::string{std::forward<Ref>(val)}); | 51 | | } | 52 | 22.1k | } |
_ZN8UniValueC2IddTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS2_Esr3stdE11is_signed_vIS2_Esr3stdE13is_unsigned_vIS2_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES2_EEbE4typeELb1EEEOT_ Line | Count | Source | 40 | 44.3k | { | 41 | 44.3k | if constexpr (std::is_floating_point_v<T>) { | 42 | 44.3k | setFloat(val); | 43 | | } else if constexpr (std::is_same_v<bool, T>) { | 44 | | setBool(val); | 45 | | } else if constexpr (std::is_signed_v<T>) { | 46 | | setInt(int64_t{val}); | 47 | | } else if constexpr (std::is_unsigned_v<T>) { | 48 | | setInt(uint64_t{val}); | 49 | | } else { | 50 | | setStr(std::string{std::forward<Ref>(val)}); | 51 | | } | 52 | 44.3k | } |
_ZN8UniValueC2IRKmmTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS4_Esr3stdE11is_signed_vIS4_Esr3stdE13is_unsigned_vIS4_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_EEbE4typeELb1EEEOT_ Line | Count | Source | 40 | 44.3k | { | 41 | | if constexpr (std::is_floating_point_v<T>) { | 42 | | setFloat(val); | 43 | | } else if constexpr (std::is_same_v<bool, T>) { | 44 | | setBool(val); | 45 | | } else if constexpr (std::is_signed_v<T>) { | 46 | | setInt(int64_t{val}); | 47 | 44.3k | } else if constexpr (std::is_unsigned_v<T>) { | 48 | 44.3k | setInt(uint64_t{val}); | 49 | | } else { | 50 | | setStr(std::string{std::forward<Ref>(val)}); | 51 | | } | 52 | 44.3k | } |
Unexecuted instantiation: _ZN8UniValueC2IRKbbTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS4_Esr3stdE11is_signed_vIS4_Esr3stdE13is_unsigned_vIS4_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_EEbE4typeELb1EEEOT_ _ZN8UniValueC2IRA26_KcA26_cTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS6_Esr3stdE11is_signed_vIS6_Esr3stdE13is_unsigned_vIS6_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_EEbE4typeELb1EEEOT_ Line | Count | Source | 40 | 22.1k | { | 41 | | if constexpr (std::is_floating_point_v<T>) { | 42 | | setFloat(val); | 43 | | } else if constexpr (std::is_same_v<bool, T>) { | 44 | | setBool(val); | 45 | | } else if constexpr (std::is_signed_v<T>) { | 46 | | setInt(int64_t{val}); | 47 | | } else if constexpr (std::is_unsigned_v<T>) { | 48 | | setInt(uint64_t{val}); | 49 | 22.1k | } else { | 50 | 22.1k | setStr(std::string{std::forward<Ref>(val)}); | 51 | 22.1k | } | 52 | 22.1k | } |
_ZN8UniValueC2IRA7_KcA7_cTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS6_Esr3stdE11is_signed_vIS6_Esr3stdE13is_unsigned_vIS6_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_EEbE4typeELb1EEEOT_ Line | Count | Source | 40 | 22.1k | { | 41 | | if constexpr (std::is_floating_point_v<T>) { | 42 | | setFloat(val); | 43 | | } else if constexpr (std::is_same_v<bool, T>) { | 44 | | setBool(val); | 45 | | } else if constexpr (std::is_signed_v<T>) { | 46 | | setInt(int64_t{val}); | 47 | | } else if constexpr (std::is_unsigned_v<T>) { | 48 | | setInt(uint64_t{val}); | 49 | 22.1k | } else { | 50 | 22.1k | setStr(std::string{std::forward<Ref>(val)}); | 51 | 22.1k | } | 52 | 22.1k | } |
Unexecuted instantiation: _ZN8UniValueC2IRjjTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS3_Esr3stdE11is_signed_vIS3_Esr3stdE13is_unsigned_vIS3_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES3_EEbE4typeELb1EEEOT_ _ZN8UniValueC2IRA5_KcA5_cTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS6_Esr3stdE11is_signed_vIS6_Esr3stdE13is_unsigned_vIS6_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_EEbE4typeELb1EEEOT_ Line | Count | Source | 40 | 88.7k | { | 41 | | if constexpr (std::is_floating_point_v<T>) { | 42 | | setFloat(val); | 43 | | } else if constexpr (std::is_same_v<bool, T>) { | 44 | | setBool(val); | 45 | | } else if constexpr (std::is_signed_v<T>) { | 46 | | setInt(int64_t{val}); | 47 | | } else if constexpr (std::is_unsigned_v<T>) { | 48 | | setInt(uint64_t{val}); | 49 | 88.7k | } else { | 50 | 88.7k | setStr(std::string{std::forward<Ref>(val)}); | 51 | 88.7k | } | 52 | 88.7k | } |
Unexecuted instantiation: _ZN8UniValueC2IRmmTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS3_Esr3stdE11is_signed_vIS3_Esr3stdE13is_unsigned_vIS3_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES3_EEbE4typeELb1EEEOT_ _ZN8UniValueC2IRA11_KcA11_cTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS6_Esr3stdE11is_signed_vIS6_Esr3stdE13is_unsigned_vIS6_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_EEbE4typeELb1EEEOT_ Line | Count | Source | 40 | 66.5k | { | 41 | | if constexpr (std::is_floating_point_v<T>) { | 42 | | setFloat(val); | 43 | | } else if constexpr (std::is_same_v<bool, T>) { | 44 | | setBool(val); | 45 | | } else if constexpr (std::is_signed_v<T>) { | 46 | | setInt(int64_t{val}); | 47 | | } else if constexpr (std::is_unsigned_v<T>) { | 48 | | setInt(uint64_t{val}); | 49 | 66.5k | } else { | 50 | 66.5k | setStr(std::string{std::forward<Ref>(val)}); | 51 | 66.5k | } | 52 | 66.5k | } |
Unexecuted instantiation: _ZN8UniValueC2IRA38_KcA38_cTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS6_Esr3stdE11is_signed_vIS6_Esr3stdE13is_unsigned_vIS6_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_EEbE4typeELb1EEEOT_ Unexecuted instantiation: _ZN8UniValueC2IRddTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS3_Esr3stdE11is_signed_vIS3_Esr3stdE13is_unsigned_vIS3_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES3_EEbE4typeELb1EEEOT_ Unexecuted instantiation: _ZN8UniValueC2IRA60_KcA60_cTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS6_Esr3stdE11is_signed_vIS6_Esr3stdE13is_unsigned_vIS6_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_EEbE4typeELb1EEEOT_ Unexecuted instantiation: _ZN8UniValueC2IRA17_KcA17_cTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS6_Esr3stdE11is_signed_vIS6_Esr3stdE13is_unsigned_vIS6_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_EEbE4typeELb1EEEOT_ Unexecuted instantiation: _ZN8UniValueC2IRA15_KcA15_cTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS6_Esr3stdE11is_signed_vIS6_Esr3stdE13is_unsigned_vIS6_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_EEbE4typeELb1EEEOT_ Unexecuted instantiation: _ZN8UniValueC2IjjTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS2_Esr3stdE11is_signed_vIS2_Esr3stdE13is_unsigned_vIS2_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES2_EEbE4typeELb1EEEOT_ _ZN8UniValueC2IRA12_KcA12_cTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS6_Esr3stdE11is_signed_vIS6_Esr3stdE13is_unsigned_vIS6_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_EEbE4typeELb1EEEOT_ Line | Count | Source | 40 | 66.5k | { | 41 | | if constexpr (std::is_floating_point_v<T>) { | 42 | | setFloat(val); | 43 | | } else if constexpr (std::is_same_v<bool, T>) { | 44 | | setBool(val); | 45 | | } else if constexpr (std::is_signed_v<T>) { | 46 | | setInt(int64_t{val}); | 47 | | } else if constexpr (std::is_unsigned_v<T>) { | 48 | | setInt(uint64_t{val}); | 49 | 66.5k | } else { | 50 | 66.5k | setStr(std::string{std::forward<Ref>(val)}); | 51 | 66.5k | } | 52 | 66.5k | } |
Unexecuted instantiation: _ZN8UniValueC2IRA10_KcA10_cTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS6_Esr3stdE11is_signed_vIS6_Esr3stdE13is_unsigned_vIS6_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_EEbE4typeELb1EEEOT_ Unexecuted instantiation: _ZN8UniValueC2IRA23_KcA23_cTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS6_Esr3stdE11is_signed_vIS6_Esr3stdE13is_unsigned_vIS6_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_EEbE4typeELb1EEEOT_ _ZN8UniValueC2IRA30_KcA30_cTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS6_Esr3stdE11is_signed_vIS6_Esr3stdE13is_unsigned_vIS6_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_EEbE4typeELb1EEEOT_ Line | Count | Source | 40 | 44.3k | { | 41 | | if constexpr (std::is_floating_point_v<T>) { | 42 | | setFloat(val); | 43 | | } else if constexpr (std::is_same_v<bool, T>) { | 44 | | setBool(val); | 45 | | } else if constexpr (std::is_signed_v<T>) { | 46 | | setInt(int64_t{val}); | 47 | | } else if constexpr (std::is_unsigned_v<T>) { | 48 | | setInt(uint64_t{val}); | 49 | 44.3k | } else { | 50 | 44.3k | setStr(std::string{std::forward<Ref>(val)}); | 51 | 44.3k | } | 52 | 44.3k | } |
Unexecuted instantiation: _ZN8UniValueC2IRA9_KcA9_cTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS6_Esr3stdE11is_signed_vIS6_Esr3stdE13is_unsigned_vIS6_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_EEbE4typeELb1EEEOT_ Unexecuted instantiation: _ZN8UniValueC2IRA13_KcA13_cTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS6_Esr3stdE11is_signed_vIS6_Esr3stdE13is_unsigned_vIS6_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_EEbE4typeELb1EEEOT_ _ZN8UniValueC2IRA4_KcA4_cTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS6_Esr3stdE11is_signed_vIS6_Esr3stdE13is_unsigned_vIS6_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_EEbE4typeELb1EEEOT_ Line | Count | Source | 40 | 2.35M | { | 41 | | if constexpr (std::is_floating_point_v<T>) { | 42 | | setFloat(val); | 43 | | } else if constexpr (std::is_same_v<bool, T>) { | 44 | | setBool(val); | 45 | | } else if constexpr (std::is_signed_v<T>) { | 46 | | setInt(int64_t{val}); | 47 | | } else if constexpr (std::is_unsigned_v<T>) { | 48 | | setInt(uint64_t{val}); | 49 | 2.35M | } else { | 50 | 2.35M | setStr(std::string{std::forward<Ref>(val)}); | 51 | 2.35M | } | 52 | 2.35M | } |
Unexecuted instantiation: _ZN8UniValueC2IPKcS2_TnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS4_Esr3stdE11is_signed_vIS4_Esr3stdE13is_unsigned_vIS4_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_EEbE4typeELb1EEEOT_ Unexecuted instantiation: _ZN8UniValueC2IRKttTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS4_Esr3stdE11is_signed_vIS4_Esr3stdE13is_unsigned_vIS4_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_EEbE4typeELb1EEEOT_ Unexecuted instantiation: _ZN8UniValueC2IRA21_KcA21_cTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS6_Esr3stdE11is_signed_vIS6_Esr3stdE13is_unsigned_vIS6_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_EEbE4typeELb1EEEOT_ Unexecuted instantiation: _ZN8UniValueC2IttTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS2_Esr3stdE11is_signed_vIS2_Esr3stdE13is_unsigned_vIS2_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES2_EEbE4typeELb1EEEOT_ Unexecuted instantiation: _ZN8UniValueC2IRA91_KcA91_cTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS6_Esr3stdE11is_signed_vIS6_Esr3stdE13is_unsigned_vIS6_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_EEbE4typeELb1EEEOT_ _ZN8UniValueC2IRA35_KcA35_cTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS6_Esr3stdE11is_signed_vIS6_Esr3stdE13is_unsigned_vIS6_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_EEbE4typeELb1EEEOT_ Line | Count | Source | 40 | 88.7k | { | 41 | | if constexpr (std::is_floating_point_v<T>) { | 42 | | setFloat(val); | 43 | | } else if constexpr (std::is_same_v<bool, T>) { | 44 | | setBool(val); | 45 | | } else if constexpr (std::is_signed_v<T>) { | 46 | | setInt(int64_t{val}); | 47 | | } else if constexpr (std::is_unsigned_v<T>) { | 48 | | setInt(uint64_t{val}); | 49 | 88.7k | } else { | 50 | 88.7k | setStr(std::string{std::forward<Ref>(val)}); | 51 | 88.7k | } | 52 | 88.7k | } |
Unexecuted instantiation: _ZN8UniValueC2IRhhTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS3_Esr3stdE11is_signed_vIS3_Esr3stdE13is_unsigned_vIS3_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES3_EEbE4typeELb1EEEOT_ Unexecuted instantiation: _ZN8UniValueC2IRA45_KcA45_cTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS6_Esr3stdE11is_signed_vIS6_Esr3stdE13is_unsigned_vIS6_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_EEbE4typeELb1EEEOT_ Unexecuted instantiation: _ZN8UniValueC2IRA86_KcA86_cTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS6_Esr3stdE11is_signed_vIS6_Esr3stdE13is_unsigned_vIS6_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_EEbE4typeELb1EEEOT_ Unexecuted instantiation: _ZN8UniValueC2IRA54_KcA54_cTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS6_Esr3stdE11is_signed_vIS6_Esr3stdE13is_unsigned_vIS6_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_EEbE4typeELb1EEEOT_ Unexecuted instantiation: _ZN8UniValueC2IRA137_KcA137_cTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS6_Esr3stdE11is_signed_vIS6_Esr3stdE13is_unsigned_vIS6_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_EEbE4typeELb1EEEOT_ _ZN8UniValueC2IRA3_KcA3_cTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS6_Esr3stdE11is_signed_vIS6_Esr3stdE13is_unsigned_vIS6_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_EEbE4typeELb1EEEOT_ Line | Count | Source | 40 | 22.1k | { | 41 | | if constexpr (std::is_floating_point_v<T>) { | 42 | | setFloat(val); | 43 | | } else if constexpr (std::is_same_v<bool, T>) { | 44 | | setBool(val); | 45 | | } else if constexpr (std::is_signed_v<T>) { | 46 | | setInt(int64_t{val}); | 47 | | } else if constexpr (std::is_unsigned_v<T>) { | 48 | | setInt(uint64_t{val}); | 49 | 22.1k | } else { | 50 | 22.1k | setStr(std::string{std::forward<Ref>(val)}); | 51 | 22.1k | } | 52 | 22.1k | } |
Unexecuted instantiation: _ZN8UniValueC2IRA33_KcA33_cTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS6_Esr3stdE11is_signed_vIS6_Esr3stdE13is_unsigned_vIS6_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_EEbE4typeELb1EEEOT_ Unexecuted instantiation: _ZN8UniValueC2IRA47_KcA47_cTnNSt9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS6_Esr3stdE11is_signed_vIS6_Esr3stdE13is_unsigned_vIS6_Esr3stdE18is_constructible_vINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_EEbE4typeELb1EEEOT_ |
53 | | |
54 | | void clear(); |
55 | | |
56 | | void setNull(); |
57 | | void setBool(bool val); |
58 | | void setNumStr(std::string str); |
59 | | void setInt(uint64_t val); |
60 | | void setInt(int64_t val); |
61 | 0 | void setInt(int val_) { return setInt(int64_t{val_}); } |
62 | | void setFloat(double val); |
63 | | void setStr(std::string str); |
64 | | void setArray(); |
65 | | void setObject(); |
66 | | |
67 | 25.9M | enum VType getType() const { return typ; } |
68 | 7.87M | const std::string& getValStr() const { return val; } |
69 | 2.35M | bool empty() const { return (values.size() == 0); } |
70 | | |
71 | 2.35M | size_t size() const { return values.size(); } |
72 | | |
73 | | void getObjMap(std::map<std::string,UniValue>& kv) const; |
74 | | bool checkObject(const std::map<std::string,UniValue::VType>& memberTypes) const; |
75 | | const UniValue& operator[](const std::string& key) const; |
76 | | const UniValue& operator[](size_t index) const; |
77 | 2.35M | bool exists(const std::string& key) const { size_t i; return findKey(key, i); } |
78 | | |
79 | 25.1M | bool isNull() const { return (typ == VNULL); } |
80 | 3.13M | bool isTrue() const { return (typ == VBOOL) && (val == "1"); } Branch (80:34): [True: 2.65M, False: 474k]
Branch (80:52): [True: 2.61M, False: 44.3k]
|
81 | 2.21M | bool isFalse() const { return (typ == VBOOL) && (val != "1"); } Branch (81:35): [True: 0, False: 2.21M]
Branch (81:53): [True: 0, False: 0]
|
82 | 99.8k | bool isBool() const { return (typ == VBOOL); } |
83 | 4.97M | bool isStr() const { return (typ == VSTR); } |
84 | 363k | bool isNum() const { return (typ == VNUM); } |
85 | 2.48M | bool isArray() const { return (typ == VARR); } |
86 | 7.07M | bool isObject() const { return (typ == VOBJ); } |
87 | | |
88 | | void push_back(UniValue val); |
89 | | void push_backV(const std::vector<UniValue>& vec); |
90 | | template <class It> |
91 | | void push_backV(It first, It last); |
92 | | |
93 | | void pushKVEnd(std::string key, UniValue val); |
94 | | void pushKV(std::string key, UniValue val); |
95 | | void pushKVs(UniValue obj); |
96 | | |
97 | | std::string write(unsigned int prettyIndent = 0, |
98 | | unsigned int indentLevel = 0) const; |
99 | | |
100 | | bool read(std::string_view raw); |
101 | | |
102 | | private: |
103 | | UniValue::VType typ; |
104 | | std::string val; // numbers are stored as C++ strings |
105 | | std::vector<std::string> keys; |
106 | | std::vector<UniValue> values; |
107 | | |
108 | | void checkType(const VType& expected) const; |
109 | | bool findKey(const std::string& key, size_t& retIdx) const; |
110 | | void writeArray(unsigned int prettyIndent, unsigned int indentLevel, std::string& s) const; |
111 | | void writeObject(unsigned int prettyIndent, unsigned int indentLevel, std::string& s) const; |
112 | | |
113 | | public: |
114 | | // Strict type-specific getters, these throw std::runtime_error if the |
115 | | // value is of unexpected type |
116 | | const std::vector<std::string>& getKeys() const; |
117 | | const std::vector<UniValue>& getValues() const; |
118 | | template <typename Int> |
119 | | Int getInt() const; |
120 | | bool get_bool() const; |
121 | | const std::string& get_str() const; |
122 | | double get_real() const; |
123 | | const UniValue& get_obj() const; |
124 | | const UniValue& get_array() const; |
125 | | |
126 | 0 | enum VType type() const { return getType(); } |
127 | | const UniValue& find_value(std::string_view key) const; |
128 | | }; |
129 | | |
130 | | template <class It> |
131 | | void UniValue::push_backV(It first, It last) |
132 | 0 | { |
133 | 0 | checkType(VARR); |
134 | 0 | values.insert(values.end(), first, last); |
135 | 0 | } |
136 | | |
137 | | template <typename Int> |
138 | | Int UniValue::getInt() const |
139 | 2.25M | { |
140 | 2.25M | static_assert(std::is_integral_v<Int>); |
141 | 2.25M | checkType(VNUM); |
142 | 2.25M | Int result; |
143 | 2.25M | const auto [first_nonmatching, error_condition] = std::from_chars(val.data(), val.data() + val.size(), result); |
144 | 2.25M | if (first_nonmatching != val.data() + val.size() || error_condition != std::errc{}) { Branch (144:9): [True: 0, False: 0]
Branch (144:57): [True: 0, False: 0]
Branch (144:9): [True: 0, False: 2.25M]
Branch (144:57): [True: 0, False: 2.25M]
Branch (144:9): [True: 0, False: 0]
Branch (144:57): [True: 0, False: 0]
Branch (144:9): [True: 0, False: 0]
Branch (144:57): [True: 0, False: 0]
Branch (144:9): [True: 0, False: 0]
Branch (144:57): [True: 0, False: 0]
|
145 | 0 | throw std::runtime_error("JSON integer out of range"); |
146 | 0 | } |
147 | 2.25M | return result; |
148 | 2.25M | } Unexecuted instantiation: int UniValue::getInt<int>() const long UniValue::getInt<long>() const Line | Count | Source | 139 | 2.25M | { | 140 | 2.25M | static_assert(std::is_integral_v<Int>); | 141 | 2.25M | checkType(VNUM); | 142 | 2.25M | Int result; | 143 | 2.25M | const auto [first_nonmatching, error_condition] = std::from_chars(val.data(), val.data() + val.size(), result); | 144 | 2.25M | if (first_nonmatching != val.data() + val.size() || error_condition != std::errc{}) { Branch (144:9): [True: 0, False: 2.25M]
Branch (144:57): [True: 0, False: 2.25M]
| 145 | 0 | throw std::runtime_error("JSON integer out of range"); | 146 | 0 | } | 147 | 2.25M | return result; | 148 | 2.25M | } |
Unexecuted instantiation: unsigned int UniValue::getInt<unsigned int>() const Unexecuted instantiation: unsigned short UniValue::getInt<unsigned short>() const Unexecuted instantiation: unsigned long UniValue::getInt<unsigned long>() const |
149 | | |
150 | | enum jtokentype { |
151 | | JTOK_ERR = -1, |
152 | | JTOK_NONE = 0, // eof |
153 | | JTOK_OBJ_OPEN, |
154 | | JTOK_OBJ_CLOSE, |
155 | | JTOK_ARR_OPEN, |
156 | | JTOK_ARR_CLOSE, |
157 | | JTOK_COLON, |
158 | | JTOK_COMMA, |
159 | | JTOK_KW_NULL, |
160 | | JTOK_KW_TRUE, |
161 | | JTOK_KW_FALSE, |
162 | | JTOK_NUMBER, |
163 | | JTOK_STRING, |
164 | | }; |
165 | | |
166 | | extern enum jtokentype getJsonToken(std::string& tokenVal, |
167 | | unsigned int& consumed, const char *raw, const char *end); |
168 | | extern const char *uvTypeName(UniValue::VType t); |
169 | | |
170 | | static inline bool jsonTokenIsValue(enum jtokentype jtt) |
171 | 44.9M | { |
172 | 44.9M | switch (jtt) { |
173 | 0 | case JTOK_KW_NULL: Branch (173:5): [True: 0, False: 44.9M]
|
174 | 0 | case JTOK_KW_TRUE: Branch (174:5): [True: 0, False: 44.9M]
|
175 | 44.3k | case JTOK_KW_FALSE: Branch (175:5): [True: 44.3k, False: 44.9M]
|
176 | 4.66M | case JTOK_NUMBER: Branch (176:5): [True: 4.61M, False: 40.3M]
|
177 | 18.9M | case JTOK_STRING: Branch (177:5): [True: 14.2M, False: 30.6M]
|
178 | 18.9M | return true; |
179 | | |
180 | 26.0M | default: Branch (180:5): [True: 26.0M, False: 18.9M]
|
181 | 26.0M | return false; |
182 | 44.9M | } |
183 | | |
184 | | // not reached |
185 | 44.9M | } Unexecuted instantiation: init.cpp:jsonTokenIsValue(jtokentype) Unexecuted instantiation: interfaces.cpp:jsonTokenIsValue(jtokentype) Unexecuted instantiation: warnings.cpp:jsonTokenIsValue(jtokentype) Unexecuted instantiation: rest.cpp:jsonTokenIsValue(jtokentype) Unexecuted instantiation: blockchain.cpp:jsonTokenIsValue(jtokentype) Unexecuted instantiation: external_signer.cpp:jsonTokenIsValue(jtokentype) Unexecuted instantiation: fees.cpp:jsonTokenIsValue(jtokentype) Unexecuted instantiation: mempool.cpp:jsonTokenIsValue(jtokentype) Unexecuted instantiation: mining.cpp:jsonTokenIsValue(jtokentype) Unexecuted instantiation: net.cpp:jsonTokenIsValue(jtokentype) Unexecuted instantiation: node.cpp:jsonTokenIsValue(jtokentype) Unexecuted instantiation: output_script.cpp:jsonTokenIsValue(jtokentype) Unexecuted instantiation: rawtransaction.cpp:jsonTokenIsValue(jtokentype) Unexecuted instantiation: server.cpp:jsonTokenIsValue(jtokentype) Unexecuted instantiation: server_util.cpp:jsonTokenIsValue(jtokentype) Unexecuted instantiation: signmessage.cpp:jsonTokenIsValue(jtokentype) Unexecuted instantiation: txoutproof.cpp:jsonTokenIsValue(jtokentype) Unexecuted instantiation: addrdb.cpp:jsonTokenIsValue(jtokentype) Unexecuted instantiation: httprpc.cpp:jsonTokenIsValue(jtokentype) Unexecuted instantiation: load.cpp:jsonTokenIsValue(jtokentype) Unexecuted instantiation: wallet.cpp:jsonTokenIsValue(jtokentype) Unexecuted instantiation: external_signer_scriptpubkeyman.cpp:jsonTokenIsValue(jtokentype) Unexecuted instantiation: addresses.cpp:jsonTokenIsValue(jtokentype) Unexecuted instantiation: backup.cpp:jsonTokenIsValue(jtokentype) Unexecuted instantiation: coins.cpp:jsonTokenIsValue(jtokentype) Unexecuted instantiation: encrypt.cpp:jsonTokenIsValue(jtokentype) Unexecuted instantiation: spend.cpp:jsonTokenIsValue(jtokentype) Unexecuted instantiation: transactions.cpp:jsonTokenIsValue(jtokentype) Unexecuted instantiation: util.cpp:jsonTokenIsValue(jtokentype) Unexecuted instantiation: args.cpp:jsonTokenIsValue(jtokentype) Unexecuted instantiation: config.cpp:jsonTokenIsValue(jtokentype) Unexecuted instantiation: settings.cpp:jsonTokenIsValue(jtokentype) Unexecuted instantiation: core_write.cpp:jsonTokenIsValue(jtokentype) Unexecuted instantiation: net_types.cpp:jsonTokenIsValue(jtokentype) Unexecuted instantiation: rawtransaction_util.cpp:jsonTokenIsValue(jtokentype) Unexecuted instantiation: request.cpp:jsonTokenIsValue(jtokentype) Unexecuted instantiation: run_command.cpp:jsonTokenIsValue(jtokentype) Unexecuted instantiation: univalue.cpp:jsonTokenIsValue(jtokentype) Unexecuted instantiation: univalue_get.cpp:jsonTokenIsValue(jtokentype) univalue_read.cpp:jsonTokenIsValue(jtokentype) Line | Count | Source | 171 | 44.9M | { | 172 | 44.9M | switch (jtt) { | 173 | 0 | case JTOK_KW_NULL: Branch (173:5): [True: 0, False: 44.9M]
| 174 | 0 | case JTOK_KW_TRUE: Branch (174:5): [True: 0, False: 44.9M]
| 175 | 44.3k | case JTOK_KW_FALSE: Branch (175:5): [True: 44.3k, False: 44.9M]
| 176 | 4.66M | case JTOK_NUMBER: Branch (176:5): [True: 4.61M, False: 40.3M]
| 177 | 18.9M | case JTOK_STRING: Branch (177:5): [True: 14.2M, False: 30.6M]
| 178 | 18.9M | return true; | 179 | | | 180 | 26.0M | default: Branch (180:5): [True: 26.0M, False: 18.9M]
| 181 | 26.0M | return false; | 182 | 44.9M | } | 183 | | | 184 | | // not reached | 185 | 44.9M | } |
Unexecuted instantiation: univalue_write.cpp:jsonTokenIsValue(jtokentype) |
186 | | |
187 | | static inline bool json_isspace(int ch) |
188 | 45.9M | { |
189 | 45.9M | switch (ch) { |
190 | 0 | case 0x20: Branch (190:5): [True: 0, False: 0]
Branch (190:5): [True: 0, False: 45.9M]
|
191 | 0 | case 0x09: Branch (191:5): [True: 0, False: 0]
Branch (191:5): [True: 0, False: 45.9M]
|
192 | 0 | case 0x0a: Branch (192:5): [True: 0, False: 0]
Branch (192:5): [True: 0, False: 45.9M]
|
193 | 0 | case 0x0d: Branch (193:5): [True: 0, False: 0]
Branch (193:5): [True: 0, False: 45.9M]
|
194 | 0 | return true; |
195 | | |
196 | 45.9M | default: Branch (196:5): [True: 0, False: 0]
Branch (196:5): [True: 45.9M, False: 0]
|
197 | 45.9M | return false; |
198 | 45.9M | } |
199 | | |
200 | | // not reached |
201 | 45.9M | } Unexecuted instantiation: init.cpp:json_isspace(int) Unexecuted instantiation: interfaces.cpp:json_isspace(int) Unexecuted instantiation: warnings.cpp:json_isspace(int) Unexecuted instantiation: rest.cpp:json_isspace(int) Unexecuted instantiation: blockchain.cpp:json_isspace(int) Unexecuted instantiation: external_signer.cpp:json_isspace(int) Unexecuted instantiation: fees.cpp:json_isspace(int) Unexecuted instantiation: mempool.cpp:json_isspace(int) Unexecuted instantiation: mining.cpp:json_isspace(int) Unexecuted instantiation: net.cpp:json_isspace(int) Unexecuted instantiation: node.cpp:json_isspace(int) Unexecuted instantiation: output_script.cpp:json_isspace(int) Unexecuted instantiation: rawtransaction.cpp:json_isspace(int) Unexecuted instantiation: server.cpp:json_isspace(int) Unexecuted instantiation: server_util.cpp:json_isspace(int) Unexecuted instantiation: signmessage.cpp:json_isspace(int) Unexecuted instantiation: txoutproof.cpp:json_isspace(int) Unexecuted instantiation: addrdb.cpp:json_isspace(int) Unexecuted instantiation: httprpc.cpp:json_isspace(int) Unexecuted instantiation: load.cpp:json_isspace(int) Unexecuted instantiation: wallet.cpp:json_isspace(int) Unexecuted instantiation: external_signer_scriptpubkeyman.cpp:json_isspace(int) Unexecuted instantiation: addresses.cpp:json_isspace(int) Unexecuted instantiation: backup.cpp:json_isspace(int) Unexecuted instantiation: coins.cpp:json_isspace(int) Unexecuted instantiation: encrypt.cpp:json_isspace(int) Unexecuted instantiation: spend.cpp:json_isspace(int) Unexecuted instantiation: transactions.cpp:json_isspace(int) Unexecuted instantiation: util.cpp:json_isspace(int) Unexecuted instantiation: args.cpp:json_isspace(int) Unexecuted instantiation: config.cpp:json_isspace(int) Unexecuted instantiation: settings.cpp:json_isspace(int) Unexecuted instantiation: core_write.cpp:json_isspace(int) Unexecuted instantiation: net_types.cpp:json_isspace(int) Unexecuted instantiation: rawtransaction_util.cpp:json_isspace(int) Unexecuted instantiation: request.cpp:json_isspace(int) Unexecuted instantiation: run_command.cpp:json_isspace(int) Unexecuted instantiation: univalue.cpp:json_isspace(int) Unexecuted instantiation: univalue_get.cpp:json_isspace(int) univalue_read.cpp:json_isspace(int) Line | Count | Source | 188 | 45.9M | { | 189 | 45.9M | switch (ch) { | 190 | 0 | case 0x20: Branch (190:5): [True: 0, False: 45.9M]
| 191 | 0 | case 0x09: Branch (191:5): [True: 0, False: 45.9M]
| 192 | 0 | case 0x0a: Branch (192:5): [True: 0, False: 45.9M]
| 193 | 0 | case 0x0d: Branch (193:5): [True: 0, False: 45.9M]
| 194 | 0 | return true; | 195 | | | 196 | 45.9M | default: Branch (196:5): [True: 45.9M, False: 0]
| 197 | 45.9M | return false; | 198 | 45.9M | } | 199 | | | 200 | | // not reached | 201 | 45.9M | } |
Unexecuted instantiation: univalue_write.cpp:json_isspace(int) |
202 | | |
203 | | extern const UniValue NullUniValue; |
204 | | |
205 | | #endif // BITCOIN_UNIVALUE_INCLUDE_UNIVALUE_H |