#include <advancedDetector.h>
|
| AdvancedMetaEngineDetectionBase (const void *descs, uint descItemSize, const PlainGameDescriptor *gameIds) |
|
virtual ADDetectedGame | fallbackDetect (const FileMap &allFiles, const Common::FSList &fslist, ADDetectedGameExtraInfo **extra=nullptr) const |
|
virtual ADDetectedGames | detectGame (const Common::FSNode &parent, const FileMap &allFiles, Common::Language language, Common::Platform platform, const Common::String &extra, uint32 skipADFlags=0, bool skipIncomplete=false) |
|
ADDetectedGame | detectGameFilebased (const FileMap &allFiles, const ADFileBasedFallback *fileBasedFallback) const |
|
void | composeFileHashMap (FileMap &allFiles, const Common::FSList &fslist, int depth, const Common::Path &parentName=Common::Path()) const |
|
bool | getFileProperties (const FileMap &allFiles, MD5Properties md5prop, const Common::Path &fname, FileProperties &fileProps) const |
|
virtual DetectedGame | toDetectedGame (const ADDetectedGame &adGame, ADDetectedGameExtraInfo *extraInfo=nullptr) const |
|
bool | cleanupPirated (ADDetectedGames &matched) const |
|
A MetaEngineDetection implementation based on the Advanced Detector code.
◆ FileMap
A hashmap of file paths and their file system nodes.
◆ AdvancedMetaEngineDetectionBase()
AdvancedMetaEngineDetectionBase::AdvancedMetaEngineDetectionBase |
( |
const void * |
descs, |
|
|
uint |
descItemSize, |
|
|
const PlainGameDescriptor * |
gameIds |
|
) |
| |
|
protected |
◆ getSupportedGames()
PlainGameList AdvancedMetaEngineDetectionBase::getSupportedGames |
( |
| ) |
const |
|
overridevirtual |
Return a list of targets supported by the engine.
Distinguishes engines with a single ID.
Implements MetaEngineDetection.
◆ findGame()
◆ identifyGame()
◆ detectGames()
Run the engine's game detector on the given list of files, and return a (possibly empty) list of games supported by the engine that were found among the given files.
Implements MetaEngineDetection.
Reimplemented in AGSMetaEngineDetection.
◆ getMD5Bytes()
uint AdvancedMetaEngineDetectionBase::getMD5Bytes |
( |
| ) |
const |
|
inlinefinaloverridevirtual |
Returns the number of bytes used for MD5-based detection, or 0 if not supported.
Implements MetaEngineDetection.
◆ getGameVariantCount()
int AdvancedMetaEngineDetectionBase::getGameVariantCount |
( |
| ) |
const |
|
inlinefinaloverridevirtual |
◆ dumpDetectionEntries()
void AdvancedMetaEngineDetectionBase::dumpDetectionEntries |
( |
| ) |
const |
|
finaloverridevirtual |
Returns formatted data from game descriptor for dumping into a file
Implements MetaEngineDetection.
◆ fallbackDetect()
An (optional) generic fallback detection function that is invoked if the regular MD5-based detection failed to detect anything.
Reimplemented in AGSMetaEngineDetection.
◆ detectGame()
Detect games in the specified directory.
Parameters language
and platform
are used to pass the values specified by the user. This is used to restrict search scope.
- Parameters
-
parent | Parent node of this file node. |
allFiles | List of all present files, as computed by the composeFileHashMap. |
language | Restrict results to the specified language. |
platform | Restrict results to the specified platform. |
extra | Restrict results to the specified extra string (only if kADFlagUseExtraAsHint is set). |
skipADFlags | Specify bitmask of ADGF flags to be ignored (for mass add). |
skipIncomplete | Ignore results with incomplete file/md5/size matches (for mass add). |
- Returns
- A list of ADGameDescription pointers corresponding to the matched games.
◆ detectGameFilebased()
Iterate over all ADFileBasedFallback records inside fileBasedFallback
and return 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.
- Parameters
-
allFiles | Map describing all present files |
fileBasedFallback | List of ADFileBasedFallback records, zero-terminated. |
◆ composeFileHashMap()
Compose a hashmap of all files in fslist
.
Removes trailing dots and ignores case in the process.
◆ getFileProperties()
Get the properties (size and MD5) of this file.
◆ toDetectedGame()
◆ cleanupPirated()
bool AdvancedMetaEngineDetectionBase::cleanupPirated |
( |
ADDetectedGames & |
matched | ) |
const |
|
protected |
Check for pirated games in the given detected games
◆ _gameDescriptors
const byte* AdvancedMetaEngineDetectionBase::_gameDescriptors |
|
protected |
◆ _descItemSize
const uint AdvancedMetaEngineDetectionBase::_descItemSize |
|
protected |
The size of a single entry of the above descriptions array.
Always must be >= sizeof(ADGameDescription).
◆ _gameIds
A list of all gameids (and their corresponding descriptions) supported by this engine.
◆ _md5Bytes
uint AdvancedMetaEngineDetectionBase::_md5Bytes |
|
protected |
The number of bytes to compute the MD5 checksum for.
The Advanced Detector 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.
◆ _flags
uint32 AdvancedMetaEngineDetectionBase::_flags |
|
protected |
A bitmask of flags which can be used to configure the behavior of the Advanced Detector.
See ADFlags for a list of flags that can be ORed together and passed here.
◆ _guiOptions
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.
◆ _maxScanDepth
uint32 AdvancedMetaEngineDetectionBase::_maxScanDepth |
|
protected |
Maximum depth of directories to look up.
If set to 0, the depth is 1 level.
◆ _directoryGlobs
const char* const* AdvancedMetaEngineDetectionBase::_directoryGlobs |
|
protected |
Case-insensitive list of directory globs that can be used for going deeper into the directory structure.
See String::matchString() method for format description.
- Note
- The last item must be 0.
◆ _maxAutogenLength
int AdvancedMetaEngineDetectionBase::_maxAutogenLength |
|
protected |
If ADGF_AUTOGENTARGET is used, then this specifies the max length of the autogenerated name. The default is 15.
◆ _fullPathGlobsDepth
int AdvancedMetaEngineDetectionBase::_fullPathGlobsDepth |
|
protected |
If kADFlagMatchFullPaths is set, then use this value for specifying depth for addSubDirectoryMatching() call The default is 5;
The documentation for this class was generated from the following file: