boost::path 解析,经常用,老是忘,留下点备注,忘记了就回头来查查
#include "stdafx.h"
#include <string>
#include <iostream>
#include <boost/filesystem.hpp>
int main()
{
string file_path = R"(F:\)";//F:\001_Data\tile_data\test.txt
std::cout << file_path << std::endl << std::endl;
//路径操作
filesystem::path path = file_path;
path /= "001_Data"; //添加下级目录
path /= "tile_data";//添加下级目录
path /= "test.txt"; //添加文件
std::cout << " -------------"<<path.string() << std::endl << std::endl;
//路径查询:
std::cout <<" root_path: "<< path.root_path().string() << std::endl;
std::cout << " root_name: " << path.root_name().string() << std::endl ;
std::co