本文整理汇总了C++中TLevelSet::hasLevel方法的典型用法代码示例。如果您正苦于以下问题:C++ TLevelSet::hasLevel方法的具体用法?C++ TLevelSet::hasLevel怎么用?C++ TLevelSet::hasLevel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TLevelSet
的用法示例。
在下文中一共展示了TLevelSet::hasLevel方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: process
TFilePath ResourceImportStrategy::process(ToonzScene *scene, ToonzScene *srcScene, TFilePath srcPath)
{
TFilePath srcActualPath = srcScene->decodeFilePath(srcPath);
if (!scene->isExternPath(srcActualPath) || m_strategy == DONT_IMPORT)
return srcPath;
TFilePath dstPath;
if (srcPath.getWideString().find(L'+') == 0)
dstPath = srcPath;
else
dstPath = scene->getImportedLevelPath(srcPath);
TFilePath actualDstPath = scene->decodeFilePath(dstPath);
assert(actualDstPath != TFilePath());
if (m_strategy == IMPORT_AND_OVERWRITE) {
//bool overwritten = false;
if (TSystem::doesExistFileOrLevel(actualDstPath)) {
TSystem::removeFileOrLevel(actualDstPath);
// overwritten = true;
}
if (TSystem::doesExistFileOrLevel(srcPath))
TXshSimpleLevel::copyFiles(actualDstPath, srcPath);
return dstPath;
} else if (m_strategy == IMPORT_AND_RENAME) {
std::wstring levelName = srcPath.getWideName();
TLevelSet *parentLevelSet = scene->getLevelSet();
NameModifier nm(levelName);
wstring newName;
for (;;) {
newName = nm.getNext();
if (!parentLevelSet->hasLevel(newName))
break;
}
dstPath = dstPath.withName(newName);
actualDstPath = scene->decodeFilePath(dstPath);
if (TSystem::doesExistFileOrLevel(actualDstPath))
TSystem::removeFileOrLevel(actualDstPath);
if (TSystem::doesExistFileOrLevel(srcActualPath)) {
TXshSimpleLevel::copyFiles(actualDstPath, srcActualPath);
}
return dstPath;
}
return srcPath;
}