OpenTTD Source: src/script/script_scanner.cpp File Reference

OpenTTD Source 15.0-beta1

Data Structures | Functions
script_scanner.cpp File Reference

Allows scanning for scripts. More...

`#include "../stdafx.h"`
`#include "../debug.h"`
`#include "../string_func.h"`
`#include "../settings_type.h"`
`#include "../script/squirrel.hpp"`
`#include "script_scanner.hpp"`
`#include "script_info.hpp"`
`#include "script_fatalerror.hpp"`
`#include "../network/network_content.h"`
`#include "../3rdparty/md5/md5.h"`
`#include "../tar_type.h"`
`#include "../safeguards.h"`

Go to the source code of this file.

## Data Structures
struct | ScriptFileChecksumCreator
| Helper for creating a MD5sum of all files within of a script. More...

## Functions
static bool | IsSameScript (const ContentInfo *ci, bool md5sum, ScriptInfo *info, Subdirectory dir)
| Check whether the script given in info is the same as in ci based on the shortname and md5 sum.

## Detailed Description

Allows scanning for scripts.

Definition in file script_scanner.cpp.

## Function Documentation

## ◆ IsSameScript()

static bool IsSameScript | ( | const ContentInfo * | ci,
|  | bool | md5sum,
|  | ScriptInfo * | info,
|  | Subdirectory | dir
| ) |  |
| static

Check whether the script given in info is the same as in ci based on the shortname and md5 sum.

Parameters

  ci | The information to compare to.
  md5sum | Whether to check the MD5 checksum.
  info | The script to get the shortname and md5 sum from.

Returns
  True iff they're the same.

Definition at line 198 of file script_scanner.cpp.

References ScriptFileChecksumCreator::AddFile(), ScriptInfo::GetMainScript(), ScriptInfo::GetShortName(), ScriptInfo::GetTarFile(), ScriptScanner::main_script, ContentInfo::md5sum, ScriptFileChecksumCreator::md5sum, FileScanner::Scan(), StrEqualsIgnoreCase(), and ContentInfo::unique_id.

Referenced by ScriptScanner::FindMainScript(), and ScriptScanner::HasScript().