28 lines
777 B
C#
28 lines
777 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
|
|
namespace SSTServoPlayer
|
|
{
|
|
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);
|
|
}
|
|
}
|
|
}
|