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
164e0e54
Commit
164e0e54
authored
Feb 25, 2019
by
garethsb-sony
Committed by
gbsylveg
Feb 25, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename private json_pointer::is_root as public json_pointer::empty for…
Rename private json_pointer::is_root as public json_pointer::empty for consistency with std::filesystem::path
parent
5da757bb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
10 deletions
+10
-10
json_pointer.hpp
include/nlohmann/detail/json_pointer.hpp
+4
-4
json.hpp
include/nlohmann/json.hpp
+1
-1
json.hpp
single_include/nlohmann/json.hpp
+5
-5
No files found.
include/nlohmann/detail/json_pointer.hpp
View file @
164e0e54
...
...
@@ -149,7 +149,7 @@ class json_pointer
*/
std
::
string
pop_back
()
{
if
(
JSON_UNLIKELY
(
is_root
()))
if
(
JSON_UNLIKELY
(
empty
()))
{
JSON_THROW
(
detail
::
out_of_range
::
create
(
405
,
"JSON pointer has no parent"
));
}
...
...
@@ -173,16 +173,16 @@ class json_pointer
reference_tokens
.
push_back
(
std
::
move
(
token
));
}
private
:
/// return whether pointer points to the root document
bool
is_root
()
const
noexcept
bool
empty
()
const
noexcept
{
return
reference_tokens
.
empty
();
}
private
:
json_pointer
top
()
const
{
if
(
JSON_UNLIKELY
(
is_root
()))
if
(
JSON_UNLIKELY
(
empty
()))
{
JSON_THROW
(
detail
::
out_of_range
::
create
(
405
,
"JSON pointer has no parent"
));
}
...
...
include/nlohmann/json.hpp
View file @
164e0e54
...
...
@@ -7466,7 +7466,7 @@ class basic_json
const
auto
operation_add
=
[
&
result
](
json_pointer
&
ptr
,
basic_json
val
)
{
// adding to the root of the target document means replacing it
if
(
ptr
.
is_root
())
if
(
ptr
.
empty
())
{
result
=
val
;
}
...
...
single_include/nlohmann/json.hpp
View file @
164e0e54
...
...
@@ -11959,7 +11959,7 @@ class json_pointer
*/
std
::
string
pop_back
()
{
if
(
JSON_UNLIKELY
(
is_root
()))
if
(
JSON_UNLIKELY
(
empty
()))
{
JSON_THROW
(
detail
::
out_of_range
::
create
(
405
,
"JSON pointer has no parent"
));
}
...
...
@@ -11983,16 +11983,16 @@ class json_pointer
reference_tokens
.
push_back
(
std
::
move
(
token
));
}
private
:
/// return whether pointer points to the root document
bool
is_root
()
const
noexcept
bool
empty
()
const
noexcept
{
return
reference_tokens
.
empty
();
}
private
:
json_pointer
top
()
const
{
if
(
JSON_UNLIKELY
(
is_root
()))
if
(
JSON_UNLIKELY
(
empty
()))
{
JSON_THROW
(
detail
::
out_of_range
::
create
(
405
,
"JSON pointer has no parent"
));
}
...
...
@@ -20016,7 +20016,7 @@ class basic_json
const
auto
operation_add
=
[
&
result
](
json_pointer
&
ptr
,
basic_json
val
)
{
// adding to the root of the target document means replacing it
if
(
ptr
.
is_root
())
if
(
ptr
.
empty
())
{
result
=
val
;
}
...
...
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