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


C++ TFilePath::isAncestorOf方法代码示例

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


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

示例1: removeFolder

void TLevelSet::removeFolder(const TFilePath &folder) {
  if (folder == m_defaultFolder) return;
  std::vector<TFilePath> folders;
  for (int i = 0; i < (int)m_folders.size(); i++)
    if (!folder.isAncestorOf(m_folders[i])) folders.push_back(m_folders[i]);
  folders.swap(m_folders);
  std::map<TXshLevel *, TFilePath>::iterator it;
  for (it = m_folderTable.begin(); it != m_folderTable.end(); ++it) {
    if (folder.isAncestorOf(it->second)) it->second = m_defaultFolder;
  }
}
开发者ID:Makoto-Sasahara,项目名称:opentoonz,代码行数:11,代码来源:levelset.cpp

示例2: TFilePath

TFilePath TFilePath::operator-(const TFilePath &fp) const {
#ifdef WIN32
  if (toLower(m_path) == toLower(fp.m_path)) return TFilePath("");
#else
  if (m_path == fp.m_path) return TFilePath("");
#endif
  if (!fp.isAncestorOf(*this)) return *this;
  int len = fp.m_path.length();
  if (len == 0 || fp.m_path[len - 1] != slash) len++;

  return TFilePath(m_path.substr(len));
}
开发者ID:walkerka,项目名称:opentoonz,代码行数:12,代码来源:tfilepath.cpp

示例3: renameFolder

TFilePath TLevelSet::renameFolder(const TFilePath &folder,
                                  const std::wstring &newName) {
  // Impedisco la creazione di folder con nome "" che creano problemi
  // (praticamente Ecome se avessero infinite sottocartelle)
  if (newName == L"") return folder;

  TFilePath folder2 = folder.withName(newName);

  for (int i = 0; i < (int)m_folders.size(); i++) {
    if (folder == m_folders[i])
      m_folders[i] = folder2;
    else if (folder.isAncestorOf(m_folders[i]))
      m_folders[i] = folder2 + (m_folders[i] - folder);
  }
  if (m_defaultFolder == folder) m_defaultFolder = folder2;
  std::map<TXshLevel *, TFilePath>::iterator it;
  for (it = m_folderTable.begin(); it != m_folderTable.end(); ++it) {
    if (folder == it->second)
      it->second = folder2;
    else if (folder.isAncestorOf(it->second))
      it->second = folder2 + (it->second - folder);
  }
  return folder2;
}
开发者ID:Makoto-Sasahara,项目名称:opentoonz,代码行数:24,代码来源:levelset.cpp


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