llvm::sys::path::parent_path

Get parent path.

Synopsis

Declared in <llvm/Support/Path.h>

StringRef
parent_path(
    StringRef path,
    Style style = Style::native);

Description


/          => <empty>
/foo       => /
foo/../bar => foo/..

Return Value

The parent path of path if one exists, otherwise "".

Parameters

NameDescription
pathInput path.
styleThe style of path (e.g. Windows or POSIX). "native" style means to derive the style from the host.