A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://timsong-cpp.github.io/cppwp/n4659/fs.path.decompose below:

[fs.path.decompose]

30 Input/output library [input.output] 30.10 File systems [filesystems] 30.10.27 Class path [fs.class.path] 30.10.27.4 path members [fs.path.member] 30.10.27.4.9 path decomposition [fs.path.decompose]

path root_name() const;

Returns: root-name, if the pathname in the generic format includes root-name, otherwise path().

path root_directory() const;

path root_path() const;

Returns: root_­name() / root_­directory().

path relative_path() const;

Returns: A path composed from the pathname in the generic format, if !empty(), beginning with the first filename after root-path. Otherwise, path().

path parent_path() const;

Returns: *this if !has_­relative_­path(), otherwise a path whose generic format pathname is the longest prefix of the generic format pathname of *this that produces one fewer element in its iteration.

path filename() const;

Returns: relative_­path().empty() ? path() : *--end().

[Example:

path("/foo/bar.txt").filename();   path("/foo/bar").filename();       path("/foo/bar/").filename();      path("/").filename();              path("//host").filename();         path(".").filename();              path("..").filename();             

end example]

path stem() const;

Returns: Let f be the generic format pathname of filename(). Returns a path whose pathname in the generic format is

[Example:

std::cout << path("/foo/bar.txt").stem(); path p = "foo.bar.baz.tar";
for (; !p.extension().empty(); p = p.stem())
  std::cout << p.extension() << '\n';
      

end example]

path extension() const;

Returns: a path whose pathname in the generic format is the suffix of filename() not included in stem().

[Example:

path("/foo/bar.txt").extension();  path("/foo/bar").extension();      path("/foo/.profile").extension(); path(".bar").extension();          path("..bar").extension();         

end example]

[Note: The period is included in the return value so that it is possible to distinguish between no extension and an empty extension. end note]

[Note: On non-POSIX operating systems, for a path p, it may not be the case that p.stem() + p.extension() == p.filename(), even though the generic format pathnames are the same. end note]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4