A MetaEngine implementation based around the advanced detector code.
List of all members.
Public Member Functions
| ||AdvancedMetaEngine (const void *descs, uint descItemSize, const PlainGameDescriptor *gameIds, const ADExtraGuiOptionsMap *extraGuiOptions=0)|
|PlainGameList ||getSupportedGames () const override|
| ||Returns list of targets supported by the engine. |
|PlainGameDescriptor ||findGame (const char *gameId) const override|
| ||Query the engine for a PlainGameDescriptor for the specified gameid, if any. |
|DetectedGames ||detectGames (const Common::FSList &fslist) const override|
| ||Runs the engine's game detector on the given list of files, and returns a (possibly empty) list of games supported by the engine which it was able to detect amongst the given files. |
|virtual Common::Error ||createInstance (OSystem *syst, Engine **engine) const override|
| ||Tries to instantiate an engine instance based on the settings of the currently active ConfMan target. |
|virtual const ExtraGuiOptions ||getExtraGuiOptions (const Common::String &target) const override|
| ||Return a list of extra GUI options for the specified target. |
Protected Member Functions
|virtual bool ||createInstance (OSystem *syst, Engine **engine, const ADGameDescription *desc) const =0|
|virtual ADDetectedGame ||fallbackDetect (const FileMap &allFiles, const Common::FSList &fslist) const |
| ||An (optional) generic fallback detect function which is invoked if the regular MD5 based detection failed to detect anything. |
|virtual ADDetectedGames ||detectGame (const Common::FSNode &parent, const FileMap &allFiles, Common::Language language, Common::Platform platform, const Common::String &extra) const |
| ||Detect games in specified directory. |
|ADDetectedGame ||detectGameFilebased (const FileMap &allFiles, const Common::FSList &fslist, const ADFileBasedFallback *fileBasedFallback) const |
| ||Iterates over all ADFileBasedFallback records inside fileBasedFallback. |
|void ||composeFileHashMap (FileMap &allFiles, const Common::FSList &fslist, int depth, const Common::String &parentName=Common::String()) const |
| ||Compose a hashmap of all files in fslist. |
|bool ||getFileProperties (const Common::FSNode &parent, const FileMap &allFiles, const ADGameDescription &game, const Common::String fname, FileProperties &fileProps) const |
| ||Get the properties (size and MD5) of this file. |
|virtual DetectedGame ||toDetectedGame (const ADDetectedGame &adGame) const |
| ||Convert an AD game description into the shared game description format. |
|const byte * ||_gameDescriptors|
| ||Pointer to an array of objects which are either ADGameDescription or superset structures (i.e. |
|const uint ||_descItemSize|
| ||The size of a single entry of the above descs array. |
|const PlainGameDescriptor * ||_gameIds|
| ||A list of all gameids (and their corresponding descriptions) supported by this engine. |
|const ADExtraGuiOptionsMap *const ||_extraGuiOptions|
| ||A map containing all the extra game GUI options the engine supports. |
| ||The number of bytes to compute MD5 sum for. |
| ||A bitmask of flags which can be used to configure the behavior of the AdvancedDetector. |
| ||A list of game GUI options which will be added to each entry in addition to per-game options. |
| ||Maximum depth of directories to look up. |
|const char *const * ||_directoryGlobs|
| ||Case-insensitive list of directory globs which could be used for going deeper into the directory structure. |
| ||If true, filenames will be matched against the entire path, relative to the root detection directory (e.g. |
Private Member Functions
|void ||initSubSystems (const ADGameDescription *gameDesc) const |
A MetaEngine implementation based around the advanced detector code.
Definition at line 171 of file advancedDetector.h.
Member Typedef Documentation
Constructor & Destructor Documentation
Member Function Documentation
Compose a hashmap of all files in fslist.
Includes nifty stuff like removing trailing dots and ignoring case.
Definition at line 318 of file advancedDetector.cpp.
Tries to instantiate an engine instance based on the settings of the currently active ConfMan target.
That is, the MetaEngine should query the ConfMan singleton for the target, gameid, path etc. data.
|syst ||Pointer to the global OSystem object |
|engine ||Pointer to a pointer which the MetaEngine sets to the newly create Engine, or 0 in case of an error |
- a Common::Error describing the error which occurred, or kNoError
Reimplemented in Grim::GrimMetaEngine.
Definition at line 224 of file advancedDetector.cpp.
Detect games in specified directory.
Parameters language and platform are used to pass on values specified by the user. This is used to restrict search scope.
|allFiles ||list of all present files, as computed by composeFileHashMap |
|language ||restrict results to specified language |
|platform ||restrict results to specified platform |
|extra ||restrict results to specified extra string (only if kADFlagUseExtraAsHint is set) |
- list of ADGameDescription pointers corresponding to matched games
Definition at line 388 of file advancedDetector.cpp.
Iterates over all ADFileBasedFallback records inside fileBasedFallback.
This then returns the record (or rather, the ADGameDescription contained in it) for which all files described by it are present, and among those the one with the maximal number of matching files. In case of a tie, the entry coming first in the list is chosen.
|allFiles ||a map describing all present files |
|fslist ||a list of nodes for all present files |
|fileBasedFallback ||a list of ADFileBasedFallback records, zero-terminated |
|filesProps ||if not 0, return a map of properties for all detected files here |
Definition at line 513 of file advancedDetector.cpp.
Runs the engine's game detector on the given list of files, and returns a (possibly empty) list of games supported by the engine which it was able to detect amongst the given files.
Definition at line 150 of file advancedDetector.cpp.
||const char *
Return a list of extra GUI options for the specified target.
If no target is specified, all of the available custom GUI options are Returned for the plugin (used to set default values).
Currently, this only supports options with checkboxes.
The default implementation returns an empty list.
|target ||name of a config manager target |
- a list of extra GUI options for an engine plugin and target
Reimplemented from MetaEngine.
Definition at line 196 of file advancedDetector.cpp.
||const ADGameDescription *
Convert an AD game description into the shared game description format.
Definition at line 84 of file advancedDetector.cpp.
Member Data Documentation
The size of a single entry of the above descs array.
Always must be >= sizeof(ADGameDescription).
Definition at line 185 of file advancedDetector.h.
Case-insensitive list of directory globs which could be used for going deeper into the directory structure.
- See also:
- String::matchString() method for format description.
- Last item must be 0
Definition at line 235 of file advancedDetector.h.
A bitmask of flags which can be used to configure the behavior of the AdvancedDetector.
Refer to ADFlags for a list of flags that can be ORed together and passed here.
Definition at line 213 of file advancedDetector.h.
A list of all gameids (and their corresponding descriptions) supported by this engine.
Definition at line 191 of file advancedDetector.h.
A list of game GUI options which will be added to each entry in addition to per-game options.
Refer to GameGUIOption enum for the list.
Definition at line 220 of file advancedDetector.h.
If true, filenames will be matched against the entire path, relative to the root detection directory (e.g.
"foo/bar.000" for a file at "<root>/foo/bar.000"). Otherwise, filenames only match the basename (e.g. "bar.000" for the same file).
- _maxScanDepth and _directoryGlobs must still be configured to allow the detector to find files inside subdirectories.
Definition at line 246 of file advancedDetector.h.
Maximum depth of directories to look up.
If set to 0, the depth is 1 level
Definition at line 226 of file advancedDetector.h.
The number of bytes to compute MD5 sum for.
The AdvancedDetector is primarily based on computing and matching MD5 checksums of files. Since doing that for large files can be slow, it can be restricted to a subset of all files. Typically this will be set to something between 5 and 50 kilobytes, but arbitrary non-zero values are possible. The default is 5000.
Definition at line 206 of file advancedDetector.h.
The documentation for this class was generated from the following files:
Generated on Sat Aug 1 2020 05:03:04 for ResidualVM by 1.7.1