std::experimental::filesystem::path:: replace_extension
Technical Specification | ||||
Filesystem library (filesystem TS) | ||||
Library fundamentals (library fundamentals TS) | ||||
Library fundamentals 2 (library fundamentals TS v2) | ||||
Library fundamentals 3 (library fundamentals TS v3) | ||||
Extensions for parallelism (parallelism TS) | ||||
Extensions for parallelism 2 (parallelism TS v2) | ||||
Extensions for concurrency (concurrency TS) | ||||
Extensions for concurrency 2 (concurrency TS v2) | ||||
Concepts (concepts TS) | ||||
Ranges (ranges TS) | ||||
Reflection (reflection TS) | ||||
Mathematical special functions (special functions TR) | ||||
Experimental Non-TS | ||||
Pattern Matching | ||||
Linear Algebra | ||||
std::execution | ||||
Contracts | ||||
2D Graphics |
Classes | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Functions | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
File types | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Member functions | ||||
Path decomposition | ||||
Non-member functions | ||||
path
&
replace_extension
(
const
path
&
replacement
=
path
(
)
)
;
|
(1) | (filesystem TS) |
Replaces the extension with replacement or removes it when the default value of replacement is used.
Firstly, if this path has an extension() , it is removed.
Then, a dot character is appended if replacement is not empty or does not begin with a dot character.
Then replacement is appended to the path.
Parameters
replacement | - | the extension to replace with |
Return value
* this
Exceptions
May throw implementation-defined exceptions.
Example
Output:
Was: "/foo/bar.jpeg" Now: "/foo/bar.jpg"
See also
returns the file extension path component
(public member function) |
|
returns the filename path component
(public member function) |
|
returns the stem path component
(public member function) |
|
checks if the corresponding path element is not empty
(public member function) |