带有无效元素的JSON

Boost Json with null elements

本文关键字:JSON 元素 无效      更新时间:2023-10-16

我正在尝试将Boost Ptree与Boost Json Parser一起使用。生成JSON消息时,我可以为True或False设置值并编译程序。

null使用哪个关键字?我找不到。

没有。不支持输出null。输出布尔值也不是。所有值均以字符串为单位。

来自json_parser_write.hpp

    // Value or object or array
    if (indent > 0 && pt.empty())
    {
        // Write value
        Str data = create_escapes(pt.template get_value<Str>());
        stream << Ch('"') << data << Ch('"');
    }