std::experimental::filesystem::path

From cppreference.com
< cpp‎ | experimental‎ | fs
Defined in header <experimental/filesystem>
class path;
(filesystem TS)

Objects of type path represent a path. Only syntactic aspects of paths are handled: the pathname may represent a non-existing path or even one that is not allowed on the current operating or file system.

The path can be traversed element-wise via iterators returned by the begin() and end() functions.

Calling any non-const member function of a path invalidates all iterators referring to elements of that object.

The forward traversal is done in the following order:

  • The root name element, if any
  • The root directory element, if any. The element is presented in generic format, thus lexicographical comparisons work correctly.
  • Each successive filename element.
  • . if one or mare trailing non-root / characters are present.

Contents

[edit] Member types

Type Definition
value_type todo
string_type std::basic_string<value_type>
iterator a constant BidirectionalIterator with a value_type of path
const_iterator todo

[edit] Member constants

constexpr value_type preferred_separator
[static]
todo
(public static member constant)

[edit] Member functions

constructs a path
(public member function)
destroys a path object
(public member function)
assigns another path
(public member function)
assigns contents
(public member function)
Concatenation
appends elements to the path
(public member function)
concatenates two paths
(public member function)
Modifiers
erases the contents
(public member function)
converts directory separators to preferred directory separator
(public member function)
removes filename path component
(public member function)
replaces the last path component with another path
(public member function)
replaces the extension
(public member function)
swaps two paths
(public member function)
Format observers
returns the native version of the path
(public member function)
returns the native version of the path
(public member function)
returns the path in native pathname format converted to a string
(public member function)
returns the path in generic pathname format converted to a string
(public member function)
Compare
compares the lexical representations of two paths lexicographically
(public member function)
Decomposition
returns the root-name of the path, if present
(public member function)
returns the root directory of the path, if present
(public member function)
returns the root path of the path, if present
(public member function)
returns path relative to the root path
(public member function)
returns the path of the parent path
(public member function)
returns the filename path component
(public member function)
returns the stem path component
(public member function)
returns the file extension path component
(public member function)
Queries
checks if the path is empty
(public member function)
checks if the corresponding path element is not empty
(public member function)
checks if root_path() uniquely identifies file system location
(public member function)
Iterators
returns an iterator to the beginning of element list
(public member function)
returns an iterator to the end of element list
(public member function)

[edit] Non-member functions

swaps two paths
(function)
lexicographically compares two paths
(function)
concatenates two paths
(function)
performs stream input and output on a path
(function)
creates a path from a UTF-8 encoded source
(function)