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
e7a69b8d
Commit
e7a69b8d
authored
Aug 13, 2021
by
Ferry Huberts
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjust more files after actually building like the CI
Signed-off-by:
Ferry Huberts
<
ferry.huberts@pelagic.nl
>
parent
832cee5b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
154 additions
and
0 deletions
+154
-0
include/nlohmann/detail/exceptions.hpp
include/nlohmann/detail/exceptions.hpp
+8
-0
include/nlohmann/detail/input/binary_reader.hpp
include/nlohmann/detail/input/binary_reader.hpp
+16
-0
include/nlohmann/detail/iterators/iter_impl.hpp
include/nlohmann/detail/iterators/iter_impl.hpp
+32
-0
include/nlohmann/detail/json_pointer.hpp
include/nlohmann/detail/json_pointer.hpp
+39
-0
include/nlohmann/detail/output/binary_writer.hpp
include/nlohmann/detail/output/binary_writer.hpp
+15
-0
include/nlohmann/json.hpp
include/nlohmann/json.hpp
+44
-0
No files found.
include/nlohmann/detail/exceptions.hpp
View file @
e7a69b8d
...
...
@@ -102,6 +102,14 @@ class exception : public std::exception
break
;
}
case
value_t
:
:
null
:
case
value_t
:
:
string
:
case
value_t
:
:
boolean
:
case
value_t
:
:
number_integer
:
case
value_t
:
:
number_unsigned
:
case
value_t
:
:
number_float
:
case
value_t
:
:
binary
:
case
value_t
:
:
discarded
:
default:
// LCOV_EXCL_LINE
break
;
// LCOV_EXCL_LINE
}
...
...
include/nlohmann/detail/input/binary_reader.hpp
View file @
e7a69b8d
...
...
@@ -119,6 +119,7 @@ class binary_reader
result
=
parse_ubjson_internal
();
break
;
case
input_format_t
:
:
json
:
default:
// LCOV_EXCL_LINE
JSON_ASSERT
(
false
);
// NOLINT(cert-dcl03-c,hicpp-static-assert,misc-static-assert) LCOV_EXCL_LINE
}
...
...
@@ -2236,6 +2237,20 @@ class binary_reader
return
sax
->
number_unsigned
(
number_lexer
.
get_number_unsigned
());
case
token_type
:
:
value_float
:
return
sax
->
number_float
(
number_lexer
.
get_number_float
(),
std
::
move
(
number_string
));
case
token_type
:
:
uninitialized
:
case
token_type
:
:
literal_true
:
case
token_type
:
:
literal_false
:
case
token_type
:
:
literal_null
:
case
token_type
:
:
value_string
:
case
token_type
:
:
begin_array
:
case
token_type
:
:
begin_object
:
case
token_type
:
:
end_array
:
case
token_type
:
:
end_object
:
case
token_type
:
:
name_separator
:
case
token_type
:
:
value_separator
:
case
token_type
:
:
parse_error
:
case
token_type
:
:
end_of_input
:
case
token_type
:
:
literal_or_value
:
default:
return
sax
->
parse_error
(
chars_read
,
number_string
,
parse_error
::
create
(
115
,
chars_read
,
exception_message
(
input_format_t
::
ubjson
,
"invalid number text: "
+
number_lexer
.
get_token_string
(),
"high-precision number"
),
BasicJsonType
()));
}
...
...
@@ -2438,6 +2453,7 @@ class binary_reader
error_msg
+=
"BSON"
;
break
;
case
input_format_t
:
:
json
:
default:
// LCOV_EXCL_LINE
JSON_ASSERT
(
false
);
// NOLINT(cert-dcl03-c,hicpp-static-assert,misc-static-assert) LCOV_EXCL_LINE
}
...
...
include/nlohmann/detail/iterators/iter_impl.hpp
View file @
e7a69b8d
...
...
@@ -432,6 +432,7 @@ class iter_impl
break
;
}
case
value_t
:
:
null
:
case
value_t
:
:
string
:
case
value_t
:
:
boolean
:
case
value_t
:
:
number_integer
:
...
...
@@ -517,6 +518,14 @@ class iter_impl
case
value_t
:
:
array
:
return
(
m_it
.
array_iterator
<
other
.
m_it
.
array_iterator
);
case
value_t
:
:
null
:
case
value_t
:
:
string
:
case
value_t
:
:
boolean
:
case
value_t
:
:
number_integer
:
case
value_t
:
:
number_unsigned
:
case
value_t
:
:
number_float
:
case
value_t
:
:
binary
:
case
value_t
:
:
discarded
:
default:
return
(
m_it
.
primitive_iterator
<
other
.
m_it
.
primitive_iterator
);
}
...
...
@@ -568,6 +577,14 @@ class iter_impl
break
;
}
case
value_t
:
:
null
:
case
value_t
:
:
string
:
case
value_t
:
:
boolean
:
case
value_t
:
:
number_integer
:
case
value_t
:
:
number_unsigned
:
case
value_t
:
:
number_float
:
case
value_t
:
:
binary
:
case
value_t
:
:
discarded
:
default:
{
m_it
.
primitive_iterator
+=
i
;
...
...
@@ -636,6 +653,14 @@ class iter_impl
case
value_t
:
:
array
:
return
m_it
.
array_iterator
-
other
.
m_it
.
array_iterator
;
case
value_t
:
:
null
:
case
value_t
:
:
string
:
case
value_t
:
:
boolean
:
case
value_t
:
:
number_integer
:
case
value_t
:
:
number_unsigned
:
case
value_t
:
:
number_float
:
case
value_t
:
:
binary
:
case
value_t
:
:
discarded
:
default:
return
m_it
.
primitive_iterator
-
other
.
m_it
.
primitive_iterator
;
}
...
...
@@ -660,6 +685,13 @@ class iter_impl
case
value_t
:
:
null
:
JSON_THROW
(
invalid_iterator
::
create
(
214
,
"cannot get value"
,
*
m_object
));
case
value_t
:
:
string
:
case
value_t
:
:
boolean
:
case
value_t
:
:
number_integer
:
case
value_t
:
:
number_unsigned
:
case
value_t
:
:
number_float
:
case
value_t
:
:
binary
:
case
value_t
:
:
discarded
:
default:
{
if
(
JSON_HEDLEY_LIKELY
(
m_it
.
primitive_iterator
.
get_value
()
==
-
n
))
...
...
include/nlohmann/detail/json_pointer.hpp
View file @
e7a69b8d
...
...
@@ -441,6 +441,13 @@ class json_pointer
an error situation, because primitive values may only occur as
single value; that is, with an empty list of reference tokens.
*/
case
detail
:
:
value_t
::
string
:
case
detail
:
:
value_t
::
boolean
:
case
detail
:
:
value_t
::
number_integer
:
case
detail
:
:
value_t
::
number_unsigned
:
case
detail
:
:
value_t
::
number_float
:
case
detail
:
:
value_t
::
binary
:
case
detail
:
:
value_t
::
discarded
:
default:
JSON_THROW
(
detail
::
type_error
::
create
(
313
,
"invalid value to unflatten"
,
j
));
}
...
...
@@ -513,6 +520,14 @@ class json_pointer
break
;
}
case
detail
:
:
value_t
::
null
:
case
detail
:
:
value_t
::
string
:
case
detail
:
:
value_t
::
boolean
:
case
detail
:
:
value_t
::
number_integer
:
case
detail
:
:
value_t
::
number_unsigned
:
case
detail
:
:
value_t
::
number_float
:
case
detail
:
:
value_t
::
binary
:
case
detail
:
:
value_t
::
discarded
:
default:
JSON_THROW
(
detail
::
out_of_range
::
create
(
404
,
"unresolved reference token '"
+
reference_token
+
"'"
,
*
ptr
));
}
...
...
@@ -610,6 +625,14 @@ class json_pointer
break
;
}
case
detail
:
:
value_t
::
null
:
case
detail
:
:
value_t
::
string
:
case
detail
:
:
value_t
::
boolean
:
case
detail
:
:
value_t
::
number_integer
:
case
detail
:
:
value_t
::
number_unsigned
:
case
detail
:
:
value_t
::
number_float
:
case
detail
:
:
value_t
::
binary
:
case
detail
:
:
value_t
::
discarded
:
default:
JSON_THROW
(
detail
::
out_of_range
::
create
(
404
,
"unresolved reference token '"
+
reference_token
+
"'"
,
*
ptr
));
}
...
...
@@ -652,6 +675,14 @@ class json_pointer
break
;
}
case
detail
:
:
value_t
::
null
:
case
detail
:
:
value_t
::
string
:
case
detail
:
:
value_t
::
boolean
:
case
detail
:
:
value_t
::
number_integer
:
case
detail
:
:
value_t
::
number_unsigned
:
case
detail
:
:
value_t
::
number_float
:
case
detail
:
:
value_t
::
binary
:
case
detail
:
:
value_t
::
discarded
:
default:
JSON_THROW
(
detail
::
out_of_range
::
create
(
404
,
"unresolved reference token '"
+
reference_token
+
"'"
,
*
ptr
));
}
...
...
@@ -863,6 +894,14 @@ class json_pointer
break
;
}
case
detail
:
:
value_t
::
null
:
case
detail
:
:
value_t
::
string
:
case
detail
:
:
value_t
::
boolean
:
case
detail
:
:
value_t
::
number_integer
:
case
detail
:
:
value_t
::
number_unsigned
:
case
detail
:
:
value_t
::
number_float
:
case
detail
:
:
value_t
::
binary
:
case
detail
:
:
value_t
::
discarded
:
default:
{
// add primitive value with its reference string
...
...
include/nlohmann/detail/output/binary_writer.hpp
View file @
e7a69b8d
...
...
@@ -56,6 +56,15 @@ class binary_writer
break
;
}
case
value_t
:
:
null
:
case
value_t
:
:
array
:
case
value_t
:
:
string
:
case
value_t
:
:
boolean
:
case
value_t
:
:
number_integer
:
case
value_t
:
:
number_unsigned
:
case
value_t
:
:
number_float
:
case
value_t
:
:
binary
:
case
value_t
:
:
discarded
:
default:
{
JSON_THROW
(
type_error
::
create
(
317
,
"to serialize to BSON, top-level type must be object, but is "
+
std
::
string
(
j
.
type_name
()),
j
));;
...
...
@@ -363,6 +372,7 @@ class binary_writer
break
;
}
case
value_t
:
:
discarded
:
default:
break
;
}
...
...
@@ -684,6 +694,7 @@ class binary_writer
break
;
}
case
value_t
:
:
discarded
:
default:
break
;
}
...
...
@@ -888,6 +899,7 @@ class binary_writer
break
;
}
case
value_t
:
:
discarded
:
default:
break
;
}
...
...
@@ -1140,6 +1152,7 @@ class binary_writer
return
header_size
+
0ul
;
// LCOV_EXCL_START
case
value_t
:
:
discarded
:
default:
JSON_ASSERT
(
false
);
// NOLINT(cert-dcl03-c,hicpp-static-assert,misc-static-assert)
return
0ul
;
...
...
@@ -1186,6 +1199,7 @@ class binary_writer
return
write_bson_null
(
name
);
// LCOV_EXCL_START
case
value_t
:
:
discarded
:
default:
JSON_ASSERT
(
false
);
// NOLINT(cert-dcl03-c,hicpp-static-assert,misc-static-assert)
return
;
...
...
@@ -1476,6 +1490,7 @@ class binary_writer
case
value_t
:
:
object
:
return
'{'
;
case
value_t
:
:
discarded
:
default:
// discarded values
return
'N'
;
}
...
...
include/nlohmann/json.hpp
View file @
e7a69b8d
...
...
@@ -1294,6 +1294,14 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
break
;
}
case
value_t
:
:
null
:
case
value_t
:
:
string
:
case
value_t
:
:
boolean
:
case
value_t
:
:
number_integer
:
case
value_t
:
:
number_unsigned
:
case
value_t
:
:
number_float
:
case
value_t
:
:
binary
:
case
value_t
:
:
discarded
:
default:
break
;
}
...
...
@@ -2058,6 +2066,11 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
break
;
}
case
value_t
:
:
null
:
case
value_t
:
:
object
:
case
value_t
:
:
array
:
case
value_t
:
:
binary
:
case
value_t
:
:
discarded
:
default:
break
;
}
...
...
@@ -2114,6 +2127,8 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
break
;
}
case
value_t
:
:
null
:
case
value_t
:
:
discarded
:
default:
JSON_THROW
(
invalid_iterator
::
create
(
206
,
"cannot construct with iterators from "
+
std
::
string
(
first
.
m_object
->
type_name
()),
*
first
.
m_object
));
}
...
...
@@ -4357,6 +4372,8 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
break
;
}
case
value_t
:
:
null
:
case
value_t
:
:
discarded
:
default:
JSON_THROW
(
type_error
::
create
(
307
,
"cannot use erase() with "
+
std
::
string
(
type_name
()),
*
this
));
}
...
...
@@ -5112,6 +5129,13 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
return
m_value
.
object
->
empty
();
}
case
value_t
:
:
string
:
case
value_t
:
:
boolean
:
case
value_t
:
:
number_integer
:
case
value_t
:
:
number_unsigned
:
case
value_t
:
:
number_float
:
case
value_t
:
:
binary
:
case
value_t
:
:
discarded
:
default:
{
// all other types are nonempty
...
...
@@ -5372,6 +5396,8 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
break
;
}
case
value_t
:
:
null
:
case
value_t
:
:
discarded
:
default:
break
;
}
...
...
@@ -6342,6 +6368,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
case
value_t
:
:
binary
:
return
*
lhs
.
m_value
.
binary
==
*
rhs
.
m_value
.
binary
;
case
value_t
:
:
discarded
:
default:
return
false
;
}
...
...
@@ -6508,6 +6535,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
case
value_t
:
:
binary
:
return
(
*
lhs
.
m_value
.
binary
)
<
(
*
rhs
.
m_value
.
binary
);
case
value_t
:
:
discarded
:
default:
return
false
;
}
...
...
@@ -8468,6 +8496,13 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
}
// if there exists a parent it cannot be primitive
case
value_t
:
:
string
:
case
value_t
:
:
boolean
:
case
value_t
:
:
number_integer
:
case
value_t
:
:
number_unsigned
:
case
value_t
:
:
number_float
:
case
value_t
:
:
binary
:
case
value_t
:
:
discarded
:
default:
// LCOV_EXCL_LINE
JSON_ASSERT
(
false
);
// NOLINT(cert-dcl03-c,hicpp-static-assert,misc-static-assert) LCOV_EXCL_LINE
}
...
...
@@ -8627,6 +8662,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
break
;
}
case
patch_operations
:
:
invalid
:
default:
{
// op must be "add", "remove", "replace", "move", "copy", or
...
...
@@ -8783,6 +8819,14 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
break
;
}
case
value_t
:
:
null
:
case
value_t
:
:
string
:
case
value_t
:
:
boolean
:
case
value_t
:
:
number_integer
:
case
value_t
:
:
number_unsigned
:
case
value_t
:
:
number_float
:
case
value_t
:
:
binary
:
case
value_t
:
:
discarded
:
default:
{
// both primitive type: replace value
...
...
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