【问题标题】:Boost Json with null elements使用空元素提升 Json
【发布时间】:2014-01-24 22:01:13
【问题描述】:

我正在尝试将 boost ptree 与 boost json 解析器一起使用。生成 json 消息时,我可以将值设置为 true 或 false 并编译程序。

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

【问题讨论】:

    标签: c++ json boost null


    【解决方案1】:

    没有。不支持输出空值。输出布尔值也不是。所有值都以字符串、句点的形式输出。

    来自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('"');
    
        }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-12-13
      • 1970-01-01
      • 2023-02-01
      • 2021-12-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多