aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock
diff options
context:
space:
mode:
authorTorbjörn Andersson2015-08-30 06:41:30 +0200
committerTorbjörn Andersson2015-08-30 06:41:30 +0200
commitce2ba7ddc75cddaba4db04987e39cf681f19d8ae (patch)
tree079969ef68b60edddaf6fff85a7d0f117d5fb5cd /engines/sherlock
parentedd95b3eb6657997f3749fde43d8df7d934be20e (diff)
downloadscummvm-rg350-ce2ba7ddc75cddaba4db04987e39cf681f19d8ae.tar.gz
scummvm-rg350-ce2ba7ddc75cddaba4db04987e39cf681f19d8ae.tar.bz2
scummvm-rg350-ce2ba7ddc75cddaba4db04987e39cf681f19d8ae.zip
SHERLOCK: Add "listfiles" debugger command
To make it easier to use the "dumpfile" command. There is little- to-no sanity checking in this one...
Diffstat (limited to 'engines/sherlock')
-rw-r--r--engines/sherlock/debugger.cpp12
-rw-r--r--engines/sherlock/debugger.h5
2 files changed, 17 insertions, 0 deletions
diff --git a/engines/sherlock/debugger.cpp b/engines/sherlock/debugger.cpp
index b3c64e8e82..50293db648 100644
--- a/engines/sherlock/debugger.cpp
+++ b/engines/sherlock/debugger.cpp
@@ -47,6 +47,7 @@ Debugger::Debugger(SherlockEngine *vm) : GUI::Debugger(), _vm(vm) {
registerCmd("scene", WRAP_METHOD(Debugger, cmdScene));
registerCmd("song", WRAP_METHOD(Debugger, cmdSong));
registerCmd("songs", WRAP_METHOD(Debugger, cmdListSongs));
+ registerCmd("listfiles", WRAP_METHOD(Debugger, cmdListFiles));
registerCmd("dumpfile", WRAP_METHOD(Debugger, cmdDumpFile));
registerCmd("locations", WRAP_METHOD(Debugger, cmdLocations));
}
@@ -114,6 +115,17 @@ bool Debugger::cmdListSongs(int argc, const char **argv) {
return true;
}
+bool Debugger::cmdListFiles(int argc, const char **argv) {
+ if (argc != 2) {
+ debugPrintf("Format: listfiles <resource file>\n");
+ return true;
+ }
+ Common::StringArray files;
+ _vm->_res->getResourceNames(Common::String(argv[1]), files);
+ debugPrintColumns(files);
+ return true;
+}
+
bool Debugger::cmdDumpFile(int argc, const char **argv) {
if (argc != 2) {
debugPrintf("Format: dumpfile <resource name>\n");
diff --git a/engines/sherlock/debugger.h b/engines/sherlock/debugger.h
index 622098cf85..bcc4448c32 100644
--- a/engines/sherlock/debugger.h
+++ b/engines/sherlock/debugger.h
@@ -55,6 +55,11 @@ private:
bool cmdListSongs(int argc, const char **argv);
/**
+ * Lists all files in a library (use at your own risk)
+ */
+ bool cmdListFiles(int argc, const char **argv);
+
+ /**
* Dumps a file to disk
*/
bool cmdDumpFile(int argc, const char **argv);