MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / parent_pointer

Method parent_pointer

Source/Utils/json.hpp:11755–11765  ·  view source on GitHub ↗

! @brief returns the parent of this JSON pointer @return parent of this JSON pointer; in case this JSON pointer is the root, the root itself is returned @complexity Linear in the length of the JSON pointer. @liveexample{The example shows the result of `parent_pointer` for different JSON Pointers.,json_pointer__parent_pointer} @sin

Source from the content-addressed store, hash-verified

11753 @since version 3.6.0
11754 */
11755 json_pointer parent_pointer() const
11756 {
11757 if (empty())
11758 {
11759 return *this;
11760 }
11761
11762 json_pointer res = *this;
11763 res.pop_back();
11764 return res;
11765 }
11766
11767 /*!
11768 @brief remove last reference token

Callers

nothing calls this directly

Calls 2

pop_backMethod · 0.80
emptyFunction · 0.70

Tested by

no test coverage detected