std::experimental::filesystem::path:: replace_extension
From cppreference.net
<
cpp
|
experimental
|
fs
|
path
C++
Experimental
| 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 |
Filesystem library
| Classes | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Functions | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| File types | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
path
| Member functions | ||||
| Path decomposition | ||||
| Non-member functions | ||||
|
path
&
replace_extension
(
const
path
&
replacement
=
path
(
)
)
;
|
(1) | (파일시스템 TS) |
확장자를 replacement 으로 교체하거나, replacement 의 기본값이 사용될 때 제거합니다.
우선, 이 경로에 extension() 가 존재하는 경우, 이를 제거합니다.
그런 다음, replacement 가 비어 있지 않거나 점 문자로 시작하지 않는 경우 점 문자가 추가됩니다.
그런 다음 replacement 가 경로에 추가됩니다.
목차 |
매개변수
| replacement | - | 대체할 확장자 |
반환값
* this
예외
구현 정의 예외를 던질 수 있습니다.
예제
이 코드 실행
출력:
Was: "/foo/bar.jpeg" Now: "/foo/bar.jpg"
참고 항목
|
파일 확장자 경로 구성 요소를 반환합니다
(public member function) |
|
|
파일 이름 경로 구성 요소를 반환합니다
(public member function) |
|
|
스템 경로 구성 요소를 반환합니다
(public member function) |
|
|
해당 경로 요소가 비어 있지 않은지 확인합니다
(public member function) |