ZVISION: Allow dumping any file type via the new "dumpfiles" command

This commit is contained in:
Filippos Karapetis 2014-12-22 02:50:34 +02:00
parent 85644b8879
commit c2d83d287f
2 changed files with 9 additions and 4 deletions

View File

@ -52,7 +52,7 @@ Console::Console(ZVision *engine) : GUI::Debugger(), _engine(engine) {
registerCmd("setpanoramascale", WRAP_METHOD(Console, cmdSetPanoramaScale));
registerCmd("location", WRAP_METHOD(Console, cmdLocation));
registerCmd("dumpfile", WRAP_METHOD(Console, cmdDumpFile));
registerCmd("dumpallscripts", WRAP_METHOD(Console, cmdDumpAllScripts));
registerCmd("dumpfiles", WRAP_METHOD(Console, cmdDumpFiles));
}
bool Console::cmdLoadVideo(int argc, const char **argv) {
@ -237,12 +237,17 @@ bool Console::cmdDumpFile(int argc, const char **argv) {
return true;
}
bool Console::cmdDumpAllScripts(int argc, const char **argv) {
bool Console::cmdDumpFiles(int argc, const char **argv) {
Common::String fileName;
Common::SeekableReadStream *in;
if (argc != 2) {
debugPrintf("Use %s <file extension> to dump all files with a specific extension\n", argv[0]);
return true;
}
SearchManager::MatchList fileList;
_engine->getSearchManager()->listMembersWithExtension(fileList, "scr");
_engine->getSearchManager()->listMembersWithExtension(fileList, argv[1]);
for (SearchManager::MatchList::iterator iter = fileList.begin(); iter != fileList.end(); ++iter) {
fileName = iter->_value.name;

View File

@ -46,7 +46,7 @@ private:
bool cmdSetPanoramaScale(int argc, const char **argv);
bool cmdLocation(int argc, const char **argv);
bool cmdDumpFile(int argc, const char **argv);
bool cmdDumpAllScripts(int argc, const char **argv);
bool cmdDumpFiles(int argc, const char **argv);
};
} // End of namespace ZVision