mrdocs::files::getParentDir

Return the parent directory.

Synopses

Declared in <mrdocs/Support/Filesystem/Path.hpp>

Return the parent directory.

std::string_view
getParentDir(std::string_view pathName);
» more...

Return the parent directory.

std::string
getParentDir(
    std::string_view pathName,
    unsigned int levels);
» more...

Return Value

The parent directory, or the empty string if there is none.

Parameters

NameDescription
pathNameThe absolute or relative path to the directory or file.
levelsThe number of levels to go up. If this is zero, the original path is returned. If this is greater than the number of levels in the path, the empty string is returned.