diff --git a/.github/workflows/windows.yml.bak b/.github/workflows/windows.yml similarity index 100% rename from .github/workflows/windows.yml.bak rename to .github/workflows/windows.yml diff --git a/doc/ref/corelib/json_type_traits/custom-specializations.md b/doc/ref/corelib/json_type_traits/custom-specializations.md index 846b81b3f..28cbab3dc 100644 --- a/doc/ref/corelib/json_type_traits/custom-specializations.md +++ b/doc/ref/corelib/json_type_traits/custom-specializations.md @@ -264,7 +264,7 @@ struct json_type_traits template <> struct is_json_type_traits_declared : public std::true_type {}; -} // jsoncons +} // namespace jsoncons using jsoncons::json; @@ -368,7 +368,7 @@ namespace jsoncons { return a; } }; -} // jsoncons +} // namespace jsoncons using namespace jsoncons; using boost::numeric::ublas::matrix; diff --git a/examples/src/type_extensibility_examples.cpp b/examples/src/type_extensibility_examples.cpp index 849603993..f77ea151b 100644 --- a/examples/src/type_extensibility_examples.cpp +++ b/examples/src/type_extensibility_examples.cpp @@ -156,7 +156,7 @@ struct json_type_traits template <> struct is_json_type_traits_declared : public std::true_type {}; -} // jsoncons +} // namespace jsoncons void own_vector_extensibility_example() { diff --git a/include/jsoncons/allocator_holder.hpp b/include/jsoncons/allocator_holder.hpp index ebbc2f56c..cc33a0628 100644 --- a/include/jsoncons/allocator_holder.hpp +++ b/include/jsoncons/allocator_holder.hpp @@ -32,6 +32,6 @@ class allocator_holder } }; -} +} // namespace jsoncons #endif // JSONCONS_ALLOCATOR_HOLDER_HPP diff --git a/include/jsoncons/config/binary_config.hpp b/include/jsoncons/config/binary_config.hpp index eee87918e..656a1b030 100644 --- a/include/jsoncons/config/binary_config.hpp +++ b/include/jsoncons/config/binary_config.hpp @@ -221,7 +221,7 @@ namespace binary { return val2; } -} // binary -} // jsoncons +} // namespace binary +} // namespace jsoncons #endif // JSONCONS_CONFIG_BINARY_CONFIG_HPP diff --git a/include/jsoncons/config/jsoncons_config.hpp b/include/jsoncons/config/jsoncons_config.hpp index 4dda1c75f..dd26f175e 100644 --- a/include/jsoncons/config/jsoncons_config.hpp +++ b/include/jsoncons/config/jsoncons_config.hpp @@ -115,7 +115,7 @@ namespace jsoncons { template typename unique_if::value_is_array_of_known_bound make_unique(Args&&...) = delete; -} // jsoncons +} // namespace jsoncons #else @@ -241,7 +241,7 @@ namespace binary { } } // binary -} // jsoncons +} // namespace jsoncons namespace jsoncons { @@ -287,7 +287,7 @@ namespace jsoncons { return jsoncons::wstring_view(w); } -} // jsoncons +} // namespace jsoncons #define JSONCONS_EXPAND(X) X #define JSONCONS_QUOTE(Prefix, A) JSONCONS_EXPAND(Prefix ## #A) diff --git a/include/jsoncons/config/version.hpp b/include/jsoncons/config/version.hpp index cf20afb8d..fd26eea78 100644 --- a/include/jsoncons/config/version.hpp +++ b/include/jsoncons/config/version.hpp @@ -35,6 +35,6 @@ constexpr versioning_info version() return versioning_info{JSONCONS_VERSION_MAJOR, JSONCONS_VERSION_MINOR, JSONCONS_VERSION_PATCH}; } -} +} // namespace jsoncons #endif // JSONCONS_CONFIG_VERSION_HPP diff --git a/include/jsoncons/conv_error.hpp b/include/jsoncons/conv_error.hpp index d4b17e01f..ffc61232d 100644 --- a/include/jsoncons/conv_error.hpp +++ b/include/jsoncons/conv_error.hpp @@ -126,7 +126,8 @@ namespace std { struct is_error_code_enum : public true_type { }; -} + +} // namespace std namespace jsoncons { @@ -196,7 +197,8 @@ namespace detail { } } }; -} // detail + +} // namespace detail extern inline const std::error_category& conv_error_category() @@ -211,6 +213,6 @@ std::error_code make_error_code(conv_errc result) return std::error_code(static_cast(result),conv_error_category()); } -} +} // namespace jsoncons #endif // JSONCONS_CONV_ERROR_HPP diff --git a/include/jsoncons/decode_json.hpp b/include/jsoncons/decode_json.hpp index 6572e6aab..c04d8988d 100644 --- a/include/jsoncons/decode_json.hpp +++ b/include/jsoncons/decode_json.hpp @@ -206,7 +206,7 @@ namespace jsoncons { } -} // jsoncons +} // namespace jsoncons #endif // JSONCONS_DECODE_JSON_HPP diff --git a/include/jsoncons/decode_traits.hpp b/include/jsoncons/decode_traits.hpp index 518fcbeb5..814a5aaad 100644 --- a/include/jsoncons/decode_traits.hpp +++ b/include/jsoncons/decode_traits.hpp @@ -646,7 +646,7 @@ namespace jsoncons { } }; -} // jsoncons +} // namespace jsoncons #endif // JSONCONS_DECODE_TRAITS_HPP diff --git a/include/jsoncons/detail/grisu3.hpp b/include/jsoncons/detail/grisu3.hpp index f74c8b1c6..2f3f4621d 100644 --- a/include/jsoncons/detail/grisu3.hpp +++ b/include/jsoncons/detail/grisu3.hpp @@ -308,6 +308,7 @@ bool grisu3(double v, char *buffer, int *length, int *K) return result; } -}} // namespace detail namespace jsoncons +} // namespace detail +} // namespace jsoncons #endif // JSONCONS_DETAIL_GRISU3_HPP diff --git a/include/jsoncons/detail/parse_number.hpp b/include/jsoncons/detail/parse_number.hpp index 52738f8c8..eb1375f2e 100644 --- a/include/jsoncons/detail/parse_number.hpp +++ b/include/jsoncons/detail/parse_number.hpp @@ -69,7 +69,7 @@ namespace std { struct is_error_code_enum : public true_type { }; -} +} // namespace std namespace jsoncons { namespace detail { @@ -1042,6 +1042,7 @@ class chars_to }; #endif -}} +} // namespace detail +} // namespace jsoncons #endif // JSONCONS_DETAIL_PARSE_NUMBER_HPP diff --git a/include/jsoncons/detail/span.hpp b/include/jsoncons/detail/span.hpp index 69d5b0221..443049a06 100644 --- a/include/jsoncons/detail/span.hpp +++ b/include/jsoncons/detail/span.hpp @@ -16,10 +16,9 @@ #include #include -namespace jsoncons -{ -namespace detail -{ +namespace jsoncons { +namespace detail { + constexpr std::size_t dynamic_extent = (std::numeric_limits::max)(); template< typename T, std::size_t Extent = dynamic_extent> diff --git a/include/jsoncons/encode_json.hpp b/include/jsoncons/encode_json.hpp index 3f5915ce6..2fbc7f8c9 100644 --- a/include/jsoncons/encode_json.hpp +++ b/include/jsoncons/encode_json.hpp @@ -285,7 +285,7 @@ namespace jsoncons { //end legacy -} // jsoncons +} // namespace jsoncons #endif // JSONCONS_ENCODE_JSON_HPP diff --git a/include/jsoncons/encode_traits.hpp b/include/jsoncons/encode_traits.hpp index 0435b4ee9..52e234b0f 100644 --- a/include/jsoncons/encode_traits.hpp +++ b/include/jsoncons/encode_traits.hpp @@ -373,7 +373,7 @@ namespace jsoncons { } }; -} // jsoncons +} // namespace jsoncons #endif // JSONCONS_ENCODE_TRAITS_HPP diff --git a/include/jsoncons/json_cursor.hpp b/include/jsoncons/json_cursor.hpp index abab0cec5..4120ba02d 100644 --- a/include/jsoncons/json_cursor.hpp +++ b/include/jsoncons/json_cursor.hpp @@ -465,7 +465,7 @@ using json_string_cursor = basic_json_cursor> using wjson_stream_cursor = basic_json_cursor>; using wjson_string_cursor = basic_json_cursor>; -} +} // namespace jsoncons #endif // JSONCONS_JSON_CURSOR_HPP diff --git a/include/jsoncons/json_error.hpp b/include/jsoncons/json_error.hpp index 605e6a1d2..2adf39ba9 100644 --- a/include/jsoncons/json_error.hpp +++ b/include/jsoncons/json_error.hpp @@ -139,13 +139,14 @@ namespace jsoncons { return std::error_code(static_cast(result),json_error_category()); } -} // jsoncons +} // namespace jsoncons namespace std { template<> struct is_error_code_enum : public true_type { }; -} + +} // namespace std #endif // JSONCONS_JSON_ERROR_HPP diff --git a/include/jsoncons/json_filter.hpp b/include/jsoncons/json_filter.hpp index 81091b056..138176a9b 100644 --- a/include/jsoncons/json_filter.hpp +++ b/include/jsoncons/json_filter.hpp @@ -604,6 +604,6 @@ using wjson_filter = basic_json_filter; using rename_object_key_filter = basic_rename_object_key_filter; using wrename_object_key_filter = basic_rename_object_key_filter; -} +} // namespace jsoncons #endif // JSONCONS_JSON_FILTER_HPP diff --git a/include/jsoncons/json_fwd.hpp b/include/jsoncons/json_fwd.hpp index 51dee0124..ea963b057 100644 --- a/include/jsoncons/json_fwd.hpp +++ b/include/jsoncons/json_fwd.hpp @@ -18,6 +18,6 @@ template > class basic_json; -} +} // namespace jsoncons #endif // JSONCONS_JSON_FWD_HPP diff --git a/include/jsoncons/json_object.hpp b/include/jsoncons/json_object.hpp index f9b386279..444075d6e 100644 --- a/include/jsoncons/json_object.hpp +++ b/include/jsoncons/json_object.hpp @@ -223,7 +223,7 @@ namespace jsoncons { return i.value(); } -} // jsoncons +} // namespace jsoncons namespace std { diff --git a/include/jsoncons/json_options.hpp b/include/jsoncons/json_options.hpp index deca70b46..3dc693ed5 100644 --- a/include/jsoncons/json_options.hpp +++ b/include/jsoncons/json_options.hpp @@ -697,5 +697,6 @@ class basic_json_options final: public basic_json_decode_options, using json_options = basic_json_options; using wjson_options = basic_json_options; -} +} // namespace jsoncons + #endif // JSONCONS_JSON_OPTIONS_HPP diff --git a/include/jsoncons/json_parser.hpp b/include/jsoncons/json_parser.hpp index d06756529..62bb851df 100644 --- a/include/jsoncons/json_parser.hpp +++ b/include/jsoncons/json_parser.hpp @@ -2605,7 +2605,8 @@ class basic_json_parser : public ser_context, public virtual basic_parser_input< using json_parser = basic_json_parser; using wjson_parser = basic_json_parser; -} + +} // namespace jsoncons #endif // JSONCONS_JSON_PARSER_HPP diff --git a/include/jsoncons/json_reader.hpp b/include/jsoncons/json_reader.hpp index d6fa68f92..94cf4516f 100644 --- a/include/jsoncons/json_reader.hpp +++ b/include/jsoncons/json_reader.hpp @@ -380,7 +380,7 @@ namespace jsoncons { using json_stream_reader = basic_json_reader>; using wjson_stream_reader = basic_json_reader>; -} +} // namespace jsoncons #endif // JSONCONS_JSON_READER_HPP diff --git a/include/jsoncons/json_type.hpp b/include/jsoncons/json_type.hpp index ba5807633..6cb65fc23 100644 --- a/include/jsoncons/json_type.hpp +++ b/include/jsoncons/json_type.hpp @@ -222,6 +222,6 @@ namespace jsoncons { return os; } -} // jsoncons +} // namespace jsoncons #endif // JSONCONS_JSON_TYPE_HPP diff --git a/include/jsoncons/json_type_traits.hpp b/include/jsoncons/json_type_traits.hpp index 9228f42d6..1e8690cb0 100644 --- a/include/jsoncons/json_type_traits.hpp +++ b/include/jsoncons/json_type_traits.hpp @@ -1076,7 +1076,7 @@ has_can_convert = extension_traits::is_detected; { } }; - } // namespace detail + } // namespace tuple_detail template struct json_type_traits> @@ -1898,6 +1898,6 @@ namespace variant_detail } }; -} // jsoncons +} // namespace jsoncons #endif // JSONCONS_JSON_TYPE_TRAITS_HPP diff --git a/include/jsoncons/pretty_print.hpp b/include/jsoncons/pretty_print.hpp index 5ceaecf7d..7b8a3affd 100644 --- a/include/jsoncons/pretty_print.hpp +++ b/include/jsoncons/pretty_print.hpp @@ -84,6 +84,6 @@ json_printable pretty_print(const Json& j, return json_printable(j, options, indenting::indent); } -} +} // namespace jsoncons #endif // JSONCONS_PRETTY_PRINT_HPP diff --git a/include/jsoncons/ser_context.hpp b/include/jsoncons/ser_context.hpp index 5e2200ea0..4f7591716 100644 --- a/include/jsoncons/ser_context.hpp +++ b/include/jsoncons/ser_context.hpp @@ -35,5 +35,6 @@ class ser_context } }; -} +} // namespace jsoncons + #endif // JSONCONS_SER_CONTEXT_HPP diff --git a/include/jsoncons/staj_cursor.hpp b/include/jsoncons/staj_cursor.hpp index 5b0921018..1df181ea6 100644 --- a/include/jsoncons/staj_cursor.hpp +++ b/include/jsoncons/staj_cursor.hpp @@ -741,7 +741,7 @@ using wstaj_cursor = basic_staj_cursor; using staj_filter_view = basic_staj_filter_view; using wstaj_filter_view = basic_staj_filter_view; -} +} // namespace jsoncons #endif // JSONCONS_STAJ_CURSOR_HPP diff --git a/include/jsoncons/tag_type.hpp b/include/jsoncons/tag_type.hpp index aa4d1f5b3..a1fa2150c 100644 --- a/include/jsoncons/tag_type.hpp +++ b/include/jsoncons/tag_type.hpp @@ -237,6 +237,6 @@ std::basic_ostream& operator<<(std::basic_ostream& os, semantic_ta return os; } -} +} // namespace jsoncons #endif // JSONCONS_TAG_TYPE_HPP diff --git a/include/jsoncons/utility/bigint.hpp b/include/jsoncons/utility/bigint.hpp index 3c1407d98..31547a980 100644 --- a/include/jsoncons/utility/bigint.hpp +++ b/include/jsoncons/utility/bigint.hpp @@ -32,7 +32,6 @@ Chichester: John Wiley. */ - namespace detail { template @@ -1622,6 +1621,6 @@ class basic_bigint : protected detail::basic_bigint_base using bigint = basic_bigint>; -} +} // namespace jsoncons #endif // JSONCONS_UTILITY_BIGINT_HPP diff --git a/include/jsoncons/utility/binary.hpp b/include/jsoncons/utility/binary.hpp index cde77eddc..c23190fcc 100644 --- a/include/jsoncons/utility/binary.hpp +++ b/include/jsoncons/utility/binary.hpp @@ -3,9 +3,8 @@ #include -namespace jsoncons { namespace utility { +namespace jsoncons { -} // utility -} // jsoncons +} // namespace jsoncons #endif // JSONCONS_UTILITY_BINARY_HPP diff --git a/include/jsoncons/utility/extension_traits.hpp b/include/jsoncons/utility/extension_traits.hpp index e85e74a4c..8b63a120a 100644 --- a/include/jsoncons/utility/extension_traits.hpp +++ b/include/jsoncons/utility/extension_traits.hpp @@ -918,6 +918,6 @@ namespace impl { } // extension_traits -} // jsoncons +} // namespace jsoncons #endif // JSONCONS_UTILITY_EXTENSION_TRAITS_HPP diff --git a/include/jsoncons/utility/unicode_traits.hpp b/include/jsoncons/utility/unicode_traits.hpp index ae7f153bb..c202c7a4f 100644 --- a/include/jsoncons/utility/unicode_traits.hpp +++ b/include/jsoncons/utility/unicode_traits.hpp @@ -281,14 +281,14 @@ namespace jsoncons { namespace unicode_traits { } } // unicode_traits -} // jsoncons +} // namespace jsoncons namespace std { template<> struct is_error_code_enum : public true_type { }; -} +} // namespace std namespace jsoncons { namespace unicode_traits { @@ -1325,7 +1325,7 @@ namespace jsoncons { namespace unicode_traits { } } // unicode_traits -} // jsoncons +} // namespace jsoncons #endif //JSONCONS_UTILITY_UNICODE_TRAITS_HPP diff --git a/include/jsoncons_ext/bson/bson_encoder.hpp b/include/jsoncons_ext/bson/bson_encoder.hpp index c4c6117ec..160597617 100644 --- a/include/jsoncons_ext/bson/bson_encoder.hpp +++ b/include/jsoncons_ext/bson/bson_encoder.hpp @@ -572,5 +572,7 @@ class basic_bson_encoder final : public basic_json_visitor using bson_stream_encoder = basic_bson_encoder; using bson_bytes_encoder = basic_bson_encoder>>; -}} +} // namespace bson +} // namespace jsoncons + #endif // JSONCONS_EXT_BSON_BSON_ENCODER_HPP diff --git a/include/jsoncons_ext/bson/bson_error.hpp b/include/jsoncons_ext/bson/bson_error.hpp index d1be9b909..3638314f1 100644 --- a/include/jsoncons_ext/bson/bson_error.hpp +++ b/include/jsoncons_ext/bson/bson_error.hpp @@ -92,13 +92,14 @@ std::error_code make_error_code(bson_errc result) } -}} +} // namespace bson +} // namespace jsoncons namespace std { template<> struct is_error_code_enum : public true_type { }; -} +} // namespace std #endif // JSONCONS_EXT_BSON_BSON_ENCODER_HPP diff --git a/include/jsoncons_ext/bson/bson_oid.hpp b/include/jsoncons_ext/bson/bson_oid.hpp index 753e7fad9..b4509c1af 100644 --- a/include/jsoncons_ext/bson/bson_oid.hpp +++ b/include/jsoncons_ext/bson/bson_oid.hpp @@ -144,7 +144,7 @@ namespace jsoncons { namespace bson { } }; - namespace detail { +namespace detail { inline const uint16_t* get_hex_char_pairs(std::true_type) // big endian @@ -230,7 +230,7 @@ namespace jsoncons { namespace bson { data[11] = gHexCharPairs[bytes[11]]; } - } // namsepace detail +} // namespace detail template inline diff --git a/include/jsoncons_ext/bson/bson_options.hpp b/include/jsoncons_ext/bson/bson_options.hpp index 71690a400..7b62f1967 100644 --- a/include/jsoncons_ext/bson/bson_options.hpp +++ b/include/jsoncons_ext/bson/bson_options.hpp @@ -72,5 +72,7 @@ class bson_options final : public bson_decode_options, public bson_encode_option } }; -}} +} // namespace bson +} // namespace jsoncons + #endif // JSONCONS_EXT_BSON_BSON_OPTIONS_HPP diff --git a/include/jsoncons_ext/bson/bson_parser.hpp b/include/jsoncons_ext/bson/bson_parser.hpp index 7598ca776..681a8ad37 100644 --- a/include/jsoncons_ext/bson/bson_parser.hpp +++ b/include/jsoncons_ext/bson/bson_parser.hpp @@ -646,6 +646,7 @@ class basic_bson_parser : public ser_context } }; -}} +} // namespace bson +} // namespace jsoncons #endif // JSONCONS_EXT_BSON_BSON_PARSER_HPP diff --git a/include/jsoncons_ext/bson/bson_reader.hpp b/include/jsoncons_ext/bson/bson_reader.hpp index ea0b4b239..8a3d37f4c 100644 --- a/include/jsoncons_ext/bson/bson_reader.hpp +++ b/include/jsoncons_ext/bson/bson_reader.hpp @@ -83,6 +83,7 @@ class basic_bson_reader using bson_stream_reader = basic_bson_reader; using bson_bytes_reader = basic_bson_reader; -}} +} // namespace bson +} // namespace jsoncons #endif // JSONCONS_EXT_BSON_BSON_READER_HPP diff --git a/include/jsoncons_ext/bson/bson_type.hpp b/include/jsoncons_ext/bson/bson_type.hpp index a65b7906b..fe125e75f 100644 --- a/include/jsoncons_ext/bson/bson_type.hpp +++ b/include/jsoncons_ext/bson/bson_type.hpp @@ -40,6 +40,7 @@ namespace jsoncons { namespace bson { enum class bson_container_type {document, array}; -}} +} // namespace bson +} // namespace jsoncons #endif // JSONCONS_EXT_BSON_BSON_TYPE_HPP diff --git a/include/jsoncons_ext/bson/decode_bson.hpp b/include/jsoncons_ext/bson/decode_bson.hpp index c55d75937..0072d2d2e 100644 --- a/include/jsoncons_ext/bson/decode_bson.hpp +++ b/include/jsoncons_ext/bson/decode_bson.hpp @@ -198,6 +198,6 @@ namespace bson { } } // bson -} // jsoncons +} // namespace jsoncons #endif // JSONCONS_EXT_BSON_DECODE_BSON_HPP diff --git a/include/jsoncons_ext/bson/encode_bson.hpp b/include/jsoncons_ext/bson/encode_bson.hpp index 52a696d59..c3fa2dbd2 100644 --- a/include/jsoncons_ext/bson/encode_bson.hpp +++ b/include/jsoncons_ext/bson/encode_bson.hpp @@ -140,6 +140,6 @@ namespace bson { } } // bson -} // jsoncons +} // namespace jsoncons #endif // JSONCONS_EXT_BSON_DECODE_BSON_HPP diff --git a/include/jsoncons_ext/cbor/cbor_detail.hpp b/include/jsoncons_ext/cbor/cbor_detail.hpp index 7860f66ba..afa412cc4 100644 --- a/include/jsoncons_ext/cbor/cbor_detail.hpp +++ b/include/jsoncons_ext/cbor/cbor_detail.hpp @@ -89,6 +89,8 @@ size_t min_length_for_stringref(uint64_t index) return n; } -}}} +} // namespace detail +} // namespace cbor +} // namespace jsoncons #endif diff --git a/include/jsoncons_ext/cbor/cbor_encoder.hpp b/include/jsoncons_ext/cbor/cbor_encoder.hpp index 7420c6c87..06c4580bd 100644 --- a/include/jsoncons_ext/cbor/cbor_encoder.hpp +++ b/include/jsoncons_ext/cbor/cbor_encoder.hpp @@ -1740,5 +1740,7 @@ class basic_cbor_encoder final : public basic_json_visitor using cbor_stream_encoder = basic_cbor_encoder; using cbor_bytes_encoder = basic_cbor_encoder>>; -}} +} // namespace cbor +} // namespace jsoncons + #endif diff --git a/include/jsoncons_ext/cbor/cbor_error.hpp b/include/jsoncons_ext/cbor/cbor_error.hpp index 283849c10..c2193cc69 100644 --- a/include/jsoncons_ext/cbor/cbor_error.hpp +++ b/include/jsoncons_ext/cbor/cbor_error.hpp @@ -87,13 +87,14 @@ std::error_code make_error_code(cbor_errc e) } -}} +} // namespace cbor +} // namespace jsoncons namespace std { template<> struct is_error_code_enum : public true_type { }; -} +} // namespace std #endif diff --git a/include/jsoncons_ext/cbor/cbor_options.hpp b/include/jsoncons_ext/cbor/cbor_options.hpp index 5f72f1d9a..2786fcf5a 100644 --- a/include/jsoncons_ext/cbor/cbor_options.hpp +++ b/include/jsoncons_ext/cbor/cbor_options.hpp @@ -101,5 +101,7 @@ class cbor_options final : public cbor_decode_options, public cbor_encode_option } }; -}} +} // namespace cbor +} // namespace jsoncons + #endif diff --git a/include/jsoncons_ext/cbor/cbor_parser.hpp b/include/jsoncons_ext/cbor/cbor_parser.hpp index 12435b9ef..73a3b5e3f 100644 --- a/include/jsoncons_ext/cbor/cbor_parser.hpp +++ b/include/jsoncons_ext/cbor/cbor_parser.hpp @@ -1958,6 +1958,7 @@ class basic_cbor_parser : public ser_context } }; -}} +} // namespace cbor +} // namespace jsoncons #endif diff --git a/include/jsoncons_ext/csv/csv_cursor.hpp b/include/jsoncons_ext/csv/csv_cursor.hpp index 5f5dedfd8..33c9c94e5 100644 --- a/include/jsoncons_ext/csv/csv_cursor.hpp +++ b/include/jsoncons_ext/csv/csv_cursor.hpp @@ -335,7 +335,8 @@ using csv_string_cursor = basic_csv_cursor>; using wcsv_stream_cursor = basic_csv_cursor>; using wcsv_string_cursor = basic_csv_cursor>; -}} +} // namespace csv +} // namespace jsoncons #endif // JSONCONS_EXT_CSV_CSV_CURSOR_HPP diff --git a/include/jsoncons_ext/csv/csv_encoder.hpp b/include/jsoncons_ext/csv/csv_encoder.hpp index a08f9d49c..d786832ed 100644 --- a/include/jsoncons_ext/csv/csv_encoder.hpp +++ b/include/jsoncons_ext/csv/csv_encoder.hpp @@ -938,6 +938,7 @@ using csv_string_encoder = basic_csv_encoder; using wcsv_string_encoder = basic_csv_encoder>; -}} +} // namespace jsonpath +} // namespace jsoncons #endif // JSONCONS_EXT_CSV_CSV_ENCODER_HPP diff --git a/include/jsoncons_ext/csv/csv_error.hpp b/include/jsoncons_ext/csv/csv_error.hpp index a8aa1ec9c..2bf820327 100644 --- a/include/jsoncons_ext/csv/csv_error.hpp +++ b/include/jsoncons_ext/csv/csv_error.hpp @@ -70,13 +70,14 @@ std::error_code make_error_code(csv_errc result) return std::error_code(static_cast(result),csv_error_category()); } -}} +} // namespace jsonpath +} // namespace jsoncons namespace std { template<> struct is_error_code_enum : public true_type { }; -} +} // namespace std #endif // JSONCONS_EXT_CSV_CSV_ERROR_HPP diff --git a/include/jsoncons_ext/csv/csv_options.hpp b/include/jsoncons_ext/csv/csv_options.hpp index 35a37a032..c94cd978c 100644 --- a/include/jsoncons_ext/csv/csv_options.hpp +++ b/include/jsoncons_ext/csv/csv_options.hpp @@ -108,7 +108,8 @@ void parse_column_names(const std::basic_string& names, cont.push_back(buffer); buffer.clear(); } -} + +} // namespace detail template void parse_column_types(const std::basic_string& types, @@ -941,6 +942,7 @@ class basic_csv_options final : public basic_csv_decode_options, public b using csv_options = basic_csv_options; using wcsv_options = basic_csv_options; -}} +} // namespace jsonpath +} // namespace jsoncons #endif // JSONCONS_EXT_CSV_CSV_OPTIONS_HPP diff --git a/include/jsoncons_ext/csv/csv_parser.hpp b/include/jsoncons_ext/csv/csv_parser.hpp index a80b03784..0a98abb74 100644 --- a/include/jsoncons_ext/csv/csv_parser.hpp +++ b/include/jsoncons_ext/csv/csv_parser.hpp @@ -2131,7 +2131,8 @@ class basic_csv_parser : public ser_context, public virtual basic_parser_input; using wcsv_parser = basic_csv_parser; -}} +} // namespace jsonpath +} // namespace jsoncons #endif // JSONCONS_EXT_CSV_CSV_PARSER_HPP diff --git a/include/jsoncons_ext/csv/csv_reader.hpp b/include/jsoncons_ext/csv/csv_reader.hpp index 48a95ab90..e53675b39 100644 --- a/include/jsoncons_ext/csv/csv_reader.hpp +++ b/include/jsoncons_ext/csv/csv_reader.hpp @@ -181,6 +181,7 @@ namespace jsoncons { namespace csv { using csv_stream_reader = basic_csv_reader>; using wcsv_stream_reader = basic_csv_reader>; -}} +} // namespace jsonpath +} // namespace jsoncons #endif // JSONCONS_EXT_CSV_CSV_READER_HPP diff --git a/include/jsoncons_ext/jmespath/jmespath.hpp b/include/jsoncons_ext/jmespath/jmespath.hpp index 1d09ff509..c04a26252 100644 --- a/include/jsoncons_ext/jmespath/jmespath.hpp +++ b/include/jsoncons_ext/jmespath/jmespath.hpp @@ -735,7 +735,7 @@ namespace jmespath { } }; - namespace detail { +namespace detail { enum class path_state { @@ -5437,7 +5437,7 @@ namespace jmespath { } }; - } // detail +} // namespace detail template using jmespath_expression = typename jsoncons::jmespath::detail::jmespath_evaluator::jmespath_expression; diff --git a/include/jsoncons_ext/jmespath/jmespath_error.hpp b/include/jsoncons_ext/jmespath/jmespath_error.hpp index b0ac660df..761fb2014 100644 --- a/include/jsoncons_ext/jmespath/jmespath_error.hpp +++ b/include/jsoncons_ext/jmespath/jmespath_error.hpp @@ -204,13 +204,14 @@ std::error_code make_error_code(jmespath_errc result) return std::error_code(static_cast(result),jmespath_error_category()); } -}} +} // namespace jmespath +} // namespace jsoncons namespace std { template<> struct is_error_code_enum : public true_type { }; -} +} // namespace std #endif // JSONCONS_EXT_JMESPATH_JMESPATH_ERROR_HPP diff --git a/include/jsoncons_ext/jsonpatch/jsonpatch.hpp b/include/jsoncons_ext/jsonpatch/jsonpatch.hpp index 652fcd9da..180bfd95b 100644 --- a/include/jsoncons_ext/jsonpatch/jsonpatch.hpp +++ b/include/jsoncons_ext/jsonpatch/jsonpatch.hpp @@ -294,7 +294,8 @@ namespace detail { return result; } -} + +} // namespace detail template void apply_patch(Json& target, const Json& patch, std::error_code& ec) @@ -581,6 +582,7 @@ void apply_patch(Json& target, const Json& patch) } } -}} +} // namespace jsonpatch +} // namespace jsoncons #endif // JSONCONS_EXT_JSONPATCH_JSONPATCH_HPP diff --git a/include/jsoncons_ext/jsonpatch/jsonpatch_error.hpp b/include/jsoncons_ext/jsonpatch/jsonpatch_error.hpp index 1601ff0ed..eb514ad8d 100644 --- a/include/jsoncons_ext/jsonpatch/jsonpatch_error.hpp +++ b/include/jsoncons_ext/jsonpatch/jsonpatch_error.hpp @@ -72,14 +72,14 @@ namespace jsoncons { namespace jsonpatch { } } // jsonpatch -} // jsoncons +} // namespace jsoncons namespace std { template<> struct is_error_code_enum : public true_type { }; -} +} // namespace std namespace jsoncons { namespace jsonpatch { @@ -116,7 +116,8 @@ namespace jsoncons { namespace jsonpatch { return std::system_error::what(); } }; + } // jsonpatch -} // jsoncons +} // namespace jsoncons #endif // JSONCONS_EXT_JSONPATCH_JSONPATCH_ERROR_HPP diff --git a/include/jsoncons_ext/jsonpath/flatten.hpp b/include/jsoncons_ext/jsonpath/flatten.hpp index fe2f6ec2b..8886c6491 100644 --- a/include/jsoncons_ext/jsonpath/flatten.hpp +++ b/include/jsoncons_ext/jsonpath/flatten.hpp @@ -375,6 +375,8 @@ namespace jsoncons { namespace jsonpath { return result; } -}} + +} // namespace jsonpath +} // namespace jsoncons #endif // JSONCONS_EXT_JSONPATH_FLATTEN_HPP diff --git a/include/jsoncons_ext/jsonpath/json_location.hpp b/include/jsoncons_ext/jsonpath/json_location.hpp index 82581a0f0..f411ecb2e 100644 --- a/include/jsoncons_ext/jsonpath/json_location.hpp +++ b/include/jsoncons_ext/jsonpath/json_location.hpp @@ -61,8 +61,14 @@ namespace jsonpath { basic_path_element(const basic_path_element& other) = default; + basic_path_element(basic_path_element&& other) = default; + + ~basic_path_element() = default; + basic_path_element& operator=(const basic_path_element& other) = default; + basic_path_element& operator=(basic_path_element&& other) = default; + bool has_name() const { return has_name_; @@ -96,9 +102,17 @@ namespace jsonpath { { diff = name_.compare(other.name_); } + else if (index_ < other.index_) + { + diff = -1; + } + else if (index_ > other.index_) + { + diff = 1; + } else { - diff = index_ < other.index_ ? -1 : index_ > other.index_ ? 1 : 0; + diff = 0; } } return diff; @@ -521,7 +535,7 @@ namespace jsonpath { ++column_; break; case '\r': - if (p_+1 < end_input_ && *(p_+1) == '\n') + if ((p_+1 < end_input_) && (*(p_+1) == '\n')) ++p_; ++line_; column_ = 1; @@ -590,6 +604,8 @@ namespace jsonpath { : elements_(std::move(elements)) { } + + ~basic_json_location() = default; basic_json_location& operator=(const basic_json_location&) = default; @@ -643,7 +659,15 @@ namespace jsonpath { ++it1; ++it2; } - return (elements_.size() < other.elements_.size()) ? -1 : (elements_.size() == other.elements_.size()) ? 0 : 1; + if (elements_.size() < other.elements_.size()) + { + return -1; + } + if (elements_.size() > other.elements_.size()) + { + return 1; + } + return 0; } // Modifiers @@ -927,10 +951,7 @@ namespace jsonpath { { return std::make_pair(p_current,true); } - else - { - return std::make_pair(p_current, false); - } + return std::make_pair(p_current, false); } using json_location = basic_json_location; diff --git a/include/jsoncons_ext/jsonpath/jsonpath_error.hpp b/include/jsoncons_ext/jsonpath/jsonpath_error.hpp index d6f9c5325..46ad6440a 100644 --- a/include/jsoncons_ext/jsonpath/jsonpath_error.hpp +++ b/include/jsoncons_ext/jsonpath/jsonpath_error.hpp @@ -165,14 +165,14 @@ namespace jsoncons { namespace jsonpath { } } // jsonpath -} // jsoncons +} // namespace jsoncons namespace std { template<> struct is_error_code_enum : public true_type { }; -} +} // namespace std namespace jsoncons { namespace jsonpath { @@ -245,6 +245,7 @@ namespace jsoncons { namespace jsonpath { } }; -}} +} // namespace jsonpath +} // namespace jsoncons #endif // JSONCONS_EXT_JSONPATH_JSONPATH_ERROR_HPP diff --git a/include/jsoncons_ext/jsonpath/jsonpath_utilities.hpp b/include/jsoncons_ext/jsonpath/jsonpath_utilities.hpp index 2721c8c84..f4d64784e 100644 --- a/include/jsoncons_ext/jsonpath/jsonpath_utilities.hpp +++ b/include/jsoncons_ext/jsonpath/jsonpath_utilities.hpp @@ -72,6 +72,8 @@ namespace jsoncons { namespace jsonpath { } return count; } -}} + +} // namespace jsonpath +} // namespace jsoncons #endif // JSONCONS_EXT_JSONPATH_UTILITIES_HPP diff --git a/include/jsoncons_ext/jsonpointer/jsonpointer_error.hpp b/include/jsoncons_ext/jsonpointer/jsonpointer_error.hpp index dbb50a559..3cfdb53a1 100644 --- a/include/jsoncons_ext/jsonpointer/jsonpointer_error.hpp +++ b/include/jsoncons_ext/jsonpointer/jsonpointer_error.hpp @@ -108,13 +108,14 @@ std::error_code make_error_code(jsonpointer_errc result) return std::error_code(static_cast(result),jsonpointer_error_category()); } -}} +} // namespace jsonpointer +} // namespace jsoncons namespace std { template<> struct is_error_code_enum : public true_type { }; -} +} // namespace std #endif diff --git a/include/jsoncons_ext/msgpack/decode_msgpack.hpp b/include/jsoncons_ext/msgpack/decode_msgpack.hpp index f7b24ffa2..4ea834367 100644 --- a/include/jsoncons_ext/msgpack/decode_msgpack.hpp +++ b/include/jsoncons_ext/msgpack/decode_msgpack.hpp @@ -199,6 +199,6 @@ namespace msgpack { } } // msgpack -} // jsoncons +} // namespace jsoncons #endif // JSONCONS_EXT_MSGPACK_DECODE_MSGPACK_HPP diff --git a/include/jsoncons_ext/msgpack/encode_msgpack.hpp b/include/jsoncons_ext/msgpack/encode_msgpack.hpp index fc9750d0d..024071c3e 100644 --- a/include/jsoncons_ext/msgpack/encode_msgpack.hpp +++ b/include/jsoncons_ext/msgpack/encode_msgpack.hpp @@ -138,6 +138,6 @@ namespace msgpack { } } // msgpack -} // jsoncons +} // namespace jsoncons #endif // JSONCONS_EXT_MSGPACK_ENCODE_MSGPACK_HPP diff --git a/include/jsoncons_ext/msgpack/msgpack_error.hpp b/include/jsoncons_ext/msgpack/msgpack_error.hpp index 0d70ecbeb..15fab0d42 100644 --- a/include/jsoncons_ext/msgpack/msgpack_error.hpp +++ b/include/jsoncons_ext/msgpack/msgpack_error.hpp @@ -83,13 +83,14 @@ std::error_code make_error_code(msgpack_errc e) } -}} +} // namespace msgpack +} // namespace jsoncons namespace std { template<> struct is_error_code_enum : public true_type { }; -} +} // namespace std #endif // JSONCONS_EXT_MSGPACK_MSGPACK_ERROR_HPP diff --git a/include/jsoncons_ext/msgpack/msgpack_options.hpp b/include/jsoncons_ext/msgpack/msgpack_options.hpp index c4405ff40..32cdf30c4 100644 --- a/include/jsoncons_ext/msgpack/msgpack_options.hpp +++ b/include/jsoncons_ext/msgpack/msgpack_options.hpp @@ -71,6 +71,7 @@ class msgpack_options final : public msgpack_decode_options, public msgpack_enco } }; -}} +} // namespace msgpack +} // namespace jsoncons #endif // JSONCONS_EXT_MSGPACK_MSGPACK_OPTIONS_HPP diff --git a/include/jsoncons_ext/msgpack/msgpack_parser.hpp b/include/jsoncons_ext/msgpack/msgpack_parser.hpp index 24fe5d830..4d89ca236 100644 --- a/include/jsoncons_ext/msgpack/msgpack_parser.hpp +++ b/include/jsoncons_ext/msgpack/msgpack_parser.hpp @@ -744,6 +744,7 @@ class basic_msgpack_parser : public ser_context } }; -}} +} // namespace msgpack +} // namespace jsoncons #endif // JSONCONS_EXT_MSGPACK_MSGPACK_PARSER_HPP diff --git a/include/jsoncons_ext/msgpack/msgpack_reader.hpp b/include/jsoncons_ext/msgpack/msgpack_reader.hpp index c2e8e98eb..def5c6974 100644 --- a/include/jsoncons_ext/msgpack/msgpack_reader.hpp +++ b/include/jsoncons_ext/msgpack/msgpack_reader.hpp @@ -107,6 +107,7 @@ using msgpack_stream_reader = basic_msgpack_reader; -}} +} // namespace msgpack +} // namespace jsoncons #endif // JSONCONS_EXT_MSGPACK_MSGPACK_READER_HPP diff --git a/include/jsoncons_ext/ubjson/decode_ubjson.hpp b/include/jsoncons_ext/ubjson/decode_ubjson.hpp index f63711453..0deadeb02 100644 --- a/include/jsoncons_ext/ubjson/decode_ubjson.hpp +++ b/include/jsoncons_ext/ubjson/decode_ubjson.hpp @@ -198,6 +198,6 @@ namespace ubjson { } } // ubjson -} // jsoncons +} // namespace jsoncons #endif // JSONCONS_EXT_UBJSON_DECODE_UBJSON_HPP diff --git a/include/jsoncons_ext/ubjson/encode_ubjson.hpp b/include/jsoncons_ext/ubjson/encode_ubjson.hpp index f13ae1d92..9d9cf0248 100644 --- a/include/jsoncons_ext/ubjson/encode_ubjson.hpp +++ b/include/jsoncons_ext/ubjson/encode_ubjson.hpp @@ -138,6 +138,6 @@ namespace ubjson { } } // ubjson -} // jsoncons +} // namespace jsoncons #endif // JSONCONS_EXT_UBJSON_ENCODE_UBJSON_HPP diff --git a/include/jsoncons_ext/ubjson/ubjson_encoder.hpp b/include/jsoncons_ext/ubjson/ubjson_encoder.hpp index a0674a17a..6836ea070 100644 --- a/include/jsoncons_ext/ubjson/ubjson_encoder.hpp +++ b/include/jsoncons_ext/ubjson/ubjson_encoder.hpp @@ -491,6 +491,7 @@ class basic_ubjson_encoder final : public basic_json_visitor using ubjson_stream_encoder = basic_ubjson_encoder; using ubjson_bytes_encoder = basic_ubjson_encoder>>; -}} +} // namespace ubjson +} // namespace jsoncons #endif // JSONCONS_EXT_UBJSON_UBJSON_ENCODER_HPP diff --git a/include/jsoncons_ext/ubjson/ubjson_error.hpp b/include/jsoncons_ext/ubjson/ubjson_error.hpp index 4ed4a0e58..882e22621 100644 --- a/include/jsoncons_ext/ubjson/ubjson_error.hpp +++ b/include/jsoncons_ext/ubjson/ubjson_error.hpp @@ -89,13 +89,14 @@ std::error_code make_error_code(ubjson_errc e) } -}} +} // namespace ubjson +} // namespace jsoncons namespace std { template<> struct is_error_code_enum : public true_type { }; -} +} // namespace std #endif // JSONCONS_EXT_UBJSON_UBJSON_ERROR_HPP diff --git a/include/jsoncons_ext/ubjson/ubjson_options.hpp b/include/jsoncons_ext/ubjson/ubjson_options.hpp index db8681cf2..0bc3ed413 100644 --- a/include/jsoncons_ext/ubjson/ubjson_options.hpp +++ b/include/jsoncons_ext/ubjson/ubjson_options.hpp @@ -84,6 +84,7 @@ class ubjson_options final : public ubjson_decode_options, public ubjson_encode_ } }; -}} +} // namespace ubjson +} // namespace jsoncons #endif // JSONCONS_EXT_UBJSON_UBJSON_OPTIONS_HPP diff --git a/include/jsoncons_ext/ubjson/ubjson_parser.hpp b/include/jsoncons_ext/ubjson/ubjson_parser.hpp index 23f1adbc4..9422db187 100644 --- a/include/jsoncons_ext/ubjson/ubjson_parser.hpp +++ b/include/jsoncons_ext/ubjson/ubjson_parser.hpp @@ -876,6 +876,7 @@ class basic_ubjson_parser : public ser_context } }; -}} +} // namespace ubjson +} // namespace jsoncons #endif diff --git a/include/jsoncons_ext/ubjson/ubjson_reader.hpp b/include/jsoncons_ext/ubjson/ubjson_reader.hpp index 1822144f5..058e88fa0 100644 --- a/include/jsoncons_ext/ubjson/ubjson_reader.hpp +++ b/include/jsoncons_ext/ubjson/ubjson_reader.hpp @@ -83,6 +83,7 @@ using ubjson_stream_reader = basic_ubjson_reader using ubjson_bytes_reader = basic_ubjson_reader; -}} +} // namespace ubjson +} // namespace jsoncons #endif // JSONCONS_EXT_UBJSON_UBJSON_READER_HPP diff --git a/test/corelib/src/json_type_traits_container_tests.cpp b/test/corelib/src/json_type_traits_container_tests.cpp index b67936ce2..f66457fbc 100644 --- a/test/corelib/src/json_type_traits_container_tests.cpp +++ b/test/corelib/src/json_type_traits_container_tests.cpp @@ -373,7 +373,7 @@ struct json_type_traits { template <> struct is_json_type_traits_declared : public std::true_type {}; -} // jsoncons +} // namespace jsoncons TEST_CASE("own_vector json_type_traits") {