llvm::sys::path::stem

Get stem.

Synopsis

Declared in <llvm/Support/Path.h>

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

Description

If filename contains a dot but not solely one or two dots, result is the substring of filename ending at (but not including) the last dot. Otherwise it is filename.


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

Return Value

The stem of path.

Parameters

NameDescription
pathInput path.