Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
畅游知识海洋
json
提交
5bffc957
J
json
项目概览
畅游知识海洋
/
json
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
json
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
GitCode(gitcode.net)2024年7月9日维护升级公告
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
5bffc957
编写于
8月 14, 2017
作者:
T
Théo DELRIEU
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add json_fwd.hpp
上级
15b6421d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
71 addition
and
54 deletion
+71
-54
Makefile
Makefile
+6
-2
src/json.hpp
src/json.hpp
+2
-52
src/json_fwd.hpp
src/json_fwd.hpp
+63
-0
未找到文件。
Makefile
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录