Helper for scanning for files with a given name. More...
#include <fileio_func.h>
Public Member Functions | |
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 extention in the given search path. | |
uint | Scan (const char *extension, const char *directory, bool recursive=true) |
Scan for files with the given extention in the given search path. | |
virtual bool | AddFile (const char *filename, size_t basepath_length)=0 |
Add a file with the given filename. |
Helper for scanning for files with a given name.
Definition at line 70 of file fileio_func.h.
virtual FileScanner::~FileScanner | ( | ) | [inline, virtual] |
virtual bool FileScanner::AddFile | ( | const char * | filename, | |
size_t | basepath_length | |||
) | [pure 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. |
Implemented in AIFileChecksumCreator, BaseMedia< Tbase_set >, TarScanner, FiosFileScanner, ScenarioScanner, GRFFileScanner, BaseMedia< SoundsSet >, BaseMedia< MusicSet >, and BaseMedia< GraphicsSet >.
Referenced by ScanPath(), and ScanTar().
uint FileScanner::Scan | ( | const char * | extension, | |
const char * | directory, | |||
bool | recursive = true | |||
) |
Scan for files with the given extention in the given search path.
extension | the extension of files to search for. | |
directory | the sub directory to search in. | |
recursive | whether to search recursively |
Definition at line 1247 of file fileio.cpp.
References AppendPathSeparator(), lastof, lengthof, ScanPath(), and strecpy().
uint FileScanner::Scan | ( | const char * | extension, | |
Subdirectory | sd, | |||
bool | tars = true , |
|||
bool | recursive = true | |||
) |
Scan for files with the given extention in the given search path.
extension | the extension of files to search for. | |
sd | the sub directory to search in. | |
tars | whether to search in the tars too. | |
recursive | whether to search recursively |
Definition at line 1215 of file fileio.cpp.
References _do_scan_working_directory, FOR_ALL_SEARCHPATHS, ScanPath(), ScanTar(), and SP_WORKING_DIR.
Referenced by GRFFileScanner::DoScan(), TarScanner::DoScan(), BaseMedia< GraphicsSet >::FindSets(), FiosGetFileList(), IsSameAI(), and ScenarioScanner::Scan().