OpenTTD Source 20260917-master-gec444f7315
VarType Struct Reference

Container of a variable's characteristics about a variable's storage. More...

#include <saveload.h>

Public Member Functions

constexpr VarType ()
 Create an empty VarType.
constexpr VarType (VarFileType file, VarMemType mem)
 Create a VarType with the given file and memory configurations.
constexpr VarType (StringValidationSettings string_validation_settings)
 Create a String var type with the given string validation settings.
constexpr VarType (SLRefType ref)
 Create a VarType linking to a reference.
constexpr bool operator== (const VarType &other) const =default
 Equality operator.

Data Fields

VarFileType file {}
 The way of storing data in the file.
VarMemType mem {}
 The way of storing data in memory.
StringValidationSettings string_validation_settings {}
 Any settings related to validation of the strings.
SLRefType ref {}
 The reference type.

Detailed Description

Container of a variable's characteristics about a variable's storage.

Definition at line 675 of file saveload.h.

Constructor & Destructor Documentation

◆ VarType() [1/4]

VarType::VarType ( )
inlineconstexpr

Create an empty VarType.

Definition at line 682 of file saveload.h.

Referenced by operator==().

◆ VarType() [2/4]

VarType::VarType ( VarFileType file,
VarMemType mem )
inlineconstexpr

Create a VarType with the given file and memory configurations.

Parameters
fileThe file storage configuration.
memThe memory storage configuration.

Definition at line 689 of file saveload.h.

References file, and mem.

◆ VarType() [3/4]

VarType::VarType ( StringValidationSettings string_validation_settings)
inlineconstexpr

Create a String var type with the given string validation settings.

Parameters
string_validation_settingsHow to validate the string.

Definition at line 695 of file saveload.h.

References file, mem, and string_validation_settings.

◆ VarType() [4/4]

VarType::VarType ( SLRefType ref)
inlineconstexpr

Create a VarType linking to a reference.

Parameters
refThe reference.

Definition at line 702 of file saveload.h.

References ref.

Member Function Documentation

◆ operator==()

bool VarType::operator== ( const VarType & other) const
constexprdefault

Equality operator.

Parameters
otherThe element to compare to.
Returns
true iff all elements of this and other are the same.

References VarType().

Field Documentation

◆ file

VarFileType VarType::file {}

The way of storing data in the file.

Definition at line 676 of file saveload.h.

Referenced by GetSavegameFileType(), SlCalcConvFileLen(), SlCopyInternal(), SlSaveLoadConv(), VarType(), and VarType().

◆ mem

VarMemType VarType::mem {}

The way of storing data in memory.

Definition at line 677 of file saveload.h.

Referenced by GetVariableAddress(), SlArray(), SlCalcVectorLen(), SlCopyInternal(), SlSaveLoadConv(), SlStdString(), SlVector(), VarType(), and VarType().

◆ ref

SLRefType VarType::ref {}

The reference type.

Definition at line 679 of file saveload.h.

Referenced by SlSaveLoadRef(), and VarType().

◆ string_validation_settings

StringValidationSettings VarType::string_validation_settings {}

Any settings related to validation of the strings.

Definition at line 678 of file saveload.h.

Referenced by SlStdString(), and VarType().


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