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
d047b3d4
Unverified
Commit
d047b3d4
authored
Jul 16, 2020
by
Niels Lohmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🚨
remove linter warning
parent
26196f25
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
80 deletions
+16
-80
input_adapters.hpp
include/nlohmann/detail/input/input_adapters.hpp
+2
-2
json_sax.hpp
include/nlohmann/detail/input/json_sax.hpp
+6
-38
json.hpp
single_include/nlohmann/json.hpp
+8
-40
No files found.
include/nlohmann/detail/input/input_adapters.hpp
View file @
d047b3d4
...
@@ -36,7 +36,7 @@ class file_input_adapter
...
@@ -36,7 +36,7 @@ class file_input_adapter
using
char_type
=
char
;
using
char_type
=
char
;
JSON_HEDLEY_NON_NULL
(
2
)
JSON_HEDLEY_NON_NULL
(
2
)
explicit
file_input_adapter
(
std
::
FILE
*
f
)
noexcept
explicit
file_input_adapter
(
std
::
FILE
*
f
)
noexcept
:
m_file
(
f
)
:
m_file
(
f
)
{}
{}
...
@@ -90,7 +90,7 @@ class input_stream_adapter
...
@@ -90,7 +90,7 @@ class input_stream_adapter
input_stream_adapter
&
operator
=
(
input_stream_adapter
&
)
=
delete
;
input_stream_adapter
&
operator
=
(
input_stream_adapter
&
)
=
delete
;
input_stream_adapter
&
operator
=
(
input_stream_adapter
&&
rhs
)
=
delete
;
input_stream_adapter
&
operator
=
(
input_stream_adapter
&&
rhs
)
=
delete
;
input_stream_adapter
(
input_stream_adapter
&&
rhs
)
:
is
(
rhs
.
is
),
sb
(
rhs
.
sb
)
input_stream_adapter
(
input_stream_adapter
&&
rhs
)
noexcept
:
is
(
rhs
.
is
),
sb
(
rhs
.
sb
)
{
{
rhs
.
is
=
nullptr
;
rhs
.
is
=
nullptr
;
rhs
.
sb
=
nullptr
;
rhs
.
sb
=
nullptr
;
...
...
include/nlohmann/detail/input/json_sax.hpp
View file @
d047b3d4
...
@@ -258,30 +258,14 @@ class json_sax_dom_parser
...
@@ -258,30 +258,14 @@ class json_sax_dom_parser
return
true
;
return
true
;
}
}
template
<
class
Exception
>
bool
parse_error
(
std
::
size_t
/*unused*/
,
const
std
::
string
&
/*unused*/
,
bool
parse_error
(
std
::
size_t
/*unused*/
,
const
std
::
string
&
/*unused*/
,
const
detail
::
e
xception
&
ex
)
const
E
xception
&
ex
)
{
{
errored
=
true
;
errored
=
true
;
if
(
allow_exceptions
)
if
(
allow_exceptions
)
{
{
// determine the proper exception type from the id
JSON_THROW
(
ex
);
switch
((
ex
.
id
/
100
)
%
100
)
{
case
1
:
JSON_THROW
(
*
dynamic_cast
<
const
detail
::
parse_error
*>
(
&
ex
));
case
4
:
JSON_THROW
(
*
dynamic_cast
<
const
detail
::
out_of_range
*>
(
&
ex
));
// LCOV_EXCL_START
case
2
:
JSON_THROW
(
*
dynamic_cast
<
const
detail
::
invalid_iterator
*>
(
&
ex
));
case
3
:
JSON_THROW
(
*
dynamic_cast
<
const
detail
::
type_error
*>
(
&
ex
));
case
5
:
JSON_THROW
(
*
dynamic_cast
<
const
detail
::
other_error
*>
(
&
ex
));
default:
JSON_ASSERT
(
false
);
// LCOV_EXCL_STOP
}
}
}
return
false
;
return
false
;
}
}
...
@@ -512,30 +496,14 @@ class json_sax_dom_callback_parser
...
@@ -512,30 +496,14 @@ class json_sax_dom_callback_parser
return
true
;
return
true
;
}
}
template
<
class
Exception
>
bool
parse_error
(
std
::
size_t
/*unused*/
,
const
std
::
string
&
/*unused*/
,
bool
parse_error
(
std
::
size_t
/*unused*/
,
const
std
::
string
&
/*unused*/
,
const
detail
::
e
xception
&
ex
)
const
E
xception
&
ex
)
{
{
errored
=
true
;
errored
=
true
;
if
(
allow_exceptions
)
if
(
allow_exceptions
)
{
{
// determine the proper exception type from the id
JSON_THROW
(
ex
);
switch
((
ex
.
id
/
100
)
%
100
)
{
case
1
:
JSON_THROW
(
*
dynamic_cast
<
const
detail
::
parse_error
*>
(
&
ex
));
case
4
:
JSON_THROW
(
*
dynamic_cast
<
const
detail
::
out_of_range
*>
(
&
ex
));
// LCOV_EXCL_START
case
2
:
JSON_THROW
(
*
dynamic_cast
<
const
detail
::
invalid_iterator
*>
(
&
ex
));
case
3
:
JSON_THROW
(
*
dynamic_cast
<
const
detail
::
type_error
*>
(
&
ex
));
case
5
:
JSON_THROW
(
*
dynamic_cast
<
const
detail
::
other_error
*>
(
&
ex
));
default:
JSON_ASSERT
(
false
);
// LCOV_EXCL_STOP
}
}
}
return
false
;
return
false
;
}
}
...
...
single_include/nlohmann/json.hpp
View file @
d047b3d4
...
@@ -4500,7 +4500,7 @@ class file_input_adapter
...
@@ -4500,7 +4500,7 @@ class file_input_adapter
using
char_type
=
char
;
using
char_type
=
char
;
JSON_HEDLEY_NON_NULL
(
2
)
JSON_HEDLEY_NON_NULL
(
2
)
explicit
file_input_adapter
(
std
::
FILE
*
f
)
noexcept
explicit
file_input_adapter
(
std
::
FILE
*
f
)
noexcept
:
m_file
(
f
)
:
m_file
(
f
)
{}
{}
...
@@ -4554,7 +4554,7 @@ class input_stream_adapter
...
@@ -4554,7 +4554,7 @@ class input_stream_adapter
input_stream_adapter
&
operator
=
(
input_stream_adapter
&
)
=
delete
;
input_stream_adapter
&
operator
=
(
input_stream_adapter
&
)
=
delete
;
input_stream_adapter
&
operator
=
(
input_stream_adapter
&&
rhs
)
=
delete
;
input_stream_adapter
&
operator
=
(
input_stream_adapter
&&
rhs
)
=
delete
;
input_stream_adapter
(
input_stream_adapter
&&
rhs
)
:
is
(
rhs
.
is
),
sb
(
rhs
.
sb
)
input_stream_adapter
(
input_stream_adapter
&&
rhs
)
noexcept
:
is
(
rhs
.
is
),
sb
(
rhs
.
sb
)
{
{
rhs
.
is
=
nullptr
;
rhs
.
is
=
nullptr
;
rhs
.
sb
=
nullptr
;
rhs
.
sb
=
nullptr
;
...
@@ -5180,30 +5180,14 @@ class json_sax_dom_parser
...
@@ -5180,30 +5180,14 @@ class json_sax_dom_parser
return
true
;
return
true
;
}
}
template
<
class
Exception
>
bool
parse_error
(
std
::
size_t
/*unused*/
,
const
std
::
string
&
/*unused*/
,
bool
parse_error
(
std
::
size_t
/*unused*/
,
const
std
::
string
&
/*unused*/
,
const
detail
::
e
xception
&
ex
)
const
E
xception
&
ex
)
{
{
errored
=
true
;
errored
=
true
;
if
(
allow_exceptions
)
if
(
allow_exceptions
)
{
{
// determine the proper exception type from the id
JSON_THROW
(
ex
);
switch
((
ex
.
id
/
100
)
%
100
)
{
case
1
:
JSON_THROW
(
*
dynamic_cast
<
const
detail
::
parse_error
*>
(
&
ex
));
case
4
:
JSON_THROW
(
*
dynamic_cast
<
const
detail
::
out_of_range
*>
(
&
ex
));
// LCOV_EXCL_START
case
2
:
JSON_THROW
(
*
dynamic_cast
<
const
detail
::
invalid_iterator
*>
(
&
ex
));
case
3
:
JSON_THROW
(
*
dynamic_cast
<
const
detail
::
type_error
*>
(
&
ex
));
case
5
:
JSON_THROW
(
*
dynamic_cast
<
const
detail
::
other_error
*>
(
&
ex
));
default:
JSON_ASSERT
(
false
);
// LCOV_EXCL_STOP
}
}
}
return
false
;
return
false
;
}
}
...
@@ -5434,30 +5418,14 @@ class json_sax_dom_callback_parser
...
@@ -5434,30 +5418,14 @@ class json_sax_dom_callback_parser
return
true
;
return
true
;
}
}
template
<
class
Exception
>
bool
parse_error
(
std
::
size_t
/*unused*/
,
const
std
::
string
&
/*unused*/
,
bool
parse_error
(
std
::
size_t
/*unused*/
,
const
std
::
string
&
/*unused*/
,
const
detail
::
e
xception
&
ex
)
const
E
xception
&
ex
)
{
{
errored
=
true
;
errored
=
true
;
if
(
allow_exceptions
)
if
(
allow_exceptions
)
{
{
// determine the proper exception type from the id
JSON_THROW
(
ex
);
switch
((
ex
.
id
/
100
)
%
100
)
{
case
1
:
JSON_THROW
(
*
dynamic_cast
<
const
detail
::
parse_error
*>
(
&
ex
));
case
4
:
JSON_THROW
(
*
dynamic_cast
<
const
detail
::
out_of_range
*>
(
&
ex
));
// LCOV_EXCL_START
case
2
:
JSON_THROW
(
*
dynamic_cast
<
const
detail
::
invalid_iterator
*>
(
&
ex
));
case
3
:
JSON_THROW
(
*
dynamic_cast
<
const
detail
::
type_error
*>
(
&
ex
));
case
5
:
JSON_THROW
(
*
dynamic_cast
<
const
detail
::
other_error
*>
(
&
ex
));
default:
JSON_ASSERT
(
false
);
// LCOV_EXCL_STOP
}
}
}
return
false
;
return
false
;
}
}
...
...
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