From ea84a85b132b2e9bdf1e61aa55b657eba5e254f1 Mon Sep 17 00:00:00 2001 From: Niels Date: Sat, 30 Apr 2016 10:39:03 +0200 Subject: [PATCH] simplified flatten/unflatten examples --- README.md | 2 +- doc/examples/flatten.cpp | 9 +-------- doc/examples/flatten.link | 2 +- doc/examples/flatten.output | 5 ----- doc/examples/unflatten.cpp | 4 ---- doc/examples/unflatten.link | 2 +- doc/examples/unflatten.output | 6 +----- 7 files changed, 5 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 28794d9c..1f501b73 100644 --- a/README.md +++ b/README.md @@ -449,7 +449,7 @@ $ make $ ./json_unit "*" =============================================================================== -All tests passed (3344554 assertions in 31 test cases) +All tests passed (5568699 assertions in 31 test cases) ``` For more information, have a look at the file [.travis.yml](https://github.com/nlohmann/json/blob/master/.travis.yml). diff --git a/doc/examples/flatten.cpp b/doc/examples/flatten.cpp index 0601f8a3..ace53a21 100644 --- a/doc/examples/flatten.cpp +++ b/doc/examples/flatten.cpp @@ -20,18 +20,11 @@ int main() { "object", { {"currency", "USD"}, - {"value", 42.99}, - {"", "empty string"}, - {"/", "slash"}, - {"~", "tilde"}, - {"~1", "tilde1"} + {"value", 42.99} } } }; // call flatten() std::cout << std::setw(4) << j.flatten() << '\n'; - - // flatten for a primitive value - std::cout << j["pi"].flatten() << '\n'; } diff --git a/doc/examples/flatten.link b/doc/examples/flatten.link index 0fe78bbb..817d0627 100644 --- a/doc/examples/flatten.link +++ b/doc/examples/flatten.link @@ -1 +1 @@ -online \ No newline at end of file +online \ No newline at end of file diff --git a/doc/examples/flatten.output b/doc/examples/flatten.output index fedfc8ef..33bd4c4b 100644 --- a/doc/examples/flatten.output +++ b/doc/examples/flatten.output @@ -6,12 +6,7 @@ "/list/2": 2, "/name": "Niels", "/nothing": null, - "/object/": "empty string", "/object/currency": "USD", "/object/value": 42.99, - "/object/~0": "tilde", - "/object/~01": "tilde1", - "/object/~1": "slash", "/pi": 3.141 } -{"":3.141} diff --git a/doc/examples/unflatten.cpp b/doc/examples/unflatten.cpp index 39c674c9..e2b9b6b8 100644 --- a/doc/examples/unflatten.cpp +++ b/doc/examples/unflatten.cpp @@ -14,12 +14,8 @@ int main() {"/list/2", 2}, {"/name", "Niels"}, {"/nothing", nullptr}, - {"/object/", "empty string"}, {"/object/currency", "USD"}, {"/object/value", 42.99}, - {"/object/~0", "tilde"}, - {"/object/~01", "tilde1"}, - {"/object/~1", "slash"}, {"/pi", 3.141} }; diff --git a/doc/examples/unflatten.link b/doc/examples/unflatten.link index bc7594a0..d564ab01 100644 --- a/doc/examples/unflatten.link +++ b/doc/examples/unflatten.link @@ -1 +1 @@ -online \ No newline at end of file +online \ No newline at end of file diff --git a/doc/examples/unflatten.output b/doc/examples/unflatten.output index f57c9c9a..ed48385a 100644 --- a/doc/examples/unflatten.output +++ b/doc/examples/unflatten.output @@ -11,12 +11,8 @@ "name": "Niels", "nothing": null, "object": { - "": "empty string", - "/": "slash", "currency": "USD", - "value": 42.99, - "~": "tilde", - "~1": "tilde1" + "value": 42.99 }, "pi": 3.141 }