OpenTTD
Public Member Functions | Static Public Member Functions | Private Attributes
GRFFileScanner Class Reference

Helper for scanning for files with GRF as extension. More...

Inheritance diagram for GRFFileScanner:
FileScanner

Public Member Functions

bool AddFile (const char *filename, size_t basepath_length, const char *tar_filename)
 Add a file with the given filename. More...
 

Static Public Member Functions

static uint DoScan ()
 Do the scan for GRFs. More...
 

Private Attributes

uint next_update
 The next (realtime tick) we do update the screen.
 
uint num_scanned
 The number of GRFs we have scanned.
 
- Private Attributes inherited from FileScanner
Subdirectory subdir
 The current sub directory we are searching through.
 

Additional Inherited Members

- Private Member Functions inherited from FileScanner
virtual ~FileScanner ()
 Destruct the proper one... More...
 
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...
 

Detailed Description

Helper for scanning for files with GRF as extension.

Definition at line 627 of file newgrf_config.cpp.

Member Function Documentation

◆ AddFile()

bool GRFFileScanner::AddFile ( const char *  filename,
size_t  basepath_length,
const char *  tar_filename 
)
virtual

Add a file with the given filename.

Parameters
filenamethe full path to the file to read
basepath_lengthamount of characters to chop of before to get a filename relative to the search path.
tar_filenamethe name of the tar file the file is read from.
Returns
true if the file is added.

Implements FileScanner.

Definition at line 650 of file newgrf_config.cpp.

References _modal_progress_paint_mutex, _modal_progress_work_mutex, _realtime_tick, ThreadMutex::BeginCritical(), ThreadMutex::EndCritical(), GRFConfig::filename, FillGRFDetails(), GetGRFStringFromGRFText(), GRFConfig::GetName(), GRFIdentifier::grfid, GRFConfig::ident, GRFIdentifier::md5sum, GRFParameterInfo::name, GRFConfig::name, GRFConfig::next, GRFTextWrapper::text, and UpdateNewGRFScanStatus().

◆ DoScan()

static uint GRFFileScanner::DoScan ( )
inlinestatic

Do the scan for GRFs.

Definition at line 639 of file newgrf_config.cpp.

References _settings_client, ClientSettings::gui, GUISettings::last_newgrf_count, NEWGRF_DIR, num_scanned, and FileScanner::Scan().

Referenced by DoScanNewGRFFiles().


The documentation for this class was generated from the following file: