basic_path 클래스
Defines a class that stores an object of template type String that's suitable for use as a file name.
template<class String, class Traits>
class basic_path;
설명
The library defines specializations of this template for two types.
basic_path<string, path_traits>, with the typedef path, uses std::string and the path_traits structure.
basic_path<wstring, wpath_traits>, with the typedef wpath, uses std::wstring and the wpath_traits structure.
You can use an object of type path wherever an argument of type std::string is acceptable as a file name.
std::tr2::sys::path myfile(“abc.txt”);
std::ofstream ofs(myfile);
ofs << “hello\n”;
ofs.close();
Similarly, you can use an object of type wpath wherever an argument of type std::wstring is acceptable as a file name.
A stored file name consists of an optional prefix, followed by an optional root, followed by an optional relative path.
A prefix consists of all elements that lead up to and include the first colon.
A root consists of one slash.
A relative path consists of one or more path elements that are delimited by sequences of slashes.
A file name iterator that is returned by basic_path::begin designates the first filename component.
A filename iterator X implies the following.
X == end() indicates the end of the sequence of filename components.
*X returns a string that matches the current component.
++X designates the next component, if present.
--X designates the preceding component, if present.
멤버
공용 Typedefs
Name |
설명 |
---|---|
basic_path::const_iterator |
이 basic_path::iterator 의 동의어입니다. |
basic_path::external_string_type |
이 Traits::external_string_type 의 동의어입니다. |
basic_path::iterator |
Describes a filename iterator that can serve as a bi-directional iterator over the components of the stored file name. |
basic_path::path_type |
이 basic_path<String, Traits> 의 동의어입니다. |
basic_path::string_type |
A synonym for the String template parameter. |
basic_path::traits_type |
A synonym for the Traits template parameter. |
basic_path::value_type |
이 String::value_type 의 동의어입니다. |
Public 생성자
Name |
설명 |
---|---|
basic_path 개체를 생성합니다. |
Public 메서드
Name |
설명 |
---|---|
저장된 파일 이름에 요소를 추가합니다. |
|
Uses a specified set of elements to replace the stored file name. |
|
Returns the substring of leaf up to but not including the rightmost dot. |
|
Specifies the first component of the stored file name. |
|
Retrieves the parent path of the basic_path object. |
|
Clears the stored filename string. |
|
저장된 파일 이름을 반환합니다. |
|
Specifies whether the filename string is empty. |
|
파일 이름으로 저장된 마지막 구성 요소를 넘어서 파일 이름이 반복기 을 반환합니다. |
|
Returns the extension of the stored file name, if it exists. |
|
Converts the stored directory_string to the external_string_type. |
|
Converts the stored file_string to the external_string_type. |
|
저장된 파일 이름을 반환합니다. |
|
저장된 파일 이름을 검색합니다. |
|
Specifies whether the stored file name contains a branch path. |
|
Specifies whether the stored string contains a file name. |
|
Specifies whether the stored file name contains a leaf. |
|
Specifies whether the stored file name contains a parent path. |
|
Specifies whether the stored file name contains a relative path. |
|
Specifies whether the stored file name contains a root directory. |
|
Specifies whether the stored file name contains a root name. |
|
Specifies whether the stored file name contains a root path. |
|
Specifies whether the stored file name is complete. |
|
저장된 파일 이름을 검색합니다. |
|
Retrieves the parent path of the basic_path object. |
|
파일 이름으로 저장된 상대 경로 를 검색합니다. |
|
Removes the last path element in the relative path, if it exists. |
|
Removes the last path element in the relative path, if it exists. |
|
Replaces the file name extension of the stored file name. |
|
존재하는 경우, 루트를 반환합니다. |
|
존재하는 경우, 접두사를 반환합니다. |
|
Retrieves the root path of the stored file name. |
|
Returns the substring of leaf up to but not including the rightmost dot. |
|
저장된 파일 이름을 반환합니다. |
|
Swaps the stored file name with the file name from a specified basic_path object. |
Public 연산자
Name |
설명 |
---|---|
저장된 파일 이름을 반환합니다. |
|
Appends a series of elements to the stored file name. |
|
Assigns a new value to the stored file name. |
요구 사항
헤더: filesystem
네임스페이스: std::tr2::sys