-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfcrawler.h
110 lines (95 loc) · 2.69 KB
/
fcrawler.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/**
* @class FCrawler
*
* @brief FCrawler is responsible for searching games in defined Folders
*
* This class searches given Folders for Games.
* It is also capable of determining the Type of an folder.
* FCrawler can also search for all Steam-directories.
*
*/
#ifndef FCRAWLER_H
#define FCRAWLER_H
#include <QDir>
#include "fdb.h"
#include "libfusion_global.h"
class LIBFUSIONSHARED_EXPORT FCrawler
{
public:
FCrawler();
~FCrawler();
/**
* @fn scanAllFolders
* @brief Will Scan all Folders for new Games
*
* Start Scans in Folders based on their detected Type.
* Folders are defined in the DB, Table: watchedFolders
*/
void scanAllFolders();
/**
* @fn getType
* @brief Tries to Detect the Type of given Directory
*
* If it is from Steam, Origin, GOG or something else
*
* @param folder Folder to Check
* @return Type of Folder
*
* Tries to get the Folder-Type, based on its content. Actually, only Steam is implemented
*/
FGameType getType(FWatchedFolder folder);
private:
FDB db;
/**
* @fn getSteamGames
* @brief Scans a Steam-Library for Games
*
*
* @param folder Folder to Check
*
* Scans a SteamApps-Folder for Games. Adds all Missing games to the Lib.
*/
void getSteamGames(FWatchedFolder folder);
/**
* @fn getOriginGames
* @brief Scans the Origin Logfile for new Games and adds them
*
* Reads the Logfile, located in "C:\\ProgramData\\Origin\\Logs\\Client_Log.txt"; for new Games
* Adds them, if they are not found, in the Library.
*
* Succeeds for like 80% of games.
*
*/
void getOriginGames();
/**
* @fn getGalaxyGames
* @brief Scans the given Folder for GOG-Galaxy Games
*
* This is done by Reading all the "goggame-*.info"-Files from the Subdirectories.
* All found Games are inserted into the DB.
*
* @param folder Folder to Check
*
*/
void getGalaxyGames(FWatchedFolder folder);
/**
* @fn scanforLauncher
* @brief Scans the given Folder for Files with specific File-Endings
*
* The File-Endings are determined by Reading the Launcher from the DB witht the folder as the Key.
* All found Games are inserted into the DB.
* @param folder Folder to Check
*
*/
void scanforLauncher(FWatchedFolder folder);
/**
* @fn updateSteamDirs
* @brief Get all the Steam-Gamedirectories
*
* The directiries are read from the libraryfolders.vdf in the Steam-Dir.
* The found directories are added to the WatchedFolder list.
*
*/
void updateSteamDirs();
};
#endif // FCRAWLER_H