本文整理汇总了C++中TFilePath::getLevelName方法的典型用法代码示例。如果您正苦于以下问题:C++ TFilePath::getLevelName方法的具体用法?C++ TFilePath::getLevelName怎么用?C++ TFilePath::getLevelName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TFilePath
的用法示例。
在下文中一共展示了TFilePath::getLevelName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: TFilePath
Convert2Tlv::Convert2Tlv(const TFilePath &filepath1, const TFilePath &filepath2, const TFilePath &outFolder, const QString &outName,
int from, int to, bool doAutoclose, const TFilePath &palettePath, int colorTolerance,
int antialiasType, int antialiasValue, bool isUnpaintedFromNAA)
: m_size(0, 0), m_level1(), m_levelIn1(), m_levelIn2(), m_levelOut(), m_autoclose(doAutoclose), m_premultiply(false), m_count(0), m_from(from), m_to(to), m_palettePath(palettePath), m_colorTolerance(colorTolerance), m_palette(0), m_antialiasType(antialiasType), m_antialiasValue(antialiasValue), m_isUnpaintedFromNAA(isUnpaintedFromNAA)
{
if (filepath1 != TFilePath()) {
m_levelIn1 = filepath1.getParentDir() + filepath1.getLevelName();
if (outFolder != TFilePath())
m_levelOut = m_levelIn1.withParentDir(outFolder).withNoFrame().withType("tlv");
else
m_levelOut = m_levelIn1.withNoFrame().withType("tlv"); //filePaths[0].getParentDir() + TFilePath(filePaths[0].getWideName() + L".tlv");
if (outName != "")
m_levelOut = m_levelOut.withName(outName.toStdString());
}
if (filepath2 != TFilePath())
m_levelIn2 = filepath2.getParentDir() + filepath2.getLevelName();
}
示例3: removeFileOrLevel_throw
void TSystem::removeFileOrLevel_throw(const TFilePath &fp) {
if (fp.isLevelName()) {
TFilePathSet files;
files = TSystem::readDirectory(fp.getParentDir(), false, true, true);
TFilePathSet::iterator it, end = files.end();
for (it = files.begin(); it != end; ++it) {
if (it->getLevelName() == fp.getLevelName()) TSystem::deleteFile(*it);
}
} else
TSystem::deleteFile(fp);
}