2014-01-24 21 views
0

我正在嘗試使用boost提升ptree和boost json解析器。在生成json消息時,我可以將值設置爲true或false並編譯程序。使用null元素提升Json

哪個關鍵字用於null?我找不到它。

回答

2

沒有。不支持輸出空值。輸出布爾值也不是。所有值都以字符串形式輸出,句點。

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

    }