Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
json
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
json
Commits
16fa85e9
Commit
16fa85e9
authored
Feb 05, 2015
by
Niels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Zwischenstand
parent
a5188b08
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
32 additions
and
9 deletions
+32
-9
.gitignore
.gitignore
+2
-2
LICENSE.MIT
LICENSE.MIT
+1
-1
Makefile.am
Makefile.am
+11
-3
configure.ac
configure.ac
+5
-1
json.hpp.re2c
src/json.hpp.re2c
+0
-0
catch.hpp
test/catch.hpp
+0
-0
unit.cpp
test/unit.cpp
+13
-2
No files found.
.gitignore
View file @
16fa85e9
...
@@ -47,4 +47,5 @@ libjson.a
...
@@ -47,4 +47,5 @@ libjson.a
Testing
Testing
.idea
.idea
\ No newline at end of file
utf8_test
LICENSE.MIT
View file @
16fa85e9
The library is licensed under the MIT License
The library is licensed under the MIT License
<http://opensource.org/licenses/MIT>:
<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
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
this software and associated documentation files (the "Software"), to deal in
...
...
Makefile.am
View file @
16fa85e9
...
@@ -4,12 +4,20 @@ noinst_PROGRAMS = json_unit
...
@@ -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
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_CXXFLAGS
=
$(FLAGS)
-std
=
c++11
json_unit_CPPFLAGS
=
-I
$(top_srcdir)
/src
-I
$(top_srcdir)
/test
-Dprivate
=
public
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
:
cppcheck
--enable
=
all
--inconclusive
--std
=
c++11 src/json.
*
cppcheck
--enable
=
all
--inconclusive
--std
=
c++11 src/json.
hpp
svn-clean
:
maintainer-clean
svn-clean
:
maintainer-clean
rm
-fr
configure INSTALL aclocal.m4 build-aux depcomp install-sh missing test-driver
rm
-fr
configure INSTALL aclocal.m4 build-aux depcomp install-sh missing test-driver
...
@@ -21,4 +29,4 @@ pretty:
...
@@ -21,4 +29,4 @@ pretty:
--indent-col1-comments
--pad-oper
--pad-header
--align-pointer
=
type
\
--indent-col1-comments
--pad-oper
--pad-header
--align-pointer
=
type
\
--align-reference
=
type
--add-brackets
--convert-tabs
--close-templates
\
--align-reference
=
type
--add-brackets
--convert-tabs
--close-templates
\
--lineend
=
linux
--preserve-date
--suffix
=
none
\
--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_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_INIT_AUTOMAKE([foreign subdir-objects])
AM_SILENT_RULES([yes])
AM_SILENT_RULES([yes])
AC_PROG_CXX
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_CONFIG_FILES(Makefile)
AC_OUTPUT
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 source diff could not be displayed because it is too large. You can
view the blob
instead.
test/unit.cpp
View file @
16fa85e9
...
@@ -11,6 +11,11 @@ using nlohmann::json;
...
@@ -11,6 +11,11 @@ using nlohmann::json;
TEST_CASE
()
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
(
"
\\
"
)
==
"
\\\\
"
);
CHECK
(
json
::
escape_string
(
"
\\
"
)
==
"
\\\\
"
);
CHECK
(
json
::
escape_string
(
"
\"
"
)
==
"
\\\"
"
);
CHECK
(
json
::
escape_string
(
"
\"
"
)
==
"
\\\"
"
);
CHECK
(
json
::
escape_string
(
"
\n
"
)
==
"
\\
n"
);
CHECK
(
json
::
escape_string
(
"
\n
"
)
==
"
\\
n"
);
...
@@ -18,12 +23,18 @@ TEST_CASE()
...
@@ -18,12 +23,18 @@ TEST_CASE()
CHECK
(
json
::
escape_string
(
"
\f
"
)
==
"
\\
f"
);
CHECK
(
json
::
escape_string
(
"
\f
"
)
==
"
\\
f"
);
CHECK
(
json
::
escape_string
(
"
\b
"
)
==
"
\\
b"
);
CHECK
(
json
::
escape_string
(
"
\b
"
)
==
"
\\
b"
);
CHECK
(
json
::
escape_string
(
"
\t
"
)
==
"
\\
t"
);
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"
;
json
j
=
"AC/DC"
;
CHECK
(
j
.
dump
()
==
"
\"
AC/DC
\"
"
);
CHECK
(
j
.
dump
()
==
"
\"
AC/DC
\"
"
);
}
}
{
{
json
j
=
{
1
,
2
,
3
,
4
};
json
j
=
{
1
,
2
,
3
,
4
};
std
::
cerr
<<
j
<<
std
::
endl
;
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