Commit 08de9eea authored by garethsb-sony's avatar garethsb-sony Committed by gbsylveg

Add json_pointer::parent_pointer (cf. std::filesystem::path::parent_path)

parent 164e0e54
...@@ -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
......
...@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment