basic_path::leaf Method

Retrieves the stored file name.

string_type leaf() const;

Return Value

This method returns empty() ? string_type() : *--end().

  • If the relative path is present in the stored file name, the return value is the last path element.

  • Otherwise, if the root is present, the return value is the root.

  • Otherwise, if the prefix is present, the return value is the prefix.

  • Otherwise, the return value is an empty string.

Remarks

A stored file name consists of an optional prefix, followed by an optional root, followed by an optional relative path.

The prefix consists of all elements up to and including the first colon.

The root consists of one slash.

The relative path consists of one or more path elements that are delimited by sequences of slashes.

Requirements

Header: filesystem

Namespace: std::tr2::sys

See Also

Reference

basic_path Class

<filesystem>