From ce2ba7ddc75cddaba4db04987e39cf681f19d8ae Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Sun, 30 Aug 2015 06:41:30 +0200 Subject: SHERLOCK: Add "listfiles" debugger command To make it easier to use the "dumpfile" command. There is little- to-no sanity checking in this one... --- engines/sherlock/debugger.cpp | 12 ++++++++++++ engines/sherlock/debugger.h | 5 +++++ 2 files changed, 17 insertions(+) (limited to 'engines') 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 \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 \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 @@ -54,6 +54,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 */ -- cgit v1.2.3