interface cleanup
This commit is contained in:
parent
afba1d3fcb
commit
442058f8ed
10 changed files with 62 additions and 100 deletions
|
@ -1,12 +0,0 @@
|
|||
#include <json.hpp>
|
||||
|
||||
using json = nlohmann::json;
|
||||
|
||||
int main()
|
||||
{
|
||||
// create a JSON value with default null value
|
||||
json j;
|
||||
|
||||
// serialize the JSON null value
|
||||
std::cout << j << '\n';
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/dRptmFmhvpsYB49t"><b>online</b></a>
|
|
@ -1 +0,0 @@
|
|||
null
|
|
@ -27,7 +27,8 @@ int main()
|
|||
ss << text;
|
||||
|
||||
// create JSON from stream
|
||||
json j_complete(ss);
|
||||
json j_complete(ss); // deprecated!
|
||||
// shall be replaced by: json j_complete = json::parse(ss);
|
||||
std::cout << std::setw(4) << j_complete << "\n\n";
|
||||
|
||||
|
||||
|
@ -51,5 +52,6 @@ int main()
|
|||
|
||||
// create JSON from stream (with callback)
|
||||
json j_filtered(ss, cb);
|
||||
// shall be replaced by: json j_filtered = json::parse(ss, cb);
|
||||
std::cout << std::setw(4) << j_filtered << '\n';
|
||||
}
|
|
@ -1 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/VzSqLszbnoWE92dD"><b>online</b></a>
|
||||
<a target="_blank" href="http://melpon.org/wandbox/permlink/R6dzpKXlxrttShf7"><b>online</b></a>
|
|
@ -4,9 +4,12 @@ using json = nlohmann::json;
|
|||
|
||||
int main()
|
||||
{
|
||||
// create a JSON null value
|
||||
json j(nullptr);
|
||||
// implicitly create a JSON null value
|
||||
json j1;
|
||||
|
||||
// explicitly create a JSON null value
|
||||
json j2(nullptr);
|
||||
|
||||
// serialize the JSON null value
|
||||
std::cout << j << '\n';
|
||||
std::cout << j1 << '\n' << j2 << '\n';
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
<a target="_blank" href="http://melpon.org/wandbox/permlink/PMMpoM0ujdJDsuta"><b>online</b></a>
|
||||
<a target="_blank" href="http://melpon.org/wandbox/permlink/9Tvfs2dJBW8m8ihA"><b>online</b></a>
|
|
@ -1 +1,2 @@
|
|||
null
|
||||
null
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue