OpenTTD Source 20241224-master-gf74b0cf984
IniItem Struct Reference

A single "line" in an ini file. More...

#include <ini_type.h>

Public Member Functions

 IniItem (std::string_view name)
 Construct a new in-memory item of an Ini file.
 
void SetValue (std::string_view value)
 Replace the current value with another value.
 

Data Fields

std::string name
 The name of this item.
 
std::optional< std::string > value
 The value of this item.
 
std::string comment
 The comment associated with this item.
 

Detailed Description

A single "line" in an ini file.

Definition at line 23 of file ini_type.h.

Constructor & Destructor Documentation

◆ IniItem()

IniItem::IniItem ( std::string_view  name)

Construct a new in-memory item of an Ini file.

Parameters
parentthe group we belong to
namethe name of the item

Definition at line 23 of file ini_load.cpp.

References name, and StrMakeValid().

Member Function Documentation

◆ SetValue()

void IniItem::SetValue ( std::string_view  value)

Replace the current value with another value.

Parameters
valuethe value to replace with.

Definition at line 32 of file ini_load.cpp.

References value.

Referenced by GraphicsSetSaveConfig(), IniSaveSettingList(), HotkeyList::Save(), and SaveVersionInConfig().

Field Documentation

◆ comment

std::string IniItem::comment

The comment associated with this item.

Definition at line 26 of file ini_type.h.

Referenced by IniLoadFile::LoadFromDisk().

◆ name

std::string IniItem::name

The name of this item.

Definition at line 24 of file ini_type.h.

Referenced by GRFLoadConfig(), IniItem(), and IniGroup::RemoveItem().

◆ value


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