llvm::sys::path::root_directory

Get root directory.

Synopsis

Declared in <llvm/Support/Path.h>

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

Description


/goo/hello => /
c:/hello   => /
d/file.txt => <empty>

Return Value

The root directory of path if it has one, otherwise "".

Parameters

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