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
7254b1f6
Unverified
Commit
7254b1f6
authored
Jan 02, 2022
by
Niels Lohmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🔀
merge develop branch
parent
4703dd57
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
140 additions
and
69 deletions
+140
-69
include/nlohmann/json.hpp
include/nlohmann/json.hpp
+9
-9
single_include/nlohmann/json.hpp
single_include/nlohmann/json.hpp
+131
-60
No files found.
include/nlohmann/json.hpp
View file @
7254b1f6
...
...
@@ -1974,7 +1974,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
/// @brief access specified object element with bounds checking
/// @sa https://json.nlohmann.me/api/basic_json/at/
template
<
class
KeyT
,
typename
detail
::
enable_if_t
<
detail
::
is_usable_as_key_type
<
basic_json_t
,
KeyT
>
::
value
&&
!
std
::
is_same
<
typename
std
::
decay
<
KeyT
>::
type
,
json_pointer
>::
value
,
int
>
=
0
>
detail
::
is_usable_as_key_type
<
basic_json_t
,
KeyT
>
::
value
&&
!
std
::
is_same
<
typename
std
::
decay
<
KeyT
>::
type
,
json_pointer
>::
value
,
int
>
=
0
>
reference
at
(
const
KeyT
&
key
)
{
// at only works for objects
...
...
@@ -1994,7 +1994,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
/// @brief access specified object element with bounds checking
/// @sa https://json.nlohmann.me/api/basic_json/at/
template
<
class
KeyT
,
typename
detail
::
enable_if_t
<
detail
::
is_usable_as_key_type
<
basic_json_t
,
KeyT
>
::
value
&&
!
std
::
is_same
<
typename
std
::
decay
<
KeyT
>::
type
,
json_pointer
>::
value
,
int
>
=
0
>
detail
::
is_usable_as_key_type
<
basic_json_t
,
KeyT
>
::
value
&&
!
std
::
is_same
<
typename
std
::
decay
<
KeyT
>::
type
,
json_pointer
>::
value
,
int
>
=
0
>
const_reference
at
(
const
KeyT
&
key
)
const
{
// at only works for objects
...
...
@@ -2073,7 +2073,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
/// @brief access specified object element
/// @sa https://json.nlohmann.me/api/basic_json/operator%5B%5D/
template
<
class
KeyT
,
typename
detail
::
enable_if_t
<
detail
::
is_usable_as_key_type
<
basic_json_t
,
KeyT
>
::
value
&&
!
std
::
is_same
<
typename
std
::
decay
<
KeyT
>::
type
,
json_pointer
>::
value
,
int
>
=
0
>
detail
::
is_usable_as_key_type
<
basic_json_t
,
KeyT
>
::
value
&&
!
std
::
is_same
<
typename
std
::
decay
<
KeyT
>::
type
,
json_pointer
>::
value
,
int
>
=
0
>
reference
operator
[](
KeyT
&&
key
)
{
// implicitly convert null value to an empty object
...
...
@@ -2097,7 +2097,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
/// @brief access specified object element
/// @sa https://json.nlohmann.me/api/basic_json/operator%5B%5D/
template
<
class
KeyT
,
typename
detail
::
enable_if_t
<
detail
::
is_usable_as_key_type
<
basic_json_t
,
KeyT
>
::
value
&&
!
std
::
is_same
<
typename
std
::
decay
<
KeyT
>::
type
,
json_pointer
>::
value
,
int
>
=
0
>
detail
::
is_usable_as_key_type
<
basic_json_t
,
KeyT
>
::
value
&&
!
std
::
is_same
<
typename
std
::
decay
<
KeyT
>::
type
,
json_pointer
>::
value
,
int
>
=
0
>
const_reference
operator
[](
KeyT
&&
key
)
const
{
// operator[] only works for objects
...
...
@@ -2182,8 +2182,8 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
/// @sa https://json.nlohmann.me/api/basic_json/value/
/// using std::is_convertible in a std::enable_if will fail when using explicit conversions
template
<
class
KeyType
,
class
ValueType
,
typename
detail
::
enable_if_t
<
detail
::
is_getable
<
basic_json_t
,
ValueType
>
::
value
&&
!
std
::
is_same
<
value_t
,
ValueType
>::
value
&&
detail
::
is_usable_as_key_type
<
basic_json_t
,
KeyType
>::
value
,
int
>
=
0
>
detail
::
is_getable
<
basic_json_t
,
ValueType
>
::
value
&&
!
std
::
is_same
<
value_t
,
ValueType
>::
value
&&
detail
::
is_usable_as_key_type
<
basic_json_t
,
KeyType
>::
value
,
int
>
=
0
>
typename
std
::
decay
<
ValueType
>::
type
value
(
const
KeyType
&
key
,
ValueType
&&
default_value
)
const
{
// at only works for objects
...
...
@@ -2424,7 +2424,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
/// @brief remove element from a JSON object given a key
/// @sa https://json.nlohmann.me/api/basic_json/erase/
template
<
class
KeyT
,
typename
detail
::
enable_if_t
<
detail
::
is_usable_as_key_type
<
basic_json_t
,
KeyT
>
::
value
,
int
>
=
0
>
detail
::
is_usable_as_key_type
<
basic_json_t
,
KeyT
>
::
value
,
int
>
=
0
>
size_type
erase
(
const
KeyT
&
key
)
{
// this erase only works for objects
...
...
@@ -2492,7 +2492,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
/// @brief find an element in a JSON object
/// @sa https://json.nlohmann.me/api/basic_json/find/
template
<
class
KeyT
,
typename
detail
::
enable_if_t
<
detail
::
is_usable_as_key_type
<
basic_json_t
,
KeyT
>
::
value
,
int
>
=
0
>
detail
::
is_usable_as_key_type
<
basic_json_t
,
KeyT
>
::
value
,
int
>
=
0
>
const_iterator
find
(
const
KeyT
&
key
)
const
{
auto
result
=
cend
();
...
...
@@ -2518,7 +2518,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
/// @brief check the existence of an element in a JSON object
/// @sa https://json.nlohmann.me/api/basic_json/contains/
template
<
class
KeyT
,
typename
detail
::
enable_if_t
<
!
std
::
is_same
<
typename
std
::
decay
<
KeyT
>
::
type
,
json_pointer
>::
value
&&
detail
::
is_usable_as_key_type
<
basic_json_t
,
KeyT
>::
value
,
int
>
=
0
>
!
std
::
is_same
<
typename
std
::
decay
<
KeyT
>
::
type
,
json_pointer
>::
value
&&
detail
::
is_usable_as_key_type
<
basic_json_t
,
KeyT
>::
value
,
int
>
=
0
>
bool
contains
(
const
KeyT
&
key
)
const
{
return
is_object
()
&&
m_value
.
object
->
find
(
key
)
!=
m_value
.
object
->
end
();
...
...
single_include/nlohmann/json.hpp
View file @
7254b1f6
This diff is collapsed.
Click to expand it.
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