OpenTTD Source 20260704-master-gbf70c61fb8
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 (SLRefType ref)
 Create a VarType linking to a reference.
constexpr bool operator== (const VarType &other) const =default
 Equality operator.
constexpr VarType operator| (StringValidationSetting string_validation_setting) const
 Transitional helper function to add a SaveLoadFlag to this type.

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 694 of file saveload.h.

Constructor & Destructor Documentation

◆ VarType() [1/3]

VarType::VarType ( )
inlineconstexpr

Create an empty VarType.

Definition at line 701 of file saveload.h.

Referenced by operator==(), and operator|().

◆ VarType() [2/3]

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 708 of file saveload.h.

References file, and mem.

◆ VarType() [3/3]

VarType::VarType ( SLRefType ref)
inlineconstexpr

Create a VarType linking to a reference.

Parameters
refThe reference.

Definition at line 714 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().

◆ operator|()

VarType VarType::operator| ( StringValidationSetting string_validation_setting) const
inlineconstexpr

Transitional helper function to add a SaveLoadFlag to this type.

Parameters
string_validation_settingThe string_validation_setting to set.
Returns
A copy of this with the string_validation_setting set.

Definition at line 728 of file saveload.h.

References BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Set(), string_validation_settings, and VarType().

Field Documentation

◆ file

VarFileType VarType::file {}

The way of storing data in the file.

Definition at line 695 of file saveload.h.

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

◆ mem

VarMemType VarType::mem {}

The way of storing data in memory.

Definition at line 696 of file saveload.h.

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

◆ ref

SLRefType VarType::ref {}

The reference type.

Definition at line 698 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 697 of file saveload.h.

Referenced by operator|(), and SlStdString().


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