[#BloombergLP-bdls-PathUtil-getDirname-0b] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdls.adoc[bdls]::xref:BloombergLP/bdls/PathUtil.adoc[PathUtil]::getDirname :relfileprefix: ../../../ :mrdocs: Load into the specified `dirname` the value of the directory part of the specified `path`, that is, the root if it exists and all the filenames except the last one (the leaf). If the optionally specified `rootEnd` offset is non‐negative, it is taken as the position in `path` of the character following the root. Return 0 on success, and a non‐zero value otherwise; in particular, return a nonzero value if `path` does not have a leaf. Note that in the case of a relative path with a single filename, the function will succeed and `dirname` will be the empty string. See []and Performance). See also for the definition of directories and root. == Synopses Declared in `<bdls_pathutil.h>` Load into the specified `dirname` the value of the directory part of the specified `path`, that is, the root if it exists and all the filenames except the last one (the leaf). If the optionally specified `rootEnd` offset is non‐negative, it is taken as the position in `path` of the character following the root. Return 0 on success, and a non‐zero value otherwise; in particular, return a nonzero value if `path` does not have a leaf. Note that in the case of a relative path with a single filename, the function will succeed and `dirname` will be the empty string. See []and Performance). See also for the definition of directories and root. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int xref:BloombergLP/bdls/PathUtil/getDirname-0e.adoc[getDirname]( xref:bsl/string.adoc[bsl::string]* dirname, std::string_view const& path, int rootEnd = ‐1); ---- [.small]#xref:BloombergLP/bdls/PathUtil/getDirname-0e.adoc[_» more..._]# [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int xref:BloombergLP/bdls/PathUtil/getDirname-0f.adoc[getDirname]( std::pmr::string* dirname, std::string_view const& path, int rootEnd = ‐1); ---- [.small]#xref:BloombergLP/bdls/PathUtil/getDirname-0f.adoc[_» more..._]# [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int xref:BloombergLP/bdls/PathUtil/getDirname-01.adoc[getDirname]( std::string* dirname, std::string_view const& path, int rootEnd = ‐1); ---- [.small]#xref:BloombergLP/bdls/PathUtil/getDirname-01.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#