much happenings in this fucked up world
This commit is contained in:
parent
29fc81ef37
commit
2f6d3b7b5b
55 changed files with 1067 additions and 52 deletions
28
Legacy Tools/PC2SSTPlayer/INIFile.cs
Normal file
28
Legacy Tools/PC2SSTPlayer/INIFile.cs
Normal file
|
@ -0,0 +1,28 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace PC2SSTPlayer
|
||||
{
|
||||
public class INIFile
|
||||
{
|
||||
public Dictionary<string, string> Data { get; set; }
|
||||
|
||||
public INIFile(Dictionary<string, string> data)
|
||||
{
|
||||
Data = data;
|
||||
}
|
||||
|
||||
public static INIFile Load(string inPath)
|
||||
{
|
||||
Dictionary<string, string> outData = new Dictionary<string, string>();
|
||||
string[] rawFile = File.ReadAllLines(inPath);
|
||||
foreach (string line in rawFile)
|
||||
{
|
||||
if (line.StartsWith(";") || line.Trim() == "") continue;
|
||||
outData.Add(line.Split("=")[0].Trim(), line.Split("=")[1].Trim());
|
||||
}
|
||||
return new INIFile(outData);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue