本文整理汇总了C++中fs::path::has_branch_path方法的典型用法代码示例。如果您正苦于以下问题:C++ path::has_branch_path方法的具体用法?C++ path::has_branch_path怎么用?C++ path::has_branch_path使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fs::path
的用法示例。
在下文中一共展示了path::has_branch_path方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: add_file
void file_storage::add_file(fs::path const& file, size_type size, int flags
, std::time_t mtime, fs::path const& symlink_path)
{
TORRENT_ASSERT(size >= 0);
#if BOOST_VERSION < 103600
if (!file.has_branch_path())
#else
if (!file.has_parent_path())
#endif
{
// you have already added at least one file with a
// path to the file (branch_path), which means that
// all the other files need to be in the same top
// directory as the first file.
TORRENT_ASSERT(m_files.empty());
m_name = file.string();
}
else
{
if (m_files.empty())
m_name = *file.begin();
}
TORRENT_ASSERT(m_name == *file.begin());
m_files.push_back(file_entry());
file_entry& e = m_files.back();
e.size = size;
e.path = file;
e.offset = m_total_size;
e.pad_file = bool(flags & pad_file);
e.hidden_attribute = bool(flags & attribute_hidden);
e.executable_attribute = bool(flags & attribute_executable);
e.symlink_attribute = bool(flags & attribute_symlink);
if (e.symlink_attribute) e.symlink_path = symlink_path.string();
e.mtime = mtime;
m_total_size += size;
}