Version 2
boost::filesystem::path p( "C:\\data\\sample.dat"); std::cout << p.file_string() << std::endl; //C:\data\sample.dat std::cout << p.filename() << std::endl; //sample.dat std::cout << p.extension() << std::endl; //.dat std::cout << p.stem() << std::endl; //sample std::cout << std::boolalpha << boost::filesystem::exist(p) << std::endl; std::cout << std::boolalpha << boost::filesystem::is_directory(p) << std::endl;
コメントをかく