1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-22 22:34:33 +01:00

Space out sections when writing config.ini

This commit is contained in:
Ted John
2017-02-19 21:37:06 +00:00
parent 8d3bf515ed
commit 87be032adc

View File

@@ -22,7 +22,8 @@
class IniWriter final : public IIniWriter
{
private:
FileStream _fs;
FileStream _fs;
bool _firstSection = false;
public:
IniWriter(const std::string &path)
@@ -32,6 +33,12 @@ public:
void WriteSection(const std::string &name) override
{
if (!_firstSection)
{
WriteLine();
}
_firstSection = false;
WriteLine("[" + name + "]");
}
@@ -78,10 +85,15 @@ private:
WriteLine(name + " = " + value);
}
void WriteLine()
{
_fs.Write(PLATFORM_NEWLINE, String::SizeOf(PLATFORM_NEWLINE));
}
void WriteLine(const std::string &line)
{
_fs.Write(line.c_str(), line.size());
_fs.Write(PLATFORM_NEWLINE, String::SizeOf(PLATFORM_NEWLINE));
WriteLine();
}
};