Namespaces
Variants

std::experimental::filesystem::path:: root_path

From cppreference.net
path root_path ( ) const ;
(파일시스템 TS)

경로의 루트 경로를 반환합니다. 경로가 루트 경로를 포함하지 않는 경우 path ( ) 를 반환합니다.

효과적으로 다음을 반환합니다: root_name ( ) / root_directory ( )

목차

매개변수

(없음)

반환값

경로의 루트 경로입니다.

예외

구현 정의 예외를 던질 수 있습니다.

예제

#include <experimental/filesystem>
#include <iostream>
namespace fs = std::experimental::filesystem;
int main()
{
    std::cout << "Current root path is: " << fs::current_path().root_path() << '\n';
}

가능한 출력:

Current root path is: "C:\"

참고 항목

경로의 루트 이름을 반환합니다(존재하는 경우)
(public member function)
경로의 루트 디렉토리를 반환합니다(존재하는 경우)
(public member function)