43
edits
(→Misc) |
(Added the FSNode use cases) |
||
Line 3: | Line 3: | ||
It should be noted that the diagrams don't list all methods (for example, when a class inherits them) for brevity and clarity. | It should be noted that the diagrams don't list all methods (for example, when a class inherits them) for brevity and clarity. | ||
== Common::FilesystemNode use cases == | |||
This is a list of the use cases for all classes who employ the FilesystemNode. It was created by looking through each file that references ''fs.h'' or ''fs.cpp''. | |||
---------------------------- | |||
#include "common/fs.h" : 30 | |||
---------------------------- | |||
* '''backends/plugins/posix/posix-provider.cpp''' | |||
1) getPlugins(): list all files in a directory using listDir(kListFilesOnly). | |||
* '''backends/plugins/sdl/sdl-provider.cpp''' | |||
1) getPlugins(): list all files in a directory using listDir(kListFilesOnly). | |||
* '''backends/plugins/win32/win32-provider.cpp''' | |||
1) getPlugins(): list all files in a directory using listDir(kListFilesOnly). | |||
* '''backends/plugins/dc/dc-provider.cpp''' | |||
1) getPlugins(): list all files in a directory using listDir(kListFilesOnly). | |||
* '''backends/platform/wince/CELauncherDialog.h''' | |||
1) automaticScanDirectory(FSNode): internally recurses files and dirs using listDir(kListFilesOnly) and listDir(kListDirectoriesOnly). | |||
* '''backends/fs/abstract-fs.h''' | |||
-) friend statement. **special case** | |||
* '''base/main.cpp''' | |||
1) runGame(): uses isDirectory() for checking the game path. | |||
* '''base/commandLine.cpp''' | |||
1) runDetectorTest(): uses listDir(kListAll). | |||
Also, there's several command line options (path, soundfont, savepath, themepath) which are paths and have a "//TODO: path is valid" flag. | |||
* '''common/advancedDetector.h''' | |||
1) detectAllGames(FSList): calls detectGame(). | |||
2) detectGameForEngineCreation(): uses listDir(kListFilesOnly). | |||
3) detectGame(FSList): uses isDirectory(), name() and path(). | |||
* '''common/file.cpp''' | |||
-) extensive use. **special case** | |||
* '''common/md5.h''' | |||
1) md5_file_string(FSNode): checks for isValid() and isDirectory() before calculating the MD5 checksum. | |||
* '''engines/sword1/sword1.cpp''' | |||
1) Sword1CheckDirectory(FSList): isDirectory(), name(), listDir(kListFilesOnly). | |||
2) Engine_SWORD1_detectGames(FSList): calls Sword1CheckDirectory(). | |||
* '''engines/sword2/sword2.cpp''' | |||
1) Engine_SWORD2_detectGames(FSList):isDirectory(), name(), listDir(kListAll). | |||
2) Engine_SWORD2_create(): listDir(kListAll). Calls Engine_SWORD2_detectGames(). | |||
* '''engines/scumm/scumm.cpp''' | |||
-) removed the include and compilation went fine. Don't see any forward declarations. | |||
* '''engines/scumm/plugin.cpp''' | |||
1) searchFSNode(FSList, String, FilesystemNode): searches for a node within a list using an iterator. As discussed earlier, this could be moved into the FSNode class. | |||
2) detectLanguage(FSList, byte id): calls searchFSNode(). Also uses isDirectory(), listDir(kListFilesOnly). | |||
3) computeGameSettingsFromMD5(FSList, ...): calls detectLanguage(). | |||
4) detectGames(FSList, ...): isDirectory() calls computeGameSettingsFromMD5(). | |||
5) Engine_SCUMM_detectGames(FSList): calls detectGames(). | |||
6) Engine_SCUMM_create(): creates a FSList using listDir(kListFilesOnly). | |||
* '''engines/agos/agos.cpp''' | |||
-) removed the include and compilation went fine. Don't see any forward declarations. | |||
* '''engines/agi/agi.cpp''' | |||
-) removed the include and compilation went fine. Don't see any forward declarations. | |||
* '''engines/agi/agi_v3.cpp''' | |||
1) detectGame(): creates a FSList using listDir(kListFilesOnly). name() | |||
* '''engines/sky/sky.cpp''' | |||
1) Engine_SKY_detectGames(FSList): isDirectory(), name(), path(). | |||
* '''engines/kyra/resource.cpp''' | |||
1) Resource(): listDir(kListFilesOnly), path(), name(). | |||
Note: (uses strings for chars pretty much exclusively) | |||
* '''engines/lure/lure.cpp''' | |||
1) Engine_LURE_detectGames(FSList): isDirectory(), name(). | |||
* '''engines/gob/gob.cpp''' | |||
-) removed the include and compilation went fine. Don't see any forward declarations. | |||
* '''engines/queen/queen.cpp''' | |||
1) Engine_QUEEN_detectGames(FSList): isDirectory(), name(). | |||
* '''engines/cine/cine.cpp''' | |||
-) removed the include and compilation went fine. Don't see any forward declarations. | |||
* '''gui/themebrowser.h|cpp''' | |||
1) addDir(...): isValid(), listDir(kListAll), path(). Calls isTheme(). | |||
2) isTheme(FilesystemNode, ...): name(). | |||
* '''gui/browser.h|cpp''' | |||
1) open(): create a FSNode object. | |||
2) handleCommand(...): isDirectory(), getParent(). | |||
3) getResult(): returns a FSNode object. | |||
4) updateListing(): path(), listDir(dirs/all), isDirectory(), displayName(). | |||
* '''gui/options.cpp''' | |||
1) handleCommand(...): create FSNodes, path(). | |||
* '''gui/launcher.cpp''' | |||
1) handleCommand(...): create FSNodes, path(). | |||
2) addGame(): listDir(kListAll), path(). | |||
* '''gui/massadd.h|cpp''' | |||
1) MassAddDialog(FSNode): pushes the node in a stack. | |||
2) handleTickle(): listDir(kListAll), path(), is Directory(). | |||
------------------- | |||
#include "fs.h": 2 | |||
------------------- | |||
* '''backends/fs/ds/ds-fs.h|cpp''' (duplicate include) | |||
== Common::File redesign discussion == | == Common::File redesign discussion == |
edits