Итого, для последнего на текущий момент boost 1.46.1:
if( is_directory(dirname) )
{
recursive_directory_iterator end;
for( recursive_directory_iterator it(dirname); it!=end; ++it )
{
cout << endl
<< it->path() << ":" << endl
<< "is_directory: " << boolalpha << is_directory(it->path()) << endl
<< "root_path: " << it->path().root_path() << endl
<< "root_name: " << it->path().root_name() << endl
<< "root_directory: " << it->path().root_directory() << endl
<< "relative_path: " << it->path().relative_path() << endl
<< "parent_path: " << it->path().parent_path() << endl
<< "filename: " << it->path().filename() << endl
<< "stem: " << it->path().stem() << endl
<< "extension: " << it->path().extension() << endl;
}
}
и чтоб потом не вспоминать кто есть ху, вывод:
"C:\temp\2011.03\2011.03.26":
is_directory: true
root_path: "C:\"
root_name: "C:"
root_directory: "\"
relative_path: "temp\2011.03\2011.03.26"
parent_path: "C:\temp\2011.03"
filename: "2011.03.26"
stem: "2011.03"
extension: ".26"
"C:\temp\2011.03\2011.03.26\Трон Наследие 3D (BDRip 1920x1080).mkv":
is_directory: false
root_path: "C:\"
root_name: "C:"
root_directory: "\"
relative_path: "temp\2011.03\2011.03.26\Трон Наследие 3D (BDRip 1920x1080).mkv"
parent_path: "C:\temp\2011.03\2011.03.26"
filename: "Трон Наследие 3D (BDRip 1920x1080).mkv"
stem: "Трон Наследие 3D (BDRip 1920x1080)"
extension: ".mkv"
Комментариев нет:
Отправить комментарий