mirror of
https://github.com/nlohmann/json.git
synced 2026-10-25 15:28:54 +00:00
basic_json_document and basic_json_view take a view_mode (read_only, the default, or editable) instead of a bool: basic_json_document<json, true> did not say what true means. The shortcut aliases are unchanged. The kind of a node is a node_kind (the value_t values plus link, 10 as before), which removes the static_cast<std::uint8_t>(value_t::...) of every comparison. The node and image layouts are unchanged. Signed-off-by: Niels Lohmann <mail@nlohmann.me>
28 lines
739 B
C++
28 lines
739 B
C++
// __ _____ _____ _____
|
|
// __| | __| | | | JSON for Modern C++
|
|
// | | |__ | | | | | | version 3.12.0
|
|
// |_____|_____|_____|_|___| https://github.com/nlohmann/json
|
|
//
|
|
// SPDX-FileCopyrightText: 2013-2026 Niels Lohmann <https://nlohmann.me>
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
#pragma once
|
|
|
|
#include <cstdint> // uint8_t
|
|
|
|
#include <nlohmann/json.hpp>
|
|
|
|
NLOHMANN_JSON_NAMESPACE_BEGIN
|
|
|
|
/// whether a basic_json_document and its views can be edited
|
|
enum class view_mode : std::uint8_t
|
|
{
|
|
read_only, ///< parsed once, then only read (the default)
|
|
editable, ///< also has set(), push_back(), insert(), and erase()
|
|
};
|
|
|
|
template<typename BasicJsonType, view_mode Mode>
|
|
class basic_json_view;
|
|
|
|
NLOHMANN_JSON_NAMESPACE_END
|