aboutsummaryrefslogtreecommitdiff
path: root/engines/advancedDetector.h
diff options
context:
space:
mode:
Diffstat (limited to 'engines/advancedDetector.h')
-rw-r--r--engines/advancedDetector.h29
1 files changed, 28 insertions, 1 deletions
diff --git a/engines/advancedDetector.h b/engines/advancedDetector.h
index 45a9f183e8..8c19d03691 100644
--- a/engines/advancedDetector.h
+++ b/engines/advancedDetector.h
@@ -26,6 +26,8 @@
#include "engines/metaengine.h"
#include "engines/engine.h"
+#include "common/hash-str.h"
+
#include "common/gui_options.h" // FIXME: Temporary hack?
namespace Common {
@@ -46,6 +48,20 @@ struct ADGameFileDescription {
};
/**
+ * A record describing the properties of a file. Used on the existing
+ * files while detecting a game.
+ */
+struct ADFileProperties {
+ int32 size;
+ Common::String md5;
+};
+
+/**
+ * A map of all relevant existing files in a game directory while detecting.
+ */
+typedef Common::HashMap<Common::String, ADFileProperties, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> ADFilePropertiesMap;
+
+/**
* A shortcut to produce an empty ADGameFileDescription record. Used to mark
* the end of a list of these.
*/
@@ -286,9 +302,17 @@ protected:
* In case of a tie, the entry coming first in the list is chosen.
*
* @param allFiles a map describing all present files
+ * @param fslist a list of nodes for all present files
* @param fileBasedFallback a list of ADFileBasedFallback records, zero-terminated
+ * @param filesProps if not 0, return a map of properties for all detected files here
+ */
+ const ADGameDescription *detectGameFilebased(const FileMap &allFiles, const Common::FSList &fslist, const ADFileBasedFallback *fileBasedFallback, ADFilePropertiesMap *filesProps = 0) const;
+
+ /**
+ * Log and print a report that we found an unknown game variant, together with the file
+ * names, sizes and MD5 sums.
*/
- const ADGameDescription *detectGameFilebased(const FileMap &allFiles, const ADFileBasedFallback *fileBasedFallback) const;
+ void reportUnknown(const Common::FSNode &path, const ADFilePropertiesMap &filesProps) const;
// TODO
void updateGameDescriptor(GameDescriptor &desc, const ADGameDescription *realDesc) const;
@@ -298,6 +322,9 @@ protected:
* Includes nifty stuff like removing trailing dots and ignoring case.
*/
void composeFileHashMap(FileMap &allFiles, const Common::FSList &fslist, int depth) const;
+
+ /** Get the properties (size and MD5) of this file. */
+ bool getFileProperties(const Common::FSNode &parent, const FileMap &allFiles, const ADGameDescription &game, const Common::String fname, ADFileProperties &fileProps) const;
};
#endif