OpenTTD Source
1.11.2
|
Helper for scanning for files with tar as extension. More...
#include <fileio_func.h>
Public Types | |
enum | Mode { NONE = 0, BASESET = 1 << 0, NEWGRF = 1 << 1, AI = 1 << 2, SCENARIO = 1 << 3, GAME = 1 << 4, ALL = BASESET | NEWGRF | AI | SCENARIO | GAME } |
The mode of tar scanning. More... | |
Public Member Functions | |
bool | AddFile (const std::string &filename, size_t basepath_length, const std::string &tar_filename={}) override |
Add a file with the given filename. More... | |
bool | AddFile (Subdirectory sd, const std::string &filename) |
Add a single file to the scanned files of a tar, circumventing the scanning code. More... | |
Static Public Member Functions | |
static uint | DoScan (TarScanner::Mode mode) |
Do the scan for Tars. | |
Private Member Functions | |
uint | DoScan (Subdirectory sd) |
Perform the scanning of a particular subdirectory. More... | |
![]() | |
virtual | ~FileScanner () |
Destruct the proper one... | |
uint | Scan (const char *extension, Subdirectory sd, bool tars=true, bool recursive=true) |
Scan for files with the given extension in the given search path. More... | |
uint | Scan (const char *extension, const char *directory, bool recursive=true) |
Scan for files with the given extension in the given search path. More... | |
Additional Inherited Members | |
![]() | |
Subdirectory | subdir |
The current sub directory we are searching through. | |
Helper for scanning for files with tar as extension.
Definition at line 81 of file fileio_func.h.
enum TarScanner::Mode |
The mode of tar scanning.
Definition at line 85 of file fileio_func.h.
|
overridevirtual |
Add a file with the given filename.
filename | the full path to the file to read |
basepath_length | amount of characters to chop of before to get a filename relative to the search path. |
tar_filename | the name of the tar file the file is read from. |
< Name of the file
< Size of the file, in ASCII
< Path of the file
< Temporary list to collect links
Implements FileScanner.
Definition at line 620 of file fileio.cpp.
Referenced by AddFile().
bool TarScanner::AddFile | ( | Subdirectory | sd, |
const std::string & | filename | ||
) |
Add a single file to the scanned files of a tar, circumventing the scanning code.
sd | The sub directory the file is in. |
filename | The name of the file to add. |
Definition at line 614 of file fileio.cpp.
References AddFile().
|
private |
Perform the scanning of a particular subdirectory.
sd | The subdirectory to scan. |
Definition at line 572 of file fileio.cpp.
Referenced by DoScan(), DoScanNewGRFFiles(), Game::Initialize(), AI::Initialize(), AfterNewGRFScan::OnNewGRFsScanned(), AI::Rescan(), and NetworkContentDownloadStatusWindow::~NetworkContentDownloadStatusWindow().