diff --git a/.github/labeler.yml b/.github/labeler.yml index 5708f84f5..7884e69fb 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -45,6 +45,23 @@ labels: - label: "aspect: binary formats" title: "(?i)(bson|cbor|msgpack|messagepack|ubjson|bjdata|bon8|binary format)" +- label: "aspect: json_view" + files: + - "include/nlohmann/json_view\\.hpp" + - "include/nlohmann/detail/view/.*" + - "single_include/nlohmann/json_view\\.hpp" + - "tests/src/unit-json_view.*" + - "tests/src/fuzzer-parse_json_view\\.cpp" + - "tools/amalgamate/config_json_view\\.json" + - "docs/mkdocs/docs/features/json_view\\.md" + - "docs/mkdocs/docs/api/basic_json_(document|view)/.*" + - "docs/mkdocs/docs/api/(ordered_)?json_(document|view)\\.md" + - "docs/mkdocs/docs/examples/(basic_json_(document|view)__|(ordered_)?json_(document|view)).*" + - "tests/benchmarks/src/benchmarks_view\\.cpp" + +- label: "aspect: json_view" + title: "(?i)(json_view|json_document|zero-copy)" + - label: "python" files: - "\\.py$" diff --git a/.github/workflows/check_amalgamation.yml b/.github/workflows/check_amalgamation.yml index 670269cbb..5a7efb07f 100644 --- a/.github/workflows/check_amalgamation.yml +++ b/.github/workflows/check_amalgamation.yml @@ -67,12 +67,13 @@ jobs: python3 $TOOL_DIR/amalgamate.py -c $TOOL_DIR/config_json.json -s . python3 $TOOL_DIR/amalgamate.py -c $TOOL_DIR/config_json_fwd.json -s . + python3 $TOOL_DIR/amalgamate.py -c $TOOL_DIR/config_json_view.json -s . # the header list of the Bazel "json" target must match the files in include/ cmake -P cmake/scripts/gen_bazel_build_file.cmake ${{ github.workspace }}/venv/bin/astyle --project=tools/astyle/.astylerc --suffix=none --quiet \ - $INCLUDE_DIR/json.hpp $INCLUDE_DIR/json_fwd.hpp + $INCLUDE_DIR/json.hpp $INCLUDE_DIR/json_fwd.hpp $INCLUDE_DIR/json_view.hpp # fail loudly if a directory is renamed or removed: find would only warn # about the missing path and silently drop its files from the check diff --git a/BUILD.bazel b/BUILD.bazel index 6d98715aa..86f420279 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -92,6 +92,7 @@ cc_library( name = "singleheader-json", hdrs = [ "single_include/nlohmann/json.hpp", + "single_include/nlohmann/json_view.hpp", ], includes = ["single_include"], visibility = ["//visibility:public"], diff --git a/cmake/ci.cmake b/cmake/ci.cmake index f7695c36e..97e201036 100644 --- a/cmake/ci.cmake +++ b/cmake/ci.cmake @@ -373,9 +373,10 @@ file(GLOB_RECURSE INDENT_FILES set(include_dir ${PROJECT_SOURCE_DIR}/single_include/nlohmann) set(tool_dir ${PROJECT_SOURCE_DIR}/tools/amalgamate) add_custom_target(ci_test_amalgamation - COMMAND rm -fr ${include_dir}/json.hpp~ ${include_dir}/json_fwd.hpp~ + COMMAND rm -fr ${include_dir}/json.hpp~ ${include_dir}/json_fwd.hpp~ ${include_dir}/json_view.hpp~ COMMAND cp ${include_dir}/json.hpp ${include_dir}/json.hpp~ COMMAND cp ${include_dir}/json_fwd.hpp ${include_dir}/json_fwd.hpp~ + COMMAND cp ${include_dir}/json_view.hpp ${include_dir}/json_view.hpp~ COMMAND ${Python3_EXECUTABLE} -mvenv venv_astyle COMMAND venv_astyle/bin/pip3 --quiet install -r ${CMAKE_SOURCE_DIR}/tools/astyle/requirements.txt @@ -383,10 +384,12 @@ add_custom_target(ci_test_amalgamation COMMAND ${Python3_EXECUTABLE} ${tool_dir}/amalgamate.py -c ${tool_dir}/config_json.json -s . COMMAND ${Python3_EXECUTABLE} ${tool_dir}/amalgamate.py -c ${tool_dir}/config_json_fwd.json -s . - COMMAND venv_astyle/bin/astyle --project=tools/astyle/.astylerc --suffix=none ${include_dir}/json.hpp ${include_dir}/json_fwd.hpp + COMMAND ${Python3_EXECUTABLE} ${tool_dir}/amalgamate.py -c ${tool_dir}/config_json_view.json -s . + COMMAND venv_astyle/bin/astyle --project=tools/astyle/.astylerc --suffix=none ${include_dir}/json.hpp ${include_dir}/json_fwd.hpp ${include_dir}/json_view.hpp COMMAND diff ${include_dir}/json.hpp~ ${include_dir}/json.hpp COMMAND diff ${include_dir}/json_fwd.hpp~ ${include_dir}/json_fwd.hpp + COMMAND diff ${include_dir}/json_view.hpp~ ${include_dir}/json_view.hpp COMMAND venv_astyle/bin/astyle --project=tools/astyle/.astylerc --suffix=orig ${INDENT_FILES} COMMAND for FILE in `find . -name '*.orig'`\; do false \; done diff --git a/cmake/scripts/gen_bazel_build_file.cmake b/cmake/scripts/gen_bazel_build_file.cmake index a781a2e3f..04c66823c 100644 --- a/cmake/scripts/gen_bazel_build_file.cmake +++ b/cmake/scripts/gen_bazel_build_file.cmake @@ -48,6 +48,7 @@ cc_library( name = "singleheader-json", hdrs = [ "single_include/nlohmann/json.hpp", + "single_include/nlohmann/json_view.hpp", ], includes = ["single_include"], visibility = ["//visibility:public"], diff --git a/meson.build b/meson.build index a2d6e31a2..dbb5607fe 100644 --- a/meson.build +++ b/meson.build @@ -15,6 +15,7 @@ nlohmann_json_multiple_headers = declare_dependency( if not meson.is_subproject() install_headers('single_include/nlohmann/json.hpp', subdir: 'nlohmann') install_headers('single_include/nlohmann/json_fwd.hpp', subdir: 'nlohmann') +install_headers('single_include/nlohmann/json_view.hpp', subdir: 'nlohmann') pkgc = import('pkgconfig') pkgc.generate(name: 'nlohmann_json',