Changeset - r24432:c13edb82020b
[Not reviewed]
master
3 1 0
frosch - 4 years ago 2020-12-14 20:46:35
frosch@openttd.org
Cleanup: use std::optional instead of custom implementation.
4 files changed with 2 insertions and 1124 deletions:
0 comments (0 inline, 0 general)
src/3rdparty/optional/LICENSE_1_0.txt
Show inline comments
 
deleted file
src/3rdparty/optional/optional.hpp
Show inline comments
 
deleted file
src/3rdparty/optional/ottd_optional.h
Show inline comments
 
deleted file
src/ini_type.h
Show inline comments
 
@@ -9,26 +9,26 @@
 

	
 
#ifndef INI_TYPE_H
 
#define INI_TYPE_H
 

	
 
#include "fileio_type.h"
 
#include <string>
 
#include "3rdparty/optional/ottd_optional.h"
 
#include <optional>
 

	
 
/** Types of groups */
 
enum IniGroupType {
 
	IGT_VARIABLES = 0, ///< Values of the form "landscape = hilly".
 
	IGT_LIST      = 1, ///< A list of values, separated by \n and terminated by the next group block.
 
	IGT_SEQUENCE  = 2, ///< A list of uninterpreted lines, terminated by the next group block.
 
};
 

	
 
/** A single "line" in an ini file. */
 
struct IniItem {
 
	IniItem *next;                    ///< The next item in this group
 
	std::string name;                 ///< The name of this item
 
	opt::optional<std::string> value; ///< The value of this item
 
	std::optional<std::string> value; ///< The value of this item
 
	std::string comment;              ///< The comment associated with this item
 

	
 
	IniItem(struct IniGroup *parent, const std::string &name);
 
	~IniItem();
 

	
 
	void SetValue(const char *value);
0 comments (0 inline, 0 general)