diff options
author | Matthew Hoops | 2012-08-26 15:49:45 -0400 |
---|---|---|
committer | Matthew Hoops | 2012-08-26 16:12:25 -0400 |
commit | bb1e60e8b2f3bba06ae3b089097f94ea82a70c8a (patch) | |
tree | a434233367725fbb6dc7072776c312f52254d57f /engines/advancedDetector.h | |
parent | 7a49b3669a0e18210a2f5409cb35da735f549b11 (diff) | |
parent | 857b92f8ffececa9c1f990d21a6a8d1630199a62 (diff) | |
download | scummvm-rg350-bb1e60e8b2f3bba06ae3b089097f94ea82a70c8a.tar.gz scummvm-rg350-bb1e60e8b2f3bba06ae3b089097f94ea82a70c8a.tar.bz2 scummvm-rg350-bb1e60e8b2f3bba06ae3b089097f94ea82a70c8a.zip |
Merge remote branch 'upstream/master' into pegasus
Conflicts:
AUTHORS
devtools/credits.pl
gui/credits.h
Diffstat (limited to 'engines/advancedDetector.h')
-rw-r--r-- | engines/advancedDetector.h | 29 |
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 |