[#BloombergLP-bdls-PathUtil-getRoot-04]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdls.adoc[bdls]::xref:BloombergLP/bdls/PathUtil.adoc[PathUtil]::getRoot
:relfileprefix: ../../../
:mrdocs:

Load into the specified &apos;root&apos; the value of the root part of the specified &apos;path&apos;&period; If the optionally specified &apos;rootEnd&apos; offset is non&hyphen;negative, it is taken as the position in &apos;path&apos; of the character following the root&period; Return 0 on success, and a non&hyphen;zero value otherwise&semi; in particular, return a nonzero value if &apos;path&apos; is relative&period; Note that the meaning of the root part is platform&hyphen;dependent&period; See &lsqb;&rsqb;and Performance)&period; See also  for the definition of root&period;

== Synopses

Declared in `&lt;bdls&lowbar;pathutil&period;h&gt;`

Load into the specified &apos;root&apos; the value of the root part of the specified &apos;path&apos;&period; If the optionally specified &apos;rootEnd&apos; offset is non&hyphen;negative, it is taken as the position in &apos;path&apos; of the character following the root&period; Return 0 on success, and a non&hyphen;zero value otherwise&semi; in particular, return a nonzero value if &apos;path&apos; is relative&period; Note that the meaning of the root part is platform&hyphen;dependent&period; See &lsqb;&rsqb;and Performance)&period; See also  for the definition of root&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
xref:BloombergLP/bdls/PathUtil/getRoot-0a.adoc[getRoot](
    xref:bsl/string.adoc[bsl::string]* root,
    std::string&lowbar;view const& path,
    int rootEnd = &hyphen;1);
----

[.small]#xref:BloombergLP/bdls/PathUtil/getRoot-0a.adoc[_» more&period;&period;&period;_]#


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
xref:BloombergLP/bdls/PathUtil/getRoot-073.adoc[getRoot](
    std::pmr::string* root,
    std::string&lowbar;view const& path,
    int rootEnd = &hyphen;1);
----

[.small]#xref:BloombergLP/bdls/PathUtil/getRoot-073.adoc[_» more&period;&period;&period;_]#


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
xref:BloombergLP/bdls/PathUtil/getRoot-07e.adoc[getRoot](
    std::string* root,
    std::string&lowbar;view const& path,
    int rootEnd = &hyphen;1);
----

[.small]#xref:BloombergLP/bdls/PathUtil/getRoot-07e.adoc[_» more&period;&period;&period;_]#


[.small]#Created with https://www.mrdocs.com[MrDocs]#
