本文整理汇总了C++中DataLoader::ListFiles方法的典型用法代码示例。如果您正苦于以下问题:C++ DataLoader::ListFiles方法的具体用法?C++ DataLoader::ListFiles怎么用?C++ DataLoader::ListFiles使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataLoader
的用法示例。
在下文中一共展示了DataLoader::ListFiles方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
ModConfig::FindMods()
{
disabled.destroy();
DataLoader* loader = DataLoader::GetLoader();
if (loader) {
loader->UseFileSystem(true);
loader->ListFiles("*.dat", disabled, true);
loader->UseFileSystem(Starshatter::UseFileSystem());
ListIter<Text> iter = disabled;
while (++iter) {
Text* name = iter.value();
name->setSensitive(false);
if (*name == "shatter.dat" ||
*name == "beta.dat" ||
*name == "start.dat" ||
*name == "irunin.dat" ||
*name == "vox.dat" ||
name->contains("uninstall") ||
enabled.contains(name))
delete iter.removeItem();
}
}
}
示例2: Load
void
Galaxy::Load()
{
DataLoader* loader = DataLoader::GetLoader();
loader->SetDataPath("Galaxy/");
sprintf_s(filename, "%s.def", (const char*) name);
Load(filename);
// load mod galaxies:
List<Text> mod_galaxies;
loader->SetDataPath("Mods/Galaxy/");
loader->ListFiles("*.def", mod_galaxies);
ListIter<Text> iter = mod_galaxies;
while (++iter) {
Text* name = iter.value();
if (!name->contains("/")) {
loader->SetDataPath("Mods/Galaxy/");
Load(name->data());
}
}
}
示例3: if
void
MusicDirector::ScanTracks()
{
DataLoader* loader = DataLoader::GetLoader();
bool old_file_system = loader->IsFileSystemEnabled();
loader->UseFileSystem(true);
loader->SetDataPath("Music/");
List<Text> files;
loader->ListFiles("*.ogg", files, true);
if (files.size() == 0) {
loader->UseFileSystem(old_file_system);
no_music = true;
return;
}
no_music = false;
ListIter<Text> iter = files;
while (++iter) {
Text* name = iter.value();
Text* file = new(__FILE__,__LINE__) Text("Music/");
name->setSensitive(false);
file->append(*name);
if (name->indexOf("Menu") == 0) {
menu_tracks.append(file);
}
else if (name->indexOf("Intro") == 0) {
intro_tracks.append(file);
}
else if (name->indexOf("Brief") == 0) {
brief_tracks.append(file);
}
else if (name->indexOf("Debrief") == 0) {
debrief_tracks.append(file);
}
else if (name->indexOf("Promot") == 0) {
promote_tracks.append(file);
}
else if (name->indexOf("Flight") == 0) {
flight_tracks.append(file);
}
else if (name->indexOf("Combat") == 0) {
combat_tracks.append(file);
}
else if (name->indexOf("Launch") == 0) {
launch_tracks.append(file);
}
else if (name->indexOf("Recovery") == 0) {
recovery_tracks.append(file);
}
else if (name->indexOf("Victory") == 0) {
victory_tracks.append(file);
}
else if (name->indexOf("Defeat") == 0) {
defeat_tracks.append(file);
}
else if (name->indexOf("Credit") == 0) {
credit_tracks.append(file);
}
else {
menu_tracks.append(file);
}
delete iter.removeItem();
}
loader->UseFileSystem(old_file_system);
menu_tracks.sort();
intro_tracks.sort();
brief_tracks.sort();
debrief_tracks.sort();
promote_tracks.sort();
flight_tracks.sort();
combat_tracks.sort();
launch_tracks.sort();
recovery_tracks.sort();
victory_tracks.sort();
defeat_tracks.sort();
credit_tracks.sort();
}