interface cleanup

This commit is contained in:
Niels 2016-08-31 17:07:35 +02:00
parent afba1d3fcb
commit 442058f8ed
10 changed files with 62 additions and 100 deletions

View file

@ -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';
}

View file

@ -1 +0,0 @@
<a target="_blank" href="http://melpon.org/wandbox/permlink/dRptmFmhvpsYB49t"><b>online</b></a>

View file

@ -1 +0,0 @@
null

View file

@ -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';
}

View file

@ -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>

View file

@ -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';
}

View file

@ -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>

View file

@ -1 +1,2 @@
null
null