Rose::StringUtility::getPathFromFileName¶
Returns all but the last component of a path in a filesystem.
Synopsis¶
Declared in <src/Rose/StringUtility/FileUtility.h>
[[visibility("default")]]
std::string
getPathFromFileName(std::string const& fileNameWithPath); Description¶
This function removes the filename from the combined path and filename if it includes a path and returns only the path. A filename without a path returns an empty string.
Terms are loosely defined and this function possibly doesn't work for non-POSIX file systems; consider using std::filesystem instead.
Return Value¶
Path component.
Parameters¶
| Name | Description |
|---|---|
| fileNameWithPath | Path-like string. |
Created with MrDocs