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
16fa85e9
Commit
16fa85e9
authored
Feb 05, 2015
by
Niels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Zwischenstand
parent
a5188b08
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
6480 additions
and
8057 deletions
+6480
-8057
.gitignore
.gitignore
+2
-1
LICENSE.MIT
LICENSE.MIT
+1
-1
Makefile.am
Makefile.am
+11
-3
configure.ac
configure.ac
+5
-1
src/json.hpp.re2c
src/json.hpp.re2c
+452
-25
test/catch.hpp
test/catch.hpp
+5996
-8024
test/unit.cpp
test/unit.cpp
+13
-2
No files found.
.gitignore
View file @
16fa85e9
...
...
@@ -47,4 +47,5 @@ libjson.a
Testing
.idea
\ No newline at end of file
.idea
utf8_test
LICENSE.MIT
View file @
16fa85e9
The library is licensed under the MIT License
<http://opensource.org/licenses/MIT>:
Copyright (c) 2013-201
4
Niels Lohmann
Copyright (c) 2013-201
5
Niels Lohmann
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
...
...
Makefile.am
View file @
16fa85e9
...
...
@@ -4,12 +4,20 @@ noinst_PROGRAMS = json_unit
FLAGS
=
-Wall
-Wextra
-pedantic
-Weffc
++
-Wcast-align
-Wcast-qual
-Wctor-dtor-privacy
-Wdisabled-optimization
-Wformat
=
2
-Winit-self
-Wmissing-declarations
-Wmissing-include-dirs
-Wold-style-cast
-Woverloaded-virtual
-Wredundant-decls
-Wshadow
-Wsign-conversion
-Wsign-promo
-Wstrict-overflow
=
5
-Wswitch
-Wundef
-Wno-unused
-Wnon-virtual-dtor
-Wreorder
json_unit_SOURCES
=
$(CORE_SOURCES)
test
/catch.hpp
test
/unit.cpp src/json.h
pp
json_unit_SOURCES
=
src/json.hpp
test
/catch.hpp
test
/unit.c
pp
json_unit_CXXFLAGS
=
$(FLAGS)
-std
=
c++11
json_unit_CPPFLAGS
=
-I
$(top_srcdir)
/src
-I
$(top_srcdir)
/test
-Dprivate
=
public
# parameters:
# -b use bit vectors
# -s nested ifs
# -i do not create #line information
# --no-generation-date suppress generation date output
src/json.hpp
:
src/json.hpp.re2c
$(AM_V_GEN)$(RE2C)
-b
-s
-i
--no-generation-date
$<
|
$(SED)
'1d'
>
$@
cppcheck
:
cppcheck
--enable
=
all
--inconclusive
--std
=
c++11 src/json.
*
cppcheck
--enable
=
all
--inconclusive
--std
=
c++11 src/json.
hpp
svn-clean
:
maintainer-clean
rm
-fr
configure INSTALL aclocal.m4 build-aux depcomp install-sh missing test-driver
...
...
@@ -21,4 +29,4 @@ 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
\
$(SOURCES)
src/json.hpp src/json.hpp.re2c
test
/unit.cpp
configure.ac
View file @
16fa85e9
AC_INIT([JSON], [3.0], [mail@nlohmann.me])
AC_CONFIG_SRCDIR([src/json.hpp])
AC_CONFIG_SRCDIR([src/json.hpp
.re2c
])
AM_INIT_AUTOMAKE([foreign subdir-objects])
AM_SILENT_RULES([yes])
AC_PROG_CXX
AC_PROG_SED
AC_PATH_PROG(RE2C, [re2c])
AM_MISSING_PROG(CPPCHECK, [cppcheck])
AM_MISSING_PROG(ASTYLE, [astyle])
AC_CONFIG_FILES(Makefile)
AC_OUTPUT
src/json.hpp
→
src/json.hpp
.re2c
View file @
16fa85e9
This diff is collapsed.
Click to expand it.
test/catch.hpp
View file @
16fa85e9
This diff is collapsed.
Click to expand it.
test/unit.cpp
View file @
16fa85e9
...
...
@@ -9,6 +9,11 @@
using
nlohmann
::
json
;
TEST_CASE
()
{
CHECK
(
json
::
parser
(
"[1,2,3,4,5,6]"
).
parse
().
dump
()
==
"[1,2,3,4,5,6]"
);
}
TEST_CASE
()
{
CHECK
(
json
::
escape_string
(
"
\\
"
)
==
"
\\\\
"
);
...
...
@@ -18,12 +23,18 @@ TEST_CASE()
CHECK
(
json
::
escape_string
(
"
\f
"
)
==
"
\\
f"
);
CHECK
(
json
::
escape_string
(
"
\b
"
)
==
"
\\
b"
);
CHECK
(
json
::
escape_string
(
"
\t
"
)
==
"
\\
t"
);
CHECK
(
json
::
escape_string
(
"Lorem ipsum
\"
dolor
\"
sit amet,
\n
consectetur
\\
adipiscing elit."
)
==
"Lorem ipsum
\\\"
dolor
\\\"
sit amet,
\\
nconsectetur
\\\\
adipiscing elit."
);
CHECK
(
json
::
escape_string
(
"the main said,
\"
cool!
\"
"
)
==
"the main said,
\\\"
cool!
\\\"
"
);
CHECK
(
json
::
escape_string
(
"
\a
"
)
==
"
\\
u0007"
);
CHECK
(
json
::
escape_string
(
"
\v
"
)
==
"
\\
u000b"
);
{
json
j
=
"AC/DC"
;
CHECK
(
j
.
dump
()
==
"
\"
AC/DC
\"
"
);
}
{
json
j
=
{
1
,
2
,
3
,
4
};
std
::
cerr
<<
j
<<
std
::
endl
;
...
...
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