[#BloombergLP-bdls-PathUtil-appendIfValid-01]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdls.adoc[bdls]::xref:BloombergLP/bdls/PathUtil.adoc[PathUtil]::appendIfValid
:relfileprefix: ../../../
:mrdocs:

Append a relative filename to the end of a path&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
appendIfValid(
    xref:bsl/string.adoc[bsl::string]* path,
    std::string&lowbar;view const& filename);
----

== Description

Append the specified `filename` to the end of the specified `path` if `filename` represents a relative path&period; Return 0 on success, and a non&hyphen;zero value otherwise&period; Note that any filesystem separator characters at the end of `filename` or `path` will be discarded&period; See  for the definition of separator&period;

== Return Value

0 on success, and a non&hyphen;zero value otherwise

== Parameters

[cols="1,4"]
|===
| Name| Description
| *path*
| path to which `filename` is appended
| *filename*
| relative path component to append
|===


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