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 char *filename, size_t basepath_length, const char *tar_filename=NULL) |
Add a file with the given filename. | |
bool | AddFile (Subdirectory sd, const char *filename) |
Add a single file to the scanned files of a tar, circumventing the scanning code. | |
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. |
Helper for scanning for files with tar as extension.
Definition at line 95 of file fileio_func.h.
enum TarScanner::Mode |
The mode of tar scanning.
Definition at line 99 of file fileio_func.h.
bool TarScanner::AddFile | ( | const char * | filename, | |
size_t | basepath_length, | |||
const char * | tar_filename = NULL | |||
) | [virtual] |
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 705 of file fileio.cpp.
References Align(), DEBUG, lastof, SimplifyFileName(), and strecpy().
Referenced by AddFile(), and ClientNetworkContentSocketHandler::AfterDownload().
bool TarScanner::AddFile | ( | Subdirectory | sd, | |
const char * | 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 699 of file fileio.cpp.
References AddFile().
uint TarScanner::DoScan | ( | TarScanner::Mode | mode | ) | [static] |
Do the scan for Tars.
Definition at line 666 of file fileio.cpp.
References AI, AI_DIR, AI_LIBRARY_DIR, BASESET, BASESET_DIR, DEBUG, DoScan(), GAME, GAME_DIR, GAME_LIBRARY_DIR, HEIGHTMAP_DIR, NEWGRF, NEWGRF_DIR, SCENARIO, and SCENARIO_DIR.
uint TarScanner::DoScan | ( | Subdirectory | sd | ) | [private] |
Perform the scanning of a particular subdirectory.
subdir | The subdirectory to scan. |
Definition at line 657 of file fileio.cpp.
References BASESET_DIR, NEWGRF_DIR, OLD_DATA_DIR, and FileScanner::Scan().
Referenced by DoScan(), DoScanNewGRFFiles(), Game::Initialize(), AI::Initialize(), AfterNewGRFScan::OnNewGRFsScanned(), AI::Rescan(), and NetworkContentDownloadStatusWindow::~NetworkContentDownloadStatusWindow().