Function IsParentPath#

Function Documentation#

inline bool IsParentPath(const std::filesystem::path &rpathBase, const std::filesystem::path &rpathRelative)#

Check whether a relative path is directing to a parent of the base path.

Detect whether a relative path joined to the base path is referring to a parent of the base path. For example, the base path is “/home/user/project” and the relative path is “..”. Both joined together would make “/home/user”, which is a parent of the base path.

Parameters:
  • rpathBase[in] Reference to the base path.

  • rpathRelative[in] Reference to the relative path following the base.

Returns:

Returns whether the relative path is a parent of the base (not the base or a child of the base).