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


C++ FileList::addDirectory方法代码示例

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


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

示例1: probe

bool TheWitcherEngineProbe::probe(const Common::UString &directory, const Common::FileList &rootFiles) const {
	// There should be a system directory
	Common::UString systemDir = Common::FilePath::findSubDirectory(directory, "system", true);
	if (systemDir.empty())
		return false;

	// The system directory has to be readable
	Common::FileList systemFiles;
	if (!systemFiles.addDirectory(systemDir))
		return false;

	// If either witcher.ini or witcher.exe exists, this should be a valid path
	return systemFiles.contains(".*/witcher.(exe|ini)", true);
}
开发者ID:gitter-badger,项目名称:xoreos,代码行数:14,代码来源:thewitcher.cpp

示例2: getCharacters

void NWNEngine::getCharacters(std::vector<Common::UString> &characters, bool local) {
	characters.clear();

	Common::UString pcDir = ConfigMan.getString(local ? "NWN_localPCDir" : "NWN_serverPCDir");
	if (pcDir.empty())
		return;

	Common::FileList chars;
	chars.addDirectory(pcDir);

	for (Common::FileList::const_iterator c = chars.begin(); c != chars.end(); ++c) {
		if (!Common::FilePath::getExtension(*c).equalsIgnoreCase(".bic"))
			continue;

		characters.push_back(Common::FilePath::getStem(*c));
	}
}
开发者ID:cc9cii,项目名称:xoreos,代码行数:17,代码来源:nwn.cpp

示例3: getModules

void NWNEngine::getModules(std::vector<Common::UString> &modules) {
	modules.clear();

	Common::UString moduleDir = ConfigMan.getString("NWN_extraModuleDir");
	if (moduleDir.empty())
		return;

	Common::FileList mods;
	mods.addDirectory(moduleDir);

	for (Common::FileList::const_iterator m = mods.begin(); m != mods.end(); ++m) {
		if (!Common::FilePath::getExtension(*m).equalsIgnoreCase(".mod"))
			continue;

		modules.push_back(Common::FilePath::getStem(*m));
	}

	std::sort(modules.begin(), modules.end(), Common::UString::iless());
}
开发者ID:cc9cii,项目名称:xoreos,代码行数:19,代码来源:nwn.cpp

示例4: addArchiveDir

void ResourceManager::addArchiveDir(ArchiveType archive, const Common::UString &dir) {
	if (archive == kArchiveNDS || archive == kArchiveHERF)
		return;

	assert((archive >= 0) && (archive < kArchiveMAX));

	Common::UString directory = Common::FilePath::findSubDirectory(_baseDir, dir, true);
	if (directory.empty())
		throw Common::Exception("No such directory \"%s\"", dir.c_str());

	Common::FileList dirFiles;
	if (!dirFiles.addDirectory(directory))
		throw Common::Exception("Can't read directory \"%s\"", directory.c_str());

	dirFiles.getSubList(kArchiveGlob[archive], _archiveFiles[archive], true);

	// If we're adding an ERF directory and .rim files are actually ERFs, add those too
	if ((archive == kArchiveERF) && _rimsAreERFs)
		dirFiles.getSubList(kArchiveGlob[kArchiveRIM], _archiveFiles[archive], true);

	_archiveDirs[archive].push_back(directory);
}
开发者ID:Hellzed,项目名称:xoreos,代码行数:22,代码来源:resman.cpp

示例5: findCampaigns

void Campaign::findCampaigns() {
	Common::UString moduleDir = ConfigMan.getString("WITCHER_moduleDir");
	if (moduleDir.empty())
		return;

	Common::FileList modules;
	if (!modules.addDirectory(moduleDir, -1))
		return;

	Common::FileList mmdFiles;
	if (!modules.getSubListGlob(".*\\.mmd", true, mmdFiles))
		return;

	for (Common::FileList::const_iterator c = mmdFiles.begin(); c != mmdFiles.end(); ++c) {
		CampaignDescription desc;

		desc.directory = Common::FilePath::relativize(moduleDir, Common::FilePath::getDirectory(*c));
		if (!readCampaign(*c, desc))
			continue;

		_campaigns.push_back(desc);
	}
}
开发者ID:Glyth,项目名称:xoreos,代码行数:23,代码来源:campaign.cpp

示例6: getModules

void Game::getModules(std::vector<Common::UString> &modules) {
	modules.clear();

	Common::UString moduleDir = ConfigMan.getString("KOTOR_moduleDir");
	if (moduleDir.empty())
		return;

	Common::FileList mods;
	mods.addDirectory(moduleDir);

	for (Common::FileList::const_iterator m = mods.begin(); m != mods.end(); ++m) {
		Common::UString file = m->toLower();
		if (!file.endsWith("_s.rim"))
			continue;

		file = Common::FilePath::getStem(file);
		file.truncate(file.size() - Common::UString("_s").size());

		modules.push_back(file);
	}

	std::sort(modules.begin(), modules.end(), Common::UString::iless());
}
开发者ID:farmboy0,项目名称:xoreos,代码行数:23,代码来源:game.cpp

示例7: probe

bool GameInstanceEngine::probe() {
	if (Common::FilePath::isDirectory(_target)) {
		// Try to probe from that directory

		Common::FileList rootFiles;

		if (!rootFiles.addDirectory(_target))
			// Fatal: can't read the directory
			return false;

		return probe(rootFiles);
	}

	if (Common::FilePath::isRegularFile(_target)) {
		// Try to probe from that file

		Common::ReadFile file;
		if (file.open(_target))
			return probe(file);
	}

	return false;
}
开发者ID:clone2727,项目名称:xoreos,代码行数:23,代码来源:enginemanager.cpp


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