本文整理汇总了C++中TFilePath::withNoFrame方法的典型用法代码示例。如果您正苦于以下问题:C++ TFilePath::withNoFrame方法的具体用法?C++ TFilePath::withNoFrame怎么用?C++ TFilePath::withNoFrame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TFilePath
的用法示例。
在下文中一共展示了TFilePath::withNoFrame方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: renameFileOrLevel_throw
void TSystem::renameFileOrLevel_throw(const TFilePath &dst,
const TFilePath &src,
bool renamePalette) {
if (renamePalette && ((src.getType() == "tlv") || (src.getType() == "tzp") ||
(src.getType() == "tzu"))) {
// Special case: since renames cannot be 'grouped' in the UI, palettes are
// automatically
// renamed here if required
const char *type = (src.getType() == "tlv") ? "tpl" : "plt";
TFilePath srcpltname(src.withNoFrame().withType(type));
TFilePath dstpltname(dst.withNoFrame().withType(type));
if (TSystem::doesExistFileOrLevel(src) &&
TSystem::doesExistFileOrLevel(srcpltname))
TSystem::renameFile(dstpltname, srcpltname, false);
}
if (src.isLevelName()) {
TFilePathSet files;
files = TSystem::readDirectory(src.getParentDir(), false);
for (TFilePathSet::iterator it = files.begin(); it != files.end(); it++) {
if (it->getLevelName() == src.getLevelName()) {
TFilePath src1 = *it;
TFilePath dst1 = dst.withFrame(it->getFrame());
TSystem::renameFile(dst1, src1);
}
}
} else
TSystem::renameFile(dst, src);
}
示例2: save
void SceneLevel::save()
{
TFilePath fp = m_oldPath;
SceneResource::updatePath(fp);
TFilePath actualFp = m_scene->decodeFilePath(fp);
actualFp = restorePsdPath(actualFp);
TFilePath oldActualPath = restorePsdPath(m_oldActualPath);
assert(actualFp.getWideString() == L"" || actualFp.getWideString()[0] != L'+');
if (actualFp != oldActualPath || !TSystem::doesExistFileOrLevel(oldActualPath) || m_sl->getProperties()->getDirtyFlag() || (m_sl->getPalette() && m_sl->getPalette()->getDirtyFlag())) {
try {
TSystem::touchParentDir(actualFp);
if (actualFp != oldActualPath &&
TSystem::doesExistFileOrLevel(oldActualPath) &&
m_sl->getProperties()->getDirtyFlag() == false &&
(!m_sl->getPalette() || (m_sl->getPalette() && m_sl->getPalette()->getDirtyFlag() == false))) {
try {
TXshSimpleLevel::copyFiles(actualFp, oldActualPath);
} catch (...) {
}
//Must NOT KEEP FRAMES, it generate a level frames bind necessary to imageBuilder path refresh.
m_sl->setPath(fp, false);
} else {
m_sl->save(actualFp, oldActualPath);
if ((actualFp.getType() == "tlv" || actualFp.getType() == "pli") &&
actualFp != oldActualPath &&
m_oldRefImgPath != TFilePath()) {
//Devo preoccuparmi dell'eventuale livello colormodel
TFilePath actualRefImagPath = m_scene->decodeFilePath(m_oldRefImgPath);
TFilePath actualRefImagPathTpl = actualRefImagPath.withType("tpl");
TFilePath oldRefImagPathTpl = m_oldActualRefImgPath.withType("tpl");
TSystem::copyFile(actualRefImagPath, m_oldActualRefImgPath);
if (actualRefImagPath.getType() == "tlv")
TSystem::copyFile(actualRefImagPathTpl, oldRefImagPathTpl);
}
if (actualFp.getType() == "tif" || actualFp.getType() == "tiff" || actualFp.getType() == "tga" || actualFp.getType() == "tzi") {
TFilePath clnin = oldActualPath.withNoFrame().withType("cln");
if (TSystem::doesExistFileOrLevel(clnin))
TSystem::copyFile(actualFp.withNoFrame().withType("cln"), clnin);
}
}
//Se il livello e' tlv verifico se esiste il corrispondente unpainted ed in caso affermativo lo copio.
//Questo controllo viene fatto qui e non nella copia o nel salvataggio del livello perche' in generale
//non si vuole che il livello unpainted venga copiato con il livello.
if (actualFp.getType() == "tlv") {
TFilePath oldUnpaintedLevelPath = oldActualPath.getParentDir() + TFilePath(oldActualPath.getName() + "-unpainted." + oldActualPath.getType());
TFilePath unpaintedLevelPath = actualFp.getParentDir() + TFilePath(actualFp.getName() + "-unpainted." + actualFp.getType());
if (TSystem::doesExistFileOrLevel(oldUnpaintedLevelPath) && !TSystem::doesExistFileOrLevel(unpaintedLevelPath))
TSystem::copyFile(unpaintedLevelPath, oldUnpaintedLevelPath);
TFilePath oldUnpaintedPalettePath = oldUnpaintedLevelPath.withType("tpl");
TFilePath unpaintedPalettePath = unpaintedLevelPath.withType("tpl");
if (TSystem::doesExistFileOrLevel(oldUnpaintedPalettePath) && !TSystem::doesExistFileOrLevel(unpaintedPalettePath))
TSystem::copyFile(unpaintedPalettePath, oldUnpaintedPalettePath);
}
} catch (...) {
}
}
fp = m_oldScannedPath;
if (fp != TFilePath()) {
SceneResource::updatePath(fp);
actualFp = m_scene->decodeFilePath(fp);
if (actualFp != m_oldActualScannedPath &&
TSystem::doesExistFileOrLevel(m_oldActualScannedPath)) {
try {
TSystem::touchParentDir(actualFp);
TSystem::copyFileOrLevel_throw(actualFp, m_oldActualScannedPath);
m_sl->clearFrames();
m_sl->load();
} catch (...) {
}
}
}
}