コード例 #1
0
// removes trailing slashes, uses make_preferred
void standardizePath(bfs::path& inPath)
{
    string pathStr = inPath.string();

    inPath.make_preferred();
    if (inPath.filename() == ".") inPath.remove_filename();
}
コード例 #2
0
ファイル: main.cpp プロジェクト: satya-das/yawg
/**
 * Makes sure \a path uses preferred slash and it ends with slash
 */
inline void make_preferred_dir_format(boost::filesystem::path& path)
{
   path.make_preferred();
   if(path.native().back() != path.preferred_separator)
      path = path.native() + path.preferred_separator;
}