[#BloombergLP-bdls-PathUtil-splitFilename] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdls.adoc[bdls]::xref:BloombergLP/bdls/PathUtil.adoc[PathUtil]::splitFilename :relfileprefix: ../../../ :mrdocs: Load the last pathname component from the specified `path` into the specified `tail` and everything leading up to that to the specified `head`. If the optionally specified `rootEnd` offset is non‐negative, it is taken as the position in `path` of the character following the root. The `tail` part never contains a slash; if `path` ends in a slash, `tail` is empty. If there is no slash in `path`, `head` is empty. If `path` is empty, both `head` and `tail` are empty. Trailing slashes are stripped from `head` unless it is the root. ` +‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐+‐‐‐‐‐‐‐‐‐‐‐‐+‐‐‐‐‐‐‐‐‐+ | PATH | HEAD | TAIL | +#++#===+ | "one" | "" | "one" | +‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐+‐‐‐‐‐‐‐‐‐‐‐‐+‐‐‐‐‐‐‐‐‐+ | "/one/two/three" | "/one/two" | "three" | +‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐+‐‐‐‐‐‐‐‐‐‐‐‐+‐‐‐‐‐‐‐‐‐+ | "//one/two///" | "/one/two" | "" | +‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐+‐‐‐‐‐‐‐‐‐‐‐‐+‐‐‐‐‐‐‐‐‐+ | "c:\one\two" | "c:\one" | "two" | +‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐+‐‐‐‐‐‐‐‐‐‐‐‐+‐‐‐‐‐‐‐‐‐+ ` See {`Terminology`} for the definition of root. The behavior is undefined unless `head != tail` and `INT_MAX >= path.length()`. Note that `head` or `tail` may point to the `path` object when the method is called. == Synopsis Declared in `<bdls_pathutil.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static void splitFilename( std::string_view* head, std::string_view* tail, std::string_view const& path, int rootEnd = ‐1); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#