std::experimental::filesystem::path:: remove_filename
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
&
remove_filename
(
)
|
(1) | (filesystem TS) |
단일 파일명 구성요소를 제거합니다.
경로에 파일명 구성 요소가 없는 경우 동작은 정의되지 않습니다 ( has_filename 가 false 를 반환하는 경우).
목차 |
매개변수
(없음)
반환값
* this
예외
구현 정의 예외를 던질 수 있습니다.
예제
이 코드 실행
#include <experimental/filesystem> #include <iostream> namespace fs = std::experimental::filesystem; int main() { std::cout << fs::path("/foo").remove_filename() << '\n' << fs::path("/").remove_filename() << '\n'; }
출력:
"/" ""
참고 항목
|
파일 이름 경로 구성 요소를 반환합니다
(public member function) |
|
|
마지막 경로 구성 요소를 다른 경로로 교체합니다
(public member function) |
|
|
해당 경로 요소가 비어 있지 않은지 확인합니다
(public member function) |