OpenTTD Source: FiosNumberedSaveName Struct Reference

OpenTTD Source 14.0-beta3

Public Member Functions | Private Attributes
FiosNumberedSaveName Struct Reference

A savegame name automatically numbered. More...

`#include <fios.h>`

## Public Member Functions
| FiosNumberedSaveName (const std::string &prefix)
| Constructs FiosNumberedSaveName. More...
std::string | Filename ()
| Generate a savegame name and number according to _settings_client.gui.max_num_autosaves. More...
std::string | Extension ()
| Generate an extension for a savegame name. More...

## Private Attributes
std::string | prefix
int | number

## Detailed Description

A savegame name automatically numbered.

Definition at line 129 of file fios.h.

## Constructor & Destructor Documentation

## ◆ FiosNumberedSaveName()

FiosNumberedSaveName::FiosNumberedSaveName | ( | const std::string & | prefix | ) |

Constructs FiosNumberedSaveName.

Initial number is the most recent save, or -1 if not found.

Parameters

  prefix | The prefix to use to generate a filename.

< Static as the lambda needs access to it.

Definition at line 725 of file fios.cpp.

## Member Function Documentation

## ◆ Extension()

std::string FiosNumberedSaveName::Extension | ( |  | ) |

Generate an extension for a savegame name.

Returns
  An extension in format "-<prefix>.sav".

Definition at line 772 of file fios.cpp.

Referenced by DoAutoOrNetsave().

## ◆ Filename()

std::string FiosNumberedSaveName::Filename | ( |  | ) |

Generate a savegame name and number according to _settings_client.gui.max_num_autosaves.

Returns
  A filename in format "<prefix><number>.sav".

Definition at line 762 of file fios.cpp.

References _settings_client, ClientSettings::gui, and GUISettings::max_num_autosaves.

Referenced by DoAutoOrNetsave().

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

- src/fios.h
- src/fios.cpp