std::experimental::filesystem::path:: parent_path
| 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 parent_path
(
)
const
;
|
(파일시스템 TS) | |
부모 디렉터리의 경로를 반환합니다. 경로가 empty ( ) 이거나 경로에 단일 요소만 있는 경우 ( begin ( ) == -- end ( ) ) 빈 경로를 반환합니다.
결과 경로는 범위
[
begin
(
)
,
--
end
(
)
)
내의 모든 요소들을 빈 경로에 추가하여 구성됩니다.
목차 |
매개변수
(없음)
반환값
상위 디렉토리 경로.
예외
구현 정의 예외를 던질 수 있습니다.
예제
#include <experimental/filesystem> #include <iostream> namespace fs = std::experimental::filesystem; int main() { for (fs::path p : {"/var/tmp/example.txt", "/", "/var/tmp/."}) std::cout << "The parent path of " << p << " is " << p.parent_path() << '\n'; }
가능한 출력:
The parent path of "/var/tmp/example.txt" is "/var/tmp" The parent path of "/" is "" The parent path of "/var/tmp/." is "/var/tmp"
참고 항목
| 이 섹션은 불완전합니다 |