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
fa7f1a52
Commit
fa7f1a52
authored
Dec 12, 2018
by
Jonathan Dumaresq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new unified json.hpp generated with make amalgamate
parent
ef283e0c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
21 deletions
+24
-21
json.hpp
single_include/nlohmann/json.hpp
+24
-21
No files found.
single_include/nlohmann/json.hpp
View file @
fa7f1a52
...
@@ -55,7 +55,6 @@ SOFTWARE.
...
@@ -55,7 +55,6 @@ SOFTWARE.
#include <memory> // allocator
#include <memory> // allocator
#include <string> // string
#include <string> // string
#include <vector> // vector
#include <vector> // vector
#include <cstdio>
/*!
/*!
@brief namespace for Niels Lohmann
@brief namespace for Niels Lohmann
...
@@ -2059,6 +2058,7 @@ constexpr const auto& to_json = detail::static_const<detail::to_json_fn>::value;
...
@@ -2059,6 +2058,7 @@ constexpr const auto& to_json = detail::static_const<detail::to_json_fn>::value;
#include <string> // string, char_traits
#include <string> // string, char_traits
#include <type_traits> // enable_if, is_base_of, is_pointer, is_integral, remove_pointer
#include <type_traits> // enable_if, is_base_of, is_pointer, is_integral, remove_pointer
#include <utility> // pair, declval
#include <utility> // pair, declval
#include <cstdio> //FILE *
// #include <nlohmann/detail/macro_scope.hpp>
// #include <nlohmann/detail/macro_scope.hpp>
...
@@ -2096,6 +2096,27 @@ struct input_adapter_protocol
...
@@ -2096,6 +2096,27 @@ struct input_adapter_protocol
using
input_adapter_t
=
std
::
shared_ptr
<
input_adapter_protocol
>
;
using
input_adapter_t
=
std
::
shared_ptr
<
input_adapter_protocol
>
;
/*!
/*!
Input adapter for stdio file access. This adapter read only 1 byte and do not use any
buffer. This adapter is a very low level adapter. This adapter
*/
class
file_input_adapter
:
public
input_adapter_protocol
{
public
:
explicit
file_input_adapter
(
const
FILE
*
file
)
noexcept
:
file
(
file
)
{}
std
::
char_traits
<
char
>::
int_type
get_character
()
noexcept
override
{
return
fgetc
(
const_cast
<
FILE
*>
(
file
));
}
private
:
/// the file pointer to read from
const
FILE
*
file
;
};
/*!
Input adapter for a (caching) istream. Ignores a UFT Byte Order Mark at
Input adapter for a (caching) istream. Ignores a UFT Byte Order Mark at
beginning of input. Does not support changing the underlying std::streambuf
beginning of input. Does not support changing the underlying std::streambuf
in mid-input. Maintains underlying std::istream and std::streambuf to support
in mid-input. Maintains underlying std::istream and std::streambuf to support
...
@@ -2286,22 +2307,6 @@ struct wide_string_input_helper<WideStringType, 2>
...
@@ -2286,22 +2307,6 @@ struct wide_string_input_helper<WideStringType, 2>
}
}
};
};
class
file_input_adapter
:
public
input_adapter_protocol
{
public
:
explicit
file_input_adapter
(
const
FILE
*
file
)
noexcept
:
file
(
file
)
{}
std
::
char_traits
<
char
>::
int_type
get_character
()
noexcept
override
{
return
fgetc
(
const_cast
<
FILE
*>
(
file
));
}
private
:
/// the file pointer to read from
const
FILE
*
file
;
};
template
<
typename
WideStringType
>
template
<
typename
WideStringType
>
class
wide_string_input_adapter
:
public
input_adapter_protocol
class
wide_string_input_adapter
:
public
input_adapter_protocol
{
{
...
@@ -2353,7 +2358,8 @@ class input_adapter
...
@@ -2353,7 +2358,8 @@ class input_adapter
{
{
public
:
public
:
// native support
// native support
input_adapter
(
FILE
*
file
)
:
ia
(
std
::
make_shared
<
file_input_adapter
>
(
file
))
{}
/// input adapter for input stream
/// input adapter for input stream
input_adapter
(
std
::
istream
&
i
)
input_adapter
(
std
::
istream
&
i
)
:
ia
(
std
::
make_shared
<
input_stream_adapter
>
(
i
))
{}
:
ia
(
std
::
make_shared
<
input_stream_adapter
>
(
i
))
{}
...
@@ -2371,9 +2377,6 @@ class input_adapter
...
@@ -2371,9 +2377,6 @@ class input_adapter
input_adapter
(
const
std
::
u32string
&
ws
)
input_adapter
(
const
std
::
u32string
&
ws
)
:
ia
(
std
::
make_shared
<
wide_string_input_adapter
<
std
::
u32string
>>
(
ws
))
{}
:
ia
(
std
::
make_shared
<
wide_string_input_adapter
<
std
::
u32string
>>
(
ws
))
{}
input_adapter
(
const
FILE
*
file
)
:
ia
(
std
::
make_shared
<
file_input_adapter
>
(
file
))
{}
/// input adapter for buffer
/// input adapter for buffer
template
<
typename
CharT
,
template
<
typename
CharT
,
typename
std
::
enable_if
<
typename
std
::
enable_if
<
...
...
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