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
08de9eea
Commit
08de9eea
authored
Feb 25, 2019
by
garethsb-sony
Committed by
gbsylveg
Feb 25, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add json_pointer::parent_pointer (cf. std::filesystem::path::parent_path)
parent
164e0e54
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
0 deletions
+30
-0
include/nlohmann/detail/json_pointer.hpp
include/nlohmann/detail/json_pointer.hpp
+15
-0
single_include/nlohmann/json.hpp
single_include/nlohmann/json.hpp
+15
-0
No files found.
include/nlohmann/detail/json_pointer.hpp
View file @
08de9eea
...
@@ -122,6 +122,21 @@ class json_pointer
...
@@ -122,6 +122,21 @@ class json_pointer
return
json_pointer
(
lhs
)
/=
array_index
;
return
json_pointer
(
lhs
)
/=
array_index
;
}
}
/*!
@brief create a new JSON pointer that is the parent of this JSON pointer
*/
json_pointer
parent_pointer
()
const
{
if
(
empty
())
{
return
*
this
;
}
json_pointer
res
=
*
this
;
res
.
pop_back
();
return
res
;
}
/*!
/*!
@param[in] s reference token to be converted into an array index
@param[in] s reference token to be converted into an array index
...
...
single_include/nlohmann/json.hpp
View file @
08de9eea
...
@@ -11932,6 +11932,21 @@ class json_pointer
...
@@ -11932,6 +11932,21 @@ class json_pointer
return
json_pointer
(
lhs
)
/=
array_index
;
return
json_pointer
(
lhs
)
/=
array_index
;
}
}
/*!
@brief create a new JSON pointer that is the parent of this JSON pointer
*/
json_pointer
parent_pointer
()
const
{
if
(
empty
())
{
return
*
this
;
}
json_pointer
res
=
*
this
;
res
.
pop_back
();
return
res
;
}
/*!
/*!
@param[in] s reference token to be converted into an array index
@param[in] s reference token to be converted into an array index
...
...
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