当前位置: 首页>>代码示例>>C++>>正文


C++ path::branch_path方法代码示例

本文整理汇总了C++中utils::fs::path::branch_path方法的典型用法代码示例。如果您正苦于以下问题:C++ path::branch_path方法的具体用法?C++ path::branch_path怎么用?C++ path::branch_path使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在utils::fs::path的用法示例。


在下文中一共展示了path::branch_path方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: F

/// Computes the path to a new database for the given test suite.
///
/// \param root Path to the root of the test suite being run; needed to properly
///     autogenerate the identifiers.
/// \param when Timestamp for the test suite being run; needed to properly
///     autogenerate the identifiers.
///
/// \return Identifier of the created results file, if applicable, and the path
/// to such file.
fs::path
layout::new_db_for_migration(const fs::path& root,
                             const datetime::timestamp& when)
{
    const std::string generated_id = new_id(test_suite_for_path(root), when);
    const fs::path path = query_store_dir() / (
        F("results.%s.db") % generated_id);
    fs::mkdir_p(path.branch_path(), 0755);
    return path;
}
开发者ID:jmmv,项目名称:kyua,代码行数:19,代码来源:layout.cpp

示例2: kyuafile

/// Parses a test suite configuration file.
///
/// \param file The file to parse.
/// \param user_build_root If not none, specifies a path to a directory
///     containing the test programs themselves.  The layout of the build root
///     must match the layout of the source root (which is just the directory
///     from which the Kyuafile is being read).
///
/// \return High-level representation of the configuration file.
///
/// \throw load_error If there is any problem loading the file.  This includes
///     file access errors and syntax errors.
engine::kyuafile
engine::kyuafile::load(const fs::path& file,
                       const optional< fs::path > user_build_root)
{
    const fs::path source_root_ = file.branch_path();
    const fs::path build_root_ = user_build_root ?
        user_build_root.get() : source_root_;

    return kyuafile(source_root_, build_root_,
                    parser(source_root_, build_root_,
                           fs::path(file.leaf_name())).parse());
}
开发者ID:phoatfreebsd,项目名称:kyua,代码行数:24,代码来源:kyuafile.cpp

示例3: catch

/// Creates a directory and any missing parents.
///
/// This is separate from the fs::mkdir function to clearly differentiate the
/// libc wrapper from the more complex algorithm implemented here.
///
/// \param dir The path to the directory to create.
/// \param mode The permissions for the new directories.
///
/// \throw system_error If any call to mkdir(2) fails.
void
fs::mkdir_p(const fs::path& dir, const int mode)
{
    try {
        fs::mkdir(dir, mode);
    } catch (const fs::system_error& e) {
        if (e.original_errno() == ENOENT) {
            fs::mkdir_p(dir.branch_path(), mode);
            fs::mkdir(dir, mode);
        } else if (e.original_errno() != EEXIST)
            throw e;
    }
}
开发者ID:jungle0755,项目名称:minix,代码行数:22,代码来源:operations.cpp


注:本文中的utils::fs::path::branch_path方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。