OpenTTD Source 20260208-master-g43af8e94d0
ScenarioScanner Class Reference

Scanner to find the unique IDs of scenarios. More...

Inheritance diagram for ScenarioScanner:
FileScanner

Public Member Functions

 ScenarioScanner ()
 Initialise.
void Scan (bool rescan)
 Scan, but only if it's needed.
bool AddFile (const std::string &filename, size_t, const std::string &) override
 Add a file with the given filename.

Private Attributes

bool scanned
 Whether we've already scanned.

Additional Inherited Members

Protected Member Functions inherited from FileScanner
virtual ~FileScanner ()=default
 Destruct the proper one...
uint Scan (std::string_view extension, Subdirectory sd, bool tars=true, bool recursive=true)
 Scan for files with the given extension in the given search path.
uint Scan (std::string_view extension, const std::string &directory, bool recursive=true)
 Scan for files with the given extension in the given search path.
Protected Attributes inherited from FileScanner
Subdirectory subdir {}
 The current sub directory we are searching through.

Detailed Description

Scanner to find the unique IDs of scenarios.

Definition at line 603 of file fios.cpp.

Constructor & Destructor Documentation

◆ ScenarioScanner()

ScenarioScanner::ScenarioScanner ( )
inline

Initialise.

Definition at line 607 of file fios.cpp.

References scanned.

Member Function Documentation

◆ AddFile()

bool ScenarioScanner::AddFile ( const std::string & filename,
size_t basepath_length,
const std::string & tar_filename )
inlineoverridevirtual

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 621 of file fios.cpp.

References FioFOpenFile(), include(), and SCENARIO_DIR.

◆ Scan()

void ScenarioScanner::Scan ( bool rescan)
inline

Scan, but only if it's needed.

Parameters
rescanwhether to force scanning even when it's not necessary

Definition at line 613 of file fios.cpp.

References FileScanner::Scan(), and SCENARIO_DIR.

Field Documentation

◆ scanned

bool ScenarioScanner::scanned
private

Whether we've already scanned.

Definition at line 604 of file fios.cpp.

Referenced by ScenarioScanner().


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