本文整理汇总了C++中common::ArchiveMemberList类的典型用法代码示例。如果您正苦于以下问题:C++ ArchiveMemberList类的具体用法?C++ ArchiveMemberList怎么用?C++ ArchiveMemberList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ArchiveMemberList类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: listMembers
int PlainArchive::listMembers(Common::ArchiveMemberList &list) const {
int count = 0;
for (FileMap::const_iterator i = _files.begin(); i != _files.end(); ++i) {
list.push_back(Common::ArchiveMemberList::value_type(new Common::GenericArchiveMember(i->_key, this)));
++count;
}
return count;
}
开发者ID:CatalystG,项目名称:scummvm,代码行数:10,代码来源:resource_intern.cpp
示例2: listMembers
int XARCArchive::listMembers(Common::ArchiveMemberList &list) const {
int files = 0;
for (Common::ArchiveMemberList::const_iterator it = _members.begin(); it != _members.end(); ++it) {
// Add all the members to the list
list.push_back(*it);
files++;
}
return files;
}
开发者ID:Snejp,项目名称:tlj-residual,代码行数:10,代码来源:archive.cpp
示例3: listMembers
int PackageSet::listMembers(Common::ArchiveMemberList &list) const {
Common::HashMap<Common::String, Common::ArchiveMemberPtr>::const_iterator it = _files.begin();
Common::HashMap<Common::String, Common::ArchiveMemberPtr>::const_iterator end = _files.end();
int count = 0;
for (; it != end; ++it) {
const Common::ArchiveMemberPtr ptr(it->_value);
list.push_back(ptr);
count++;
}
return count;
}
开发者ID:Fyre91,项目名称:scummvm,代码行数:11,代码来源:base_package.cpp
示例4: listMembers
int AndroidAssetArchive::listMembers(Common::ArchiveMemberList &member_list) {
JNIEnv *env = JNI::getEnv();
Common::List<Common::String> dirlist;
dirlist.push_back("");
int count = 0;
while (!dirlist.empty()) {
const Common::String dir = dirlist.back();
dirlist.pop_back();
jstring jpath = env->NewStringUTF(dir.c_str());
jobjectArray jpathlist =
(jobjectArray)env->CallObjectMethod(_am, MID_list, jpath);
if (env->ExceptionCheck()) {
warning("Error while calling AssetManager->list(%s). Ignoring.",
dir.c_str());
env->ExceptionDescribe();
env->ExceptionClear();
// May as well keep going ...
continue;
}
env->DeleteLocalRef(jpath);
for (jsize i = 0; i < env->GetArrayLength(jpathlist); ++i) {
jstring elem = (jstring)env->GetObjectArrayElement(jpathlist, i);
const char *p = env->GetStringUTFChars(elem, 0);
Common::String thispath = dir;
if (!thispath.empty())
thispath += "/";
thispath += p;
// Assume files have a . in them, and directories don't
if (strchr(p, '.')) {
member_list.push_back(getMember(thispath));
++count;
} else {
dirlist.push_back(thispath);
}
env->ReleaseStringUTFChars(elem, p);
env->DeleteLocalRef(elem);
}
env->DeleteLocalRef(jpathlist);
}
return count;
}
开发者ID:dhewg,项目名称:scummvm,代码行数:53,代码来源:asset-archive.cpp
示例5: listMatchingMembers
int XARCArchive::listMatchingMembers(Common::ArchiveMemberList &list, const Common::String &pattern) {
int matches = 0;
for (Common::ArchiveMemberList::iterator it = _members.begin(); it != _members.end(); ++it) {
if ((*it)->getName().matchString(pattern)) {
// This file matches, add it
list.push_back(*it);
matches++;
}
}
return matches;
}
开发者ID:Snejp,项目名称:tlj-residual,代码行数:12,代码来源:archive.cpp
示例6: runTests
void Lingo::runTests() {
Common::File inFile;
Common::ArchiveMemberList fsList;
SearchMan.listMatchingMembers(fsList, "*.lingo");
Common::StringArray fileList;
int counter = 1;
for (Common::ArchiveMemberList::iterator it = fsList.begin(); it != fsList.end(); ++it)
fileList.push_back((*it)->getName());
Common::sort(fileList.begin(), fileList.end());
for (uint i = 0; i < fileList.size(); i++) {
Common::SeekableReadStream *const stream = SearchMan.createReadStreamForMember(fileList[i]);
if (stream) {
uint size = stream->size();
char *script = (char *)calloc(size + 1, 1);
stream->read(script, size);
debugC(2, kDebugLingoCompile, "Compiling file %s of size %d, id: %d", fileList[i].c_str(), size, counter);
_hadError = false;
addCode(script, kMovieScript, counter);
if (!_hadError)
executeScript(kMovieScript, counter);
else
debugC(2, kDebugLingoCompile, "Skipping execution");
free(script);
counter++;
}
inFile.close();
}
}
开发者ID:RobLoach,项目名称:scummvm,代码行数:40,代码来源:lingo.cpp
示例7: listSavefiles
Common::StringArray DefaultSaveFileManager::listSavefiles(const Common::String &pattern) {
Common::String savePathName = getSavePath();
checkPath(Common::FSNode(savePathName));
if (getError().getCode() != Common::kNoError)
return Common::StringArray();
// recreate FSNode since checkPath may have changed/created the directory
Common::FSNode savePath(savePathName);
Common::FSDirectory dir(savePath);
Common::ArchiveMemberList savefiles;
Common::StringArray results;
Common::String search(pattern);
if (dir.listMatchingMembers(savefiles, search) > 0) {
for (Common::ArchiveMemberList::const_iterator file = savefiles.begin(); file != savefiles.end(); ++file) {
results.push_back((*file)->getName());
}
}
return results;
}
开发者ID:0xf1sh,项目名称:scummvm,代码行数:22,代码来源:default-saves.cpp
示例8: listMembers
int AndroidAssetArchive::listMembers(Common::ArchiveMemberList &member_list) const {
if (_hasCached) {
member_list.insert(member_list.end(), _cachedMembers.begin(), _cachedMembers.end());
return _cachedMembers.size();
}
int count = 0;
AAssetDir *dir = AAssetManager_openDir(_am, "");
const char *file = AAssetDir_getNextFileName(dir);
while (file) {
member_list.push_back(getMember(file));
++count;
file = AAssetDir_getNextFileName(dir);
}
AAssetDir_close(dir);
_cachedMembers = Common::ArchiveMemberList(member_list);
_hasCached = true;
return count;
}
开发者ID:86400,项目名称:scummvm,代码行数:22,代码来源:asset-archive.cpp
示例9: openArchive
void ZipSoundArchive::openArchive(const char *path, const char *extension, SoundFormat format, int raw_frequency) {
closeArchive();
if ((format == RAW || format == RAW80) && !raw_frequency) {
error("openArchive() expects frequency for RAW data");
return;
}
debugCN(1, kDraciArchiverDebugLevel, "Trying to open ZIP archive %s: ", path);
_archive = Common::makeZipArchive(path);
_path = path;
_extension = extension;
_format = format;
_defaultFreq = raw_frequency;
if (_archive) {
Common::ArchiveMemberList files;
_archive->listMembers(files);
_sampleCount = files.size();
debugC(1, kDraciArchiverDebugLevel, "Capacity %d", _sampleCount);
} else {
debugC(1, kDraciArchiverDebugLevel, "Failed");
}
}
开发者ID:BenCastricum,项目名称:scummvm,代码行数:23,代码来源:sound.cpp
示例10: Lab
ResourceLoader::ResourceLoader() {
int lab_counter = 0;
_cacheDirty = false;
_cacheMemorySize = 0;
Lab *l;
Common::ArchiveMemberList files;
SearchMan.listMatchingMembers(files, "*.lab");
SearchMan.listMatchingMembers(files, "*.m4b");
if (files.empty())
error("Cannot find game data - check configuration file");
for (Common::ArchiveMemberList::const_iterator x = files.begin(); x != files.end(); ++x) {
const Common::String filename = (*x)->getName();
l = new Lab();
if (l->open(filename)) {
if (filename.equalsIgnoreCase("data005.lab"))
_labs.push_front(l);
else
_labs.push_back(l);
lab_counter++;
} else {
delete l;
}
}
files.clear();
if (g_grim->getGameFlags() & GF_DEMO) {
SearchMan.listMatchingMembers(files, "*.mus");
for (Common::ArchiveMemberList::const_iterator x = files.begin(); x != files.end(); ++x) {
const Common::String filename = (*x)->getName();
l = new Lab();
if (l->open(filename)) {
_labs.push_back(l);
lab_counter++;
} else {
delete l;
}
}
}
}
开发者ID:Templier,项目名称:residual,代码行数:47,代码来源:resource.cpp
示例11: listMembers
int ZipArchive::listMembers(Common::ArchiveMemberList &list) {
int matches = 0;
int err = unzGoToFirstFile(_zipFile);
while (err == UNZ_OK) {
char szCurrentFileName[UNZ_MAXFILENAMEINZIP+1];
if (unzGetCurrentFileInfo(_zipFile, NULL,
szCurrentFileName, sizeof(szCurrentFileName)-1,
NULL, 0, NULL, 0) == UNZ_OK) {
list.push_back(ArchiveMemberList::value_type(new GenericArchiveMember(szCurrentFileName, this)));
matches++;
}
err = unzGoToNextFile(_zipFile);
}
return matches;
}
开发者ID:St0rmcrow,项目名称:scummvm,代码行数:18,代码来源:unzip.cpp
示例12: listMembers
int NSArchive::listMembers(Common::ArchiveMemberList &list) const {
for (uint32 i = 0; i < _numFiles; i++) {
list.push_back(Common::SharedPtr<Common::GenericArchiveMember>(new Common::GenericArchiveMember(_archiveDir[i], this)));
}
return _numFiles;
}
开发者ID:project-cabal,项目名称:cabal,代码行数:6,代码来源:disk_ns.cpp
示例13: reset
bool Resource::reset() {
unloadAllPakFiles();
Common::FSNode dir(ConfMan.get("path"));
if (!dir.exists() || !dir.isDirectory())
error("invalid game path '%s'", dir.getPath().c_str());
if (_vm->game() == GI_KYRA1) {
// We only need kyra.dat for the demo.
if (_vm->gameFlags().isDemo && !_vm->gameFlags().isTalkie)
return true;
if (!_vm->gameFlags().isDemo && _vm->gameFlags().isTalkie) {
// List of files in the talkie version, which can never be unload.
static const char * const list[] = {
"ADL.PAK", "CHAPTER1.VRM", "COL.PAK", "FINALE.PAK", "INTRO1.PAK", "INTRO2.PAK",
"INTRO3.PAK", "INTRO4.PAK", "MISC.PAK", "SND.PAK", "STARTUP.PAK", "XMI.PAK",
"CAVE.APK", "DRAGON1.APK", "DRAGON2.APK", "LAGOON.APK", 0
};
loadProtectedFiles(list);
} else {
Common::ArchiveMemberList files;
_files.listMatchingMembers(files, "*.PAK");
_files.listMatchingMembers(files, "*.APK");
for (Common::ArchiveMemberList::const_iterator i = files.begin(); i != files.end(); ++i) {
Common::String name = (*i)->getName();
name.toUppercase();
// No PAK file
if (name == "TWMUSIC.PAK")
continue;
// We need to only load the script archive for the language the user specified
if (name == ((_vm->gameFlags().lang == Common::EN_ANY) ? "JMC.PAK" : "EMC.PAK"))
continue;
Common::Archive *archive = loadArchive(name, *i);
if (archive)
_files.add(name, archive, 0, false);
else
error("Couldn't load PAK file '%s'", name.c_str());
}
}
} else if (_vm->game() == GI_KYRA2) {
if (_vm->gameFlags().useInstallerPackage)
_files.add("installer", loadInstallerArchive("WESTWOOD", "%03d", 6), 2, false);
// mouse pointer, fonts, etc. required for initialization
if (_vm->gameFlags().isDemo && !_vm->gameFlags().isTalkie) {
loadPakFile("GENERAL.PAK");
} else {
loadPakFile("INTROGEN.PAK");
loadPakFile("OTHER.PAK");
}
} else if (_vm->game() == GI_KYRA3) {
if (_vm->gameFlags().useInstallerPackage) {
if (!loadPakFile("WESTWOOD.001"))
error("Couldn't load file: 'WESTWOOD.001'");
}
if (!loadFileList("FILEDATA.FDT"))
error("Couldn't load file: 'FILEDATA.FDT'");
} else if (_vm->game() == GI_LOL) {
if (_vm->gameFlags().useInstallerPackage)
_files.add("installer", loadInstallerArchive("WESTWOOD", "%d", 0), 2, false);
if (!_vm->gameFlags().isTalkie && !_vm->gameFlags().isDemo) {
static const char * const list[] = {
"GENERAL.PAK", 0
};
loadProtectedFiles(list);
}
} else {
error("Unknown game id: %d", _vm->game());
return false; // for compilers that don't support NORETURN
}
return true;
}
开发者ID:chrisws,项目名称:scummvm,代码行数:84,代码来源:resource.cpp
示例14: dumpEveryResultAction
void dumpEveryResultAction(const Common::String &destFile) {
Common::HashMap<Common::String, byte> count;
Common::HashMap<Common::String, bool> fileAlreadyUsed;
Common::DumpFile output;
output.open(destFile);
// Find scr files
Common::ArchiveMemberList list;
SearchMan.listMatchingMembers(list, "*.scr");
for (Common::ArchiveMemberList::iterator iter = list.begin(); iter != list.end(); ++iter) {
Common::SeekableReadStream *stream = (*iter)->createReadStream();
Common::String line = stream->readLine();
trimCommentsAndWhiteSpace(&line);
while (!stream->eos()) {
if (line.matchString("*:add*", true)) {
tryToDumpLine("add", line, &count, &fileAlreadyUsed, output);
} else if (line.matchString("*:animplay*", true)) {
tryToDumpLine("animplay", line, &count, &fileAlreadyUsed, output);
} else if (line.matchString("*:animpreload*", true)) {
tryToDumpLine("animpreload", line, &count, &fileAlreadyUsed, output);
} else if (line.matchString("*:animunload*", true)) {
tryToDumpLine("animunload", line, &count, &fileAlreadyUsed, output);
} else if (line.matchString("*:attenuate*", true)) {
tryToDumpLine("attenuate", line, &count, &fileAlreadyUsed, output);
} else if (line.matchString("*:assign*", true)) {
tryToDumpLine("assign", line, &count, &fileAlreadyUsed, output);
} else if (line.matchString("*:change_location*", true)) {
tryToDumpLine("change_location", line, &count, &fileAlreadyUsed, output);
} else if (line.matchString("*:crossfade*", true) && !fileAlreadyUsed["add"]) {
tryToDumpLine("crossfade", line, &count, &fileAlreadyUsed, output);
} else if (line.matchString("*:debug*", true)) {
tryToDumpLine("debug", line, &count, &fileAlreadyUsed, output);
} else if (line.matchString("*:delay_render*", true)) {
tryToDumpLine("delay_render", line, &count, &fileAlreadyUsed, output);
} else if (line.matchString("*:disable_control*", true)) {
tryToDumpLine("disable_control", line, &count, &fileAlreadyUsed, output);
} else if (line.matchString("*:disable_venus*", true)) {
tryToDumpLine("disable_venus", line, &count, &fileAlreadyUsed, output);
} else if (line.matchString("*:display_message*", true)) {
tryToDumpLine("display_message", line, &count, &fileAlreadyUsed, output);
} else if (line.matchString("*:dissolve*", true)) {
tryToDumpLine("dissolve", line, &count, &fileAlreadyUsed, output);
} else if (line.matchString("*:distort*", true)) {
tryToDumpLine("distort", line, &count, &fileAlreadyUsed, output);
} else if (line.matchString("*:enable_control*", true)) {
tryToDumpLine("enable_control", line, &count, &fileAlreadyUsed, output);
} else if (line.matchString("*:flush_mouse_events*", true)) {
tryToDumpLine("flush_mouse_events", line, &count, &fileAlreadyUsed, output);
} else if (line.matchString("*:inventory*", true)) {
tryToDumpLine("inventory", line, &count, &fileAlreadyUsed, output);
} else if (line.matchString("*:kill*", true)) {
tryToDumpLine("kill", line, &count, &fileAlreadyUsed, output);
} else if (line.matchString("*:menu_bar_enable*", true)) {
tryToDumpLine("menu_bar_enable", line, &count, &fileAlreadyUsed, output);
} else if (line.matchString("*:music*", true)) {
tryToDumpLine("music", line, &count, &fileAlreadyUsed, output);
} else if (line.matchString("*:pan_track*", true)) {
tryToDumpLine("pan_track", line, &count, &fileAlreadyUsed, output);
} else if (line.matchString("*:playpreload*", true)) {
tryToDumpLine("playpreload", line, &count, &fileAlreadyUsed, output);
} else if (line.matchString("*:preferences*", true)) {
tryToDumpLine("preferences", line, &count, &fileAlreadyUsed, output);
} else if (line.matchString("*:quit*", true)) {
tryToDumpLine("quit", line, &count, &fileAlreadyUsed, output);
} else if (line.matchString("*:random*", true)) {
tryToDumpLine("random", line, &count, &fileAlreadyUsed, output);
} else if (line.matchString("*:region*", true)) {
tryToDumpLine("region", line, &count, &fileAlreadyUsed, output);
} else if (line.matchString("*:restore_game*", true)) {
tryToDumpLine("restore_game", line, &count, &fileAlreadyUsed, output);
} else if (line.matchString("*:rotate_to*", true)) {
tryToDumpLine("rotate_to", line, &count, &fileAlreadyUsed, output);
} else if (line.matchString("*:save_game*", true)) {
tryToDumpLine("save_game", line, &count, &fileAlreadyUsed, output);
} else if (line.matchString("*:set_partial_screen*", true)) {
tryToDumpLine("set_partial_screen", line, &count, &fileAlreadyUsed, output);
} else if (line.matchString("*:set_screen*", true)) {
tryToDumpLine("set_screen", line, &count, &fileAlreadyUsed, output);
} else if (line.matchString("*:set_venus*", true)) {
tryToDumpLine("set_venus", line, &count, &fileAlreadyUsed, output);
} else if (line.matchString("*:stop*", true)) {
tryToDumpLine("stop", line, &count, &fileAlreadyUsed, output);
} else if (line.matchString("*:streamvideo*", true)) {
tryToDumpLine("streamvideo", line, &count, &fileAlreadyUsed, output);
} else if (line.matchString("*:syncsound*", true)) {
tryToDumpLine("syncsound", line, &count, &fileAlreadyUsed, output);
} else if (line.matchString("*:timer*", true)) {
tryToDumpLine("timer", line, &count, &fileAlreadyUsed, output);
} else if (line.matchString("*:ttytext*", true)) {
tryToDumpLine("ttytext", line, &count, &fileAlreadyUsed, output);
} else if (line.matchString("*:universe_music*", true)) {
tryToDumpLine("universe_music", line, &count, &fileAlreadyUsed, output);
}
line = stream->readLine();
trimCommentsAndWhiteSpace(&line);
//.........这里部分代码省略.........
开发者ID:lukaslw,项目名称:scummvm,代码行数:101,代码来源:utility.cpp
示例15: listMembers
int InstallerArchive::listMembers(Common::ArchiveMemberList &list) {
for (FileMap::const_iterator it = _map.begin(); it != _map.end(); it++)
list.push_back(getMember(it->_key));
return _map.size();
}
开发者ID:Templier,项目名称:scummvm-test,代码行数:6,代码来源:installer_archive.cpp
示例16: listMembers
int MsCabinet::listMembers(Common::ArchiveMemberList &list) const {
for (FileMap::const_iterator it = _fileMap.begin(); it != _fileMap.end(); it++)
list.push_back(getMember(it->_key));
return _fileMap.size();
}
开发者ID:karjonas,项目名称:residualvm,代码行数:6,代码来源:mscab.cpp
示例17: MemoryReadStream
Common::SeekableReadStream *openDiskFile(const Common::String &filename) {
uint32 prefixSize = 0;
Common::SeekableReadStream *file = NULL;
Common::String fixedFilename = filename;
// Absolute path: TODO: Add specific fallbacks here.
if (filename.contains(':')) {
if (filename.hasPrefix("c:\\windows\\fonts\\")) { // East Side Story refers to "c:\windows\fonts\framd.ttf"
fixedFilename = filename.c_str() + 17;
} else {
error("openDiskFile::Absolute path or invalid filename used in %s", filename.c_str());
}
}
// Try directly from SearchMan first
Common::ArchiveMemberList files;
SearchMan.listMatchingMembers(files, fixedFilename);
for (Common::ArchiveMemberList::iterator it = files.begin(); it != files.end(); ++it) {
if ((*it)->getName() == filename) {
file = (*it)->createReadStream();
break;
}
}
// File wasn't found in SearchMan, try to parse the path as a relative path.
if (!file) {
Common::FSNode searchNode = getNodeForRelativePath(filename);
if (searchNode.exists() && !searchNode.isDirectory() && searchNode.isReadable()) {
file = searchNode.createReadStream();
}
}
if (file) {
uint32 magic1, magic2;
magic1 = file->readUint32LE();
magic2 = file->readUint32LE();
bool compressed = false;
if (magic1 == DCGF_MAGIC && magic2 == COMPRESSED_FILE_MAGIC) {
compressed = true;
}
if (compressed) {
uint32 dataOffset, compSize, uncompSize;
dataOffset = file->readUint32LE();
compSize = file->readUint32LE();
uncompSize = file->readUint32LE();
byte *compBuffer = new byte[compSize];
if (!compBuffer) {
error("Error allocating memory for compressed file '%s'", filename.c_str());
delete file;
return NULL;
}
byte *data = new byte[uncompSize];
if (!data) {
error("Error allocating buffer for file '%s'", filename.c_str());
delete[] compBuffer;
delete file;
return NULL;
}
file->seek(dataOffset + prefixSize, SEEK_SET);
file->read(compBuffer, compSize);
if (Common::uncompress(data, (unsigned long *)&uncompSize, compBuffer, compSize) != true) {
error("Error uncompressing file '%s'", filename.c_str());
delete[] compBuffer;
delete file;
return NULL;
}
delete[] compBuffer;
delete file;
return new Common::MemoryReadStream(data, uncompSize, DisposeAfterUse::YES);
} else {
file->seek(0, SEEK_SET);
return file;
}
return file;
}
return NULL;
}
开发者ID:mokerjoke,项目名称:scummvm,代码行数:83,代码来源:base_disk_file.cpp
注:本文中的common::ArchiveMemberList类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论