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
5bffc957
Unverified
Commit
5bffc957
authored
Aug 14, 2017
by
Théo DELRIEU
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add json_fwd.hpp
parent
15b6421d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
71 additions
and
54 deletions
+71
-54
Makefile
Makefile
+6
-2
src/json.hpp
src/json.hpp
+2
-52
src/json_fwd.hpp
src/json_fwd.hpp
+63
-0
No files found.
Makefile
View file @
5bffc957
.PHONY
:
pretty clean ChangeLog.md
SRCDIR
=
src
SRCS
=
${SRCDIR}
/json.hpp
\
${SRCDIR}
/json_fwd.hpp
# main target
all
:
@
echo
"ChangeLog.md - generate ChangeLog file"
@
echo
"check - compile and execute test suite"
...
...
@@ -218,10 +223,9 @@ 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
--formatted
\
src/json.hpp
test
/src/
*
.cpp
\
$(SRCS)
test
/src/
*
.cpp
\
benchmarks/src/benchmarks.cpp doc/examples/
*
.cpp
##########################################################################
# changelog
##########################################################################
...
...
src/json.hpp
View file @
5bffc957
...
...
@@ -36,7 +36,6 @@ SOFTWARE.
#include <clocale> // lconv, localeconv
#include <cmath> // isfinite, labs, ldexp, signbit
#include <cstddef> // nullptr_t, ptrdiff_t, size_t
#include <cstdint> // int64_t, uint64_t
#include <cstdlib> // abort, strtod, strtof, strtold, strtoul, strtoll, strtoull
#include <cstring> // memcpy, strlen
#include <forward_list> // forward_list
...
...
@@ -47,15 +46,13 @@ SOFTWARE.
#include <iterator> // advance, begin, back_inserter, bidirectional_iterator_tag, distance, end, inserter, iterator, iterator_traits, next, random_access_iterator_tag, reverse_iterator
#include <limits> // numeric_limits
#include <locale> // locale
#include <map> // map
#include <memory> // addressof, allocator, allocator_traits, unique_ptr
#include <numeric> // accumulate
#include <sstream> // stringstream
#include <string> // getline, stoi, string, to_string
#include <type_traits> // add_pointer, conditional, decay, enable_if, false_type, integral_constant, is_arithmetic, is_base_of, is_const, is_constructible, is_convertible, is_default_constructible, is_enum, is_floating_point, is_integral, is_nothrow_move_assignable, is_nothrow_move_constructible, is_pointer, is_reference, is_same, is_scalar, is_signed, remove_const, remove_cv, remove_pointer, remove_reference, true_type, underlying_type
#include <utility> // declval, forward, make_pair, move, pair, swap
#include <valarray> // valarray
#include <vector> // vector
#include "json_fwd.hpp"
// exclude unsupported compilers
#if defined(__clang__)
...
...
@@ -124,20 +121,6 @@ SOFTWARE.
*/
namespace
nlohmann
{
template
<
typename
=
void
,
typename
=
void
>
struct
adl_serializer
;
// forward declaration of basic_json (required to split the class)
template
<
template
<
typename
,
typename
,
typename
...
>
class
ObjectType
=
std
::
map
,
template
<
typename
,
typename
...>
class
ArrayType
=
std
::
vector
,
class
StringType
=
std
::
string
,
class
BooleanType
=
bool
,
class
NumberIntegerType
=
std
::
int64_t
,
class
NumberUnsignedType
=
std
::
uint64_t
,
class
NumberFloatType
=
double
,
template
<
typename
>
class
AllocatorType
=
std
::
allocator
,
template
<
typename
,
typename
=
void
>
class
JSONSerializer
=
adl_serializer
>
class
basic_json
;
// Ugly macros to avoid uglier copy-paste when specializing basic_json. They
// may be removed in the future once the class is split.
...
...
@@ -6896,14 +6879,6 @@ constexpr const auto& to_json = detail::static_const<detail::to_json_fn>::value;
constexpr
const
auto
&
from_json
=
detail
::
static_const
<
detail
::
from_json_fn
>::
value
;
}
/*!
@brief default JSONSerializer template argument
This serializer ignores the template arguments and uses ADL
([argument-dependent lookup](http://en.cppreference.com/w/cpp/language/adl))
for serialization.
*/
template
<
typename
,
typename
>
struct
adl_serializer
{
...
...
@@ -6940,17 +6915,6 @@ struct adl_serializer
}
};
/*!
@brief JSON Pointer
A JSON pointer defines a string syntax for identifying a specific value
within a JSON document. It can be used with functions `at` and
`operator[]`. Furthermore, JSON pointers are the base for JSON patches.
@sa [RFC 6901](https://tools.ietf.org/html/rfc6901)
@since version 2.0.0
*/
class
json_pointer
{
/// allow basic_json to access private members
...
...
@@ -14411,20 +14375,6 @@ class basic_json
/// @}
};
/////////////
// presets //
/////////////
/*!
@brief default JSON class
This type is the default specialization of the @ref basic_json class which
uses the standard template types.
@since version 1.0.0
*/
using
json
=
basic_json
<>
;
//////////////////
// json_pointer //
//////////////////
...
...
src/json_fwd.hpp
0 → 100644
View file @
5bffc957
#ifndef NLOHMANN_JSON_FWD_HPP
#define NLOHMANN_JSON_FWD_HPP
#include <cstdint> // int64_t, uint64_t
#include <map> // map
#include <memory> // addressof, allocator, allocator_traits, unique_ptr
#include <string> // getline, stoi, string, to_string
#include <vector> // vector
/*!
@brief namespace for Niels Lohmann
@see https://github.com/nlohmann
@since version 1.0.0
*/
namespace
nlohmann
{
/*!
@brief default JSONSerializer template argument
This serializer ignores the template arguments and uses ADL
([argument-dependent lookup](http://en.cppreference.com/w/cpp/language/adl))
for serialization.
*/
template
<
typename
=
void
,
typename
=
void
>
struct
adl_serializer
;
template
<
template
<
typename
U
,
typename
V
,
typename
...
Args
>
class
ObjectType
=
std
::
map
,
template
<
typename
U
,
typename
...
Args
>
class
ArrayType
=
std
::
vector
,
class
StringType
=
std
::
string
,
class
BooleanType
=
bool
,
class
NumberIntegerType
=
std
::
int64_t
,
class
NumberUnsignedType
=
std
::
uint64_t
,
class
NumberFloatType
=
double
,
template
<
typename
U
>
class
AllocatorType
=
std
::
allocator
,
template
<
typename
T
,
typename
SFINAE
=
void
>
class
JSONSerializer
=
adl_serializer
>
class
basic_json
;
/*!
@brief JSON Pointer
A JSON pointer defines a string syntax for identifying a specific value
within a JSON document. It can be used with functions `at` and
`operator[]`. Furthermore, JSON pointers are the base for JSON patches.
@sa [RFC 6901](https://tools.ietf.org/html/rfc6901)
@since version 2.0.0
*/
class
json_pointer
;
/*!
@brief default JSON class
This type is the default specialization of the @ref basic_json class which
uses the standard template types.
@since version 1.0.0
*/
using
json
=
basic_json
<>
;
}
#endif
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