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
c85dbef9
Commit
c85dbef9
authored
Jun 21, 2015
by
Niels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more documentation
parent
770b9820
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
441 additions
and
85 deletions
+441
-85
Makefile
Makefile
+1
-1
doc/examples/basic_json__string_t.cpp
doc/examples/basic_json__string_t.cpp
+15
-0
doc/examples/basic_json__string_t.output
doc/examples/basic_json__string_t.output
+1
-0
doc/examples/basic_json__string_t_value_type.cpp
doc/examples/basic_json__string_t_value_type.cpp
+12
-0
doc/examples/basic_json__string_t_value_type.output
doc/examples/basic_json__string_t_value_type.output
+1
-0
doc/examples/operator_serialize.cpp
doc/examples/operator_serialize.cpp
+18
-0
doc/examples/operator_serialize.output
doc/examples/operator_serialize.output
+17
-0
src/json.hpp
src/json.hpp
+188
-42
src/json.hpp.re2c
src/json.hpp.re2c
+188
-42
No files found.
Makefile
View file @
c85dbef9
...
...
@@ -46,7 +46,7 @@ pretty:
--indent-col1-comments
--pad-oper
--pad-header
--align-pointer
=
type
\
--align-reference
=
type
--add-brackets
--convert-tabs
--close-templates
\
--lineend
=
linux
--preserve-date
--suffix
=
none
\
src/json.hpp src/json.hpp.re2c
test
/unit.cpp benchmarks/benchmarks.cpp doc
s
/examples/
*
.cpp
src/json.hpp src/json.hpp.re2c
test
/unit.cpp benchmarks/benchmarks.cpp doc/examples/
*
.cpp
##########################################################################
...
...
doc/examples/basic_json__string_t.cpp
0 → 100644
View file @
c85dbef9
#include <json.hpp>
using
namespace
nlohmann
;
int
main
()
{
// create an string_t value
json
::
string_t
value
=
"The quick brown fox jumps over the lazy doc"
;
// create a JSON string from the value
json
j
(
value
);
// serialize the JSON array
std
::
cout
<<
j
<<
'\n'
;
}
doc/examples/basic_json__string_t.output
0 → 100644
View file @
c85dbef9
"The quick brown fox jumps over the lazy doc"
doc/examples/basic_json__string_t_value_type.cpp
0 → 100644
View file @
c85dbef9
#include <json.hpp>
using
namespace
nlohmann
;
int
main
()
{
// create a JSON string directly from a string literal
json
j
(
"The quick brown fox jumps over the lazy doc"
);
// serialize the JSON array
std
::
cout
<<
j
<<
'\n'
;
}
doc/examples/basic_json__string_t_value_type.output
0 → 100644
View file @
c85dbef9
"The quick brown fox jumps over the lazy doc"
doc/examples/operator_serialize.cpp
0 → 100644
View file @
c85dbef9
#include <json.hpp>
using
namespace
nlohmann
;
int
main
()
{
// create JSON values
json
j_object
=
{{
"one"
,
1
},
{
"two"
,
2
}};
json
j_array
=
{
1
,
2
,
4
,
8
,
16
};
// serialize without indentation
std
::
cout
<<
j_object
<<
"
\n\n
"
;
std
::
cout
<<
j_array
<<
"
\n\n
"
;
// serialize with indentation
std
::
cout
<<
std
::
setw
(
4
)
<<
j_object
<<
"
\n\n
"
;
std
::
cout
<<
std
::
setw
(
2
)
<<
j_array
<<
"
\n\n
"
;
}
doc/examples/operator_serialize.output
0 → 100644
View file @
c85dbef9
{"one":1,"two":2}
[1,2,4,8,16]
{
"one": 1,
"two": 2
}
[
1,
2,
4,
8,
16
]
src/json.hpp
View file @
c85dbef9
This diff is collapsed.
Click to expand it.
src/json.hpp.re2c
View file @
c85dbef9
This diff is collapsed.
Click to expand it.
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