OpenTTD Source 20260208-master-g43af8e94d0
ScriptFileChecksumCreator Struct Reference

Helper for creating a MD5sum of all files within of a script. More...

Inheritance diagram for ScriptFileChecksumCreator:
FileScanner

Public Member Functions

 ScriptFileChecksumCreator (Subdirectory dir)
 Initialise the md5sum to be all zeroes, so we can easily xor the data.
bool AddFile (const std::string &filename, size_t, const std::string &) override
 Add a file with the given filename.
Public 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.

Data Fields

MD5Hash md5sum
 The final md5sum.
Subdirectory dir
 The directory to look in.

Additional Inherited Members

Protected Attributes inherited from FileScanner
Subdirectory subdir {}
 The current sub directory we are searching through.

Detailed Description

Helper for creating a MD5sum of all files within of a script.

Definition at line 143 of file script_scanner.cpp.

Constructor & Destructor Documentation

◆ ScriptFileChecksumCreator()

ScriptFileChecksumCreator::ScriptFileChecksumCreator ( Subdirectory dir)
inline

Initialise the md5sum to be all zeroes, so we can easily xor the data.

Definition at line 151 of file script_scanner.cpp.

References dir.

Member Function Documentation

◆ AddFile()

bool ScriptFileChecksumCreator::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 154 of file script_scanner.cpp.

References FioFOpenFile().

Referenced by IsSameScript().

Field Documentation

◆ dir

Subdirectory ScriptFileChecksumCreator::dir

The directory to look in.

Definition at line 145 of file script_scanner.cpp.

Referenced by ScriptFileChecksumCreator().

◆ md5sum

MD5Hash ScriptFileChecksumCreator::md5sum

The final md5sum.

Definition at line 144 of file script_scanner.cpp.

Referenced by IsSameScript().


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