Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
json
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
json
Commits
ea84a85b
Commit
ea84a85b
authored
Apr 30, 2016
by
Niels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simplified flatten/unflatten examples
parent
a21f8b0c
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
5 additions
and
25 deletions
+5
-25
README.md
README.md
+1
-1
doc/examples/flatten.cpp
doc/examples/flatten.cpp
+1
-8
doc/examples/flatten.link
doc/examples/flatten.link
+1
-1
doc/examples/flatten.output
doc/examples/flatten.output
+0
-5
doc/examples/unflatten.cpp
doc/examples/unflatten.cpp
+0
-4
doc/examples/unflatten.link
doc/examples/unflatten.link
+1
-1
doc/examples/unflatten.output
doc/examples/unflatten.output
+1
-5
No files found.
README.md
View file @
ea84a85b
...
...
@@ -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
)
.
doc/examples/flatten.cpp
View file @
ea84a85b
...
...
@@ -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'
;
}
doc/examples/flatten.link
View file @
ea84a85b
<a target="_blank" href="http://melpon.org/wandbox/permlink/skGi8b32VhI8HOgV"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/OZG9sHcJCXsScNiy"><b>online</b></a>
\ No newline at end of file
doc/examples/flatten.output
View file @
ea84a85b
...
...
@@ -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}
doc/examples/unflatten.cpp
View file @
ea84a85b
...
...
@@ -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
}
};
...
...
doc/examples/unflatten.link
View file @
ea84a85b
<a target="_blank" href="http://melpon.org/wandbox/permlink/ITqCZsXmi0I7KGYy"><b>online</b></a>
\ No newline at end of file
<a target="_blank" href="http://melpon.org/wandbox/permlink/m2UmItixDxnYs1Se"><b>online</b></a>
\ No newline at end of file
doc/examples/unflatten.output
View file @
ea84a85b
...
...
@@ -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
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment