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.

Synopsis

Declared in <bdls_pathutil.h>

static
int
getDirname(
    bsl::string* dirname,
    std::string_view const& path,
    int rootEnd = ‐1);

Created with MrDocs