OpenTTD Source: StringParameterBackup Struct Reference

OpenTTD Source 14.0-beta1

Public Member Functions | Data Fields
StringParameterBackup Struct Reference

Data that is to be stored when backing up StringParameters. More...

`#include <strings_type.h>`

## Public Member Functions
StringParameterBackup & | operator= (uint64_t data)
| Assign the numeric data with the given value, while clearing the stored string. More...
StringParameterBackup & | operator= (const std::string_view string)
| Assign a copy of the given string to the string field, while clearing the data field. More...

## Data Fields
uint64_t | data
| The data field; valid when string has no value.
std::optional< std::string > | string
| The string value.

## Detailed Description

Data that is to be stored when backing up StringParameters.

Definition at line 92 of file strings_type.h.

## Member Function Documentation

## ◆ operator=() [1/2]

StringParameterBackup& StringParameterBackup::operator= | ( | const std::string_view | string | ) |
| inline

Assign a copy of the given string to the string field, while clearing the data field.

Parameters

  string | The new value of the string.

Returns
  This object.

Definition at line 113 of file strings_type.h.

## ◆ operator=() [2/2]

StringParameterBackup& StringParameterBackup::operator= | ( | uint64_t | data | ) |
| inline

Assign the numeric data with the given value, while clearing the stored string.

Parameters

  data | The new value of the data field.

Returns
  This object.

Definition at line 101 of file strings_type.h.

References data.

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

- src/strings_type.h