MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / IsValid

Method IsValid

src/strings.cpp:2017–2032  ·  view source on GitHub ↗

* Check whether the header is a valid header for OpenTTD. * @return true iff the header is deemed valid. */

Source from the content-addressed store, hash-verified

2015 * @return true iff the header is deemed valid.
2016 */
2017bool LanguagePackHeader::IsValid() const
2018{
2019 return this->ident == TO_LE32(LanguagePackHeader::IDENT) &&
2020 this->version == TO_LE32(LANGUAGE_PACK_VERSION) &&
2021 this->plural_form < LANGUAGE_MAX_PLURAL &&
2022 this->text_dir <= 1 &&
2023 this->newgrflangid < MAX_LANG &&
2024 this->num_genders < MAX_NUM_GENDERS &&
2025 this->num_cases < MAX_NUM_CASES &&
2026 StrValid(this->name) &&
2027 StrValid(this->own_name) &&
2028 StrValid(this->isocode) &&
2029 StrValid(this->digit_group_separator) &&
2030 StrValid(this->digit_group_separator_currency) &&
2031 StrValid(this->digit_decimal_separator);
2032}
2033
2034/**
2035 * Check whether a translation is sufficiently finished to offer it to the public.

Callers 15

CmdIndustrySetFlagsFunction · 0.45
FinaliseCargoArrayFunction · 0.45
GetShipIconFunction · 0.45
GetImageMethod · 0.45
ReadLanguagePackFunction · 0.45
GetLanguageFileHeaderFunction · 0.45
CmdCreateSubsidyFunction · 0.45
CheckSubsidisedFunction · 0.45
GetImageMethod · 0.45
GetRailIconFunction · 0.45
SetupCargoForClimateFunction · 0.45

Calls 2

TO_LE32Function · 0.85
StrValidFunction · 0.85

Tested by

no test coverage detected