Share via


basic_path::filename Method

Retrieves the stored file name.

string_type filename() 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 has an optional prefix, followed by an optional root, followed by an optional relative path.

The prefix is the elements up to and including the first colon.

The root is a backslash or forward slash.

The relative path is one or more path elements that are delimited by backslashes or forward slashes.

Requirements

Header: filesystem

Namespace: std::tr2::sys

See Also

Reference

basic_path Class

<filesystem>