Commit 08de9eea by garethsb-sony Committed by gbsylveg

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

parent 164e0e54
...@@ -123,6 +123,21 @@ class json_pointer ...@@ -123,6 +123,21 @@ class json_pointer
} }
/*! /*!
@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
@return integer representation of @a s @return integer representation of @a s
......
...@@ -11933,6 +11933,21 @@ class json_pointer ...@@ -11933,6 +11933,21 @@ class json_pointer
} }
/*! /*!
@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
@return integer representation of @a s @return integer representation of @a s
......
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